![]() |
#1 |
Enthusiast
![]() Posts: 34
Karma: 10
Join Date: Sep 2007
Device: Kindle Keyboard 3G
|
Button Reassignment?
Just wondering if there is any way to repurpose the buttons on a K2i.
Just got mine, and I really like it so far, but the way I normally read in bed it is actually fairly uncomfortable. I normally read laying on my right side with the ebook's flat right edge laying on the bed. On my old Sony, the page buttons were on the bottom right and left, so I didn't have to have my hands underneath the reader holding/balancing it while I read, which I have to with the kindle. Is there a way to repurpose the 'SYM' button or another in the area as another 'next page' button? This would basically solve the only gripe I have with it. I could swap it with the left 'next page' button (next page on the left is really weird to me anyways). Or any other suggestions? Thanks. |
![]() |
![]() |
![]() |
#2 |
PandaMuse
![]() ![]() Posts: 104
Karma: 104
Join Date: Nov 2009
Location: Florida
Device: kindle dx, kindle touch SO, kindle fire, kindle fire hd8.9
|
Not at present. There is a KDK devkit currently in closed beta. Based on my reading of the documentation thus released, capturing button pushes and repurposing them should be possible for developers using the KDK.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Right now you can send button event from a shell via usbnet. Pretty sure capturing/remapping might be too much to ask without the SDK though
![]() |
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 19
Karma: 10
Join Date: Jul 2010
Device: kindle
|
this is excellent news, to me, since my whole reason for wanting to jailbreak and run usbnet is to remotely trigger "next page" events. how does the script work? (i spotted uinput in someone's post with a list of loaded modules, so it was going to be the first thing i tried.)
|
![]() |
![]() |
![]() |
#5 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Can't remember the exact correct string, check the power test scripts somewhere in /test, there's multiple next/forward loop scripts.
EDIT: Huh. Terminal backlog FTW. NextPage: echo "send 124" > /proc/keypad Last edited by NiLuJe; 07-23-2010 at 10:07 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Member
![]() Posts: 19
Karma: 10
Join Date: Jul 2010
Device: kindle
|
Quote:
btw, poking around, i'm not convinced that remapping the keys wouldn't be possible. the keypad and 5-way both appear as /dev/input/event[01] devices. for some reason (not sure why) the uinput module is also present. /dev/input/uinput can be used to create a new /dev/input/eventN device and inject events to it. so, it's possible to write a program which opens the /dev/input/event[01] devices, grabs them so no one else gets their input, massages the data, and reinjects into the input subsystem via uinput. the trick will then be getting whoever is watching /dev/input/event[01] currently to watch the new device(s) instead. depending on how those clients open the input devices, it might Just Work -- for instance, they might just enumerate and watch all button devices. (this is likely the case, since the keypad and 5way devices seem identical, other than name.) the next problem is getting the new remapping program to run before whatever it is that reads the input devices, so that the devices are reinitialized before it starts. but i'm guessing that's possible as well. i can point someone at code which does much of the above, for a quite different purpose, if they're interested. |
|
![]() |
![]() |
![]() |
#7 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Good to know (I'm not familiar with the uinput module)!
If the framework itself is the only thing handling input events in the end, that shouldn't be too hard to implement. (That's what we do with fonts/ss, we setup things before the framework). If it's handled earlier/by low-level stuff, we'd have to dig a little bit deeper. (If the code is looking for the input event devices file specifically by name, we can always tweak the udev rules). If something's grabbing the input devices in userland, lsof will tell what process is handling things. Last edited by NiLuJe; 07-26-2010 at 01:44 PM. |
![]() |
![]() |
![]() |
#8 |
Member
![]() Posts: 19
Karma: 10
Join Date: Jul 2010
Device: kindle
|
in the meantime, do you happen to know if it's possible to inject multi-key keypad combinations via /proc/keypad? e.g., "alt-shift-G"? i can get a shift with an echo of 42 before the echo of the G code, but i can't seem to get an Alt.
|
![]() |
![]() |
![]() |
#9 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
No idea, sorry, I got the NextPage/PreviousPage from the power test scripts.
And I'm not familiar enough with the Linux event input interface to know if you could somehow get the correct code by shutting down the framework (or whatever actually grabs the event device), and listening to it yourself. Also not sure if the keyCode reported in the logs when using ;debugOn would actually help: Code:
D TextField:DebugInfo::KEY:java.awt.event.KeyEvent[KEY_PRESSED,keyCode=16,keyChar='ï¿¿',modifiers=Shift,extModifiers=Shift] on com.lab126.mario.DisplayServiceImpl$1[null] Last edited by NiLuJe; 07-26-2010 at 03:06 PM. |
![]() |
![]() |
![]() |
#10 | |
Member
![]() Posts: 19
Karma: 10
Join Date: Jul 2010
Device: kindle
|
thanks. hadn't seen that log info yet.
fyi -- if you do "hexdump -C /dev/input/event0" while pressing keys, they keycode that you pass to "send DDD >/proc/keypad) appears in hex as byte 10 (counting from 0). NextPage is the 7c value in the following, where the first line is the press, and the second is the release: Quote:
in any case, i realized i don't need to inject those keytrokes, because one can grab a raw copy of the screen directly from /proc/eink_fb/virtual_fb. |
|
![]() |
![]() |
![]() |
#11 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79
Karma: 187319
Join Date: Jul 2010
Device: Kindle 2
|
Don't forget if you want to press a button from the direction pad, output to /proc/fiveway instead of /proc/keypad.
You can get the keycodes by running waitforkey with noparameters from shell. Once a key is pressed, it will output two numbers. The first is the key number (e.g. 124 for next page); the second is the key state (0 = released, 1 = pressed, 2 = held). If you want, you can run waitforkey with a key number as the parameter (e.g. waitforkey 124) and it will keep waiting until that specific key is pressed. This doesn't help with remapping, but one can add new keyboard shortcuts... |
![]() |
![]() |
![]() |
#12 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79
Karma: 187319
Join Date: Jul 2010
Device: Kindle 2
|
Sorry, edit time is already lapsed...
Actually, the original poster's question could be solved this way, since the SYM key doesn't do anything in plain reader mode. All you need is a script which executes the following in a continuous loop: Code:
waitforkey 94 echo "send 124" > /proc/keypad |
![]() |
![]() |
![]() |
#13 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 32
Karma: 46558
Join Date: Feb 2012
Device: Kindle4NT
|
Could anybody advice a solution to bind custom script launch to key or key combination on K4? It wold be quite comfortable to rotate screen via long kepress or pressing 2 buttons simultaneously...
|
![]() |
![]() |
![]() |
#14 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: May 2012
Device: kobo touch
|
How could we get the touch screen "tap" information and send it as a next page ?
|
![]() |
![]() |
![]() |
#15 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hi and what is the Karma button for? | *reg* | Introduce Yourself | 9 | 07-07-2010 02:36 AM |
The Back button | coltrane | Amazon Kindle | 7 | 05-17-2010 10:10 AM |
Push my button! | vivaldirules | Lounge | 24 | 12-18-2007 11:35 AM |
What button??? | lmarie | Fictionwise eBookwise | 1 | 12-11-2007 05:21 PM |