Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-16-2010, 01:53 AM   #1
anathema
Enthusiast
anathema began at the beginning.
 
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.
anathema is offline   Reply With Quote
Old 07-23-2010, 12:58 AM   #2
eboyhan
PandaMuse
eboyhan doesn't littereboyhan doesn't litter
 
eboyhan's Avatar
 
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.
eboyhan is offline   Reply With Quote
Advert
Old 07-23-2010, 01:02 AM   #3
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
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 .
NiLuJe is offline   Reply With Quote
Old 07-23-2010, 01:34 PM   #4
pgf
Member
pgf began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Jul 2010
Device: kindle
Quote:
Originally Posted by NiLuJe View Post
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 .
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.)
pgf is offline   Reply With Quote
Old 07-23-2010, 10:00 PM   #5
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
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.
NiLuJe is offline   Reply With Quote
Advert
Old 07-26-2010, 10:45 AM   #6
pgf
Member
pgf began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Jul 2010
Device: kindle
Quote:
Originally Posted by NiLuJe View Post
EDIT: Huh. Terminal backlog FTW.

NextPage:

echo "send 124" > /proc/keypad
thanks! perfect. just what i needed. between helping me find the right usbnetwork hack, and this, you've been very helpful. i appreciate it.

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.
pgf is offline   Reply With Quote
Old 07-26-2010, 01:41 PM   #7
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
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.
NiLuJe is offline   Reply With Quote
Old 07-26-2010, 02:12 PM   #8
pgf
Member
pgf began at the beginning.
 
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.
pgf is offline   Reply With Quote
Old 07-26-2010, 03:00 PM   #9
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
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]
(That's supposed to be a SHIFT keypress).

Last edited by NiLuJe; 07-26-2010 at 03:06 PM.
NiLuJe is offline   Reply With Quote
Old 07-26-2010, 03:22 PM   #10
pgf
Member
pgf began at the beginning.
 
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:
00000000 aa de 4d 4c 9f 24 0a 00 01 00 7c 00 01 00 00 00 |..ML.$....|.....|
00000010 aa de 4d 4c ba 31 0d 00 01 00 7c 00 00 00 00 00 |..ML.1....|.....|
(earlier bytes in the lines are timestamp and type information -- see linux/input.h)

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.
pgf is offline   Reply With Quote
Old 07-27-2010, 02:20 PM   #11
isotherm
Connoisseur
isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.
 
Posts: 79
Karma: 187319
Join Date: Jul 2010
Device: Kindle 2
Quote:
Originally Posted by NiLuJe View Post
NextPage:

echo "send 124" > /proc/keypad
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...
isotherm is offline   Reply With Quote
Old 07-27-2010, 02:33 PM   #12
isotherm
Connoisseur
isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.
 
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
The problem with this is that it always converts the SYM key into NEXT PAGE, even when you are trying to type symbols into the search field. A more elegant solution would need to provide a hotkey to enable/disable this feature on demand (or a way to detect what the current UI action is)...
isotherm is offline   Reply With Quote
Old 05-04-2012, 02:19 AM   #13
drauger
Enthusiast
drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.drauger has every book they ever wanted in electronic form on their reader.
 
drauger's Avatar
 
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...
drauger is offline   Reply With Quote
Old 06-07-2012, 02:03 AM   #14
Rom1
Junior Member
Rom1 began at the beginning.
 
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 ?
Rom1 is offline   Reply With Quote
Old 06-07-2012, 08:23 AM   #15
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by pgf View Post
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:

(earlier bytes in the lines are timestamp and type information -- see linux/input.h)

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.
You can also do "waitforkey". I do that in a "while" loop to get a bunch of keys. Simpler output.
geekmaster is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 03:41 PM.


MobileRead.com is a privately owned, operated and funded community.