![]() |
#16 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Finally, something that does almost touch on my limited knowledge of *nix graphics.
In the normal course of events (no pun intended), X does not use the raw keyboard codes. There is a "keybrd.something" or a "keymap.something" running/used that does the raw-to-X conversion of raw byte strings into the expected X11 byte strings. Sorry I can't be more specific, I don't know this subject in any more detail than given above. NOTE: It may be hard to find in the Kindle because it may not be there (or may be built into the kernel). For instance, you will note in geekmaster examples he is almost always reading the "raw" keyboard stream, not a "cooked" translation. My guess is because the "cooked" translation wasn't available for use (by either geekmaster or by X11). |
![]() |
![]() |
![]() |
#17 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 71
Karma: 23166
Join Date: Sep 2012
Device: Kindle 4NT
|
oooooh!
Code:
com.lab126.framework rw Has transfer_status w Int insertKeystroke r Str xfsn rw Str logMask w Int logContent rw Str logLevel r Int wirelessSwitch w Int read r Int isRegistered r Int wanSwitch w Int dismissDialog ![]() Code:
# lipc-set-prop -s com.lab126.framework insertKeystroke 194 com.lab126.framework failed to set value for property insertKeystroke (0x8 lipcErrNoSuchProperty) Last edited by pepijndevos; 11-04-2012 at 12:10 PM. |
![]() |
![]() |
![]() |
#18 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
(after opening browser once and minimising)
lsof: Spoiler:
[root@kindle root]# /usr/bin/browserd /var/local/java/prefs/cookies /usr/bin/browserd: symbol lookup error: /usr/bin/browserd: undefined symbol: kindle_stats hmmm now I noticed something launch during the URL selection phase... in htop. That may account for that error. perhaps browserd needs invoking via java (well, with some params anyways) let me try that again. Last edited by twobob; 11-04-2012 at 12:18 PM. |
![]() |
![]() |
![]() |
#19 | ||
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Quote:
Usage: Quote:
I personally suspect that cvm "injects" something at time of launch. working out a way to put strace in the middle of that right now. EDIT: My Lipc-probe keeps segfaulting ![]() Last edited by twobob; 11-04-2012 at 12:28 PM. |
||
![]() |
![]() |
![]() |
#20 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
It seems to me that elevating the logging level of lipc (somewhere?) would be a Good thing ™
|
![]() |
![]() |
![]() |
#21 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 71
Karma: 23166
Join Date: Sep 2012
Device: Kindle 4NT
|
Some more thought and experiments:
Works: Code:
# lipc-send-event -r 3 com.lab126.hal orientationUp Code:
# lipc-send-event -r 3 com.lab126.framework insertKeystroke -is 194 Failed to open LIPC Retrying in 1 secs... Failed to open LIPC Retrying in 1 secs... Failed to open LIPC Retrying in 1 secs... Failed to open LIPC com.lab126.framework failed to send event insertKeystroke Wild imagination: Code:
while true do waitforkey | cut -d " " -f 1 | xargs lipc-send-event -r 3 com.lab126.framework insertKeystroke -is done |
![]() |
![]() |
![]() |
#22 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
another viewpoint for process hierarchy
|
![]() |
![]() |
![]() |
#23 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
cant we just attach the debugger?
I recall something about this?? |
![]() |
![]() |
![]() |
#24 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
okay. to get more of an idea of WHAT is actually happening: This actually sounds like a job for the new JBPATCH for the 3. Why not add some OUTPUT
![]() Also there was some mention of a nice tool for unrolling script in there. https://www.mobileread.com/forums/sho....php?p=2096039 might need updating but yeah, helpful. That would cut through the veils quite a bit. |
![]() |
![]() |
![]() |
#25 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 71
Karma: 23166
Join Date: Sep 2012
Device: Kindle 4NT
|
I messed around with the jars and a decompiler a bit, but I can't tell what's going on.
I grepped for extkeyboard, which turned up nothing. Weird. Is this handled by the JVM? But since the arrow keys on the external keyboard work, there should be some KeyEvent coming into the JVM. Grepping for that gave me a huge list of classes, some of which are in the KDK which are IMO unlikely to contain the actual action. I also found a bunch of a/b/c.class files. Nothing promising so far. Somewhere, I suspect the keycodes are filtered, but I can't think of a reliable way to grep for those keycodes. There is also VirtualKeyboardEvent, but that seems to be mostly about showing and hiding it. Haven't found where the actual virtual events go. |
![]() |
![]() |
![]() |
#26 | |||
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12
Karma: 152738
Join Date: Jul 2010
Device: Kindle DXG
|
Using LIPC insertKeystroke property
Hello,
after reading though this thread, I decided to get familiar with this topic myself. The insertKeystroke thing seemed promising, so I decided to give it a try. And indeed it does work now! Why is this? The problem is that insertKeystroke is not an event, but a property. This thought occured to me after reading the help output of lipc-probe, where it says: Quote:
In order to inject a keystroke into the framework, lipc-set-prop has to be called with the following parameters: Quote:
E.g. to inject the letter "g" into the framework, try the following command: Quote:
Some other thing that I noticed: In some cases, the Java keyboard has to be opened before you can insert any keystrokes. This is especially true for the browser. Here, the Java keyboard has to be opened before you can type texts into text boxes. Now that the insertFramework stuff has been done, we still need a way to pass keystrokes from the keyboard into the insertKeystroke property of the framework. Probably some sort of C program is required to accomplish this. I will investigate tomorrow. Regards, Chris |
|||
![]() |
![]() |
![]() |
#27 | ||
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
![]() |
||
![]() |
![]() |
![]() |
#28 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 71
Karma: 23166
Join Date: Sep 2012
Device: Kindle 4NT
|
Yay!
I tried the above snippet in a waitforkey loop, and it works! Only... key code != character code, so it just displays question marks and crazy characters. I'll try to find out how to send things from C code. I think I remember reading this all works over dbus, but I might be wrong. [edit] Code:
signal sender=org.freedesktop.DBus -> dest=(null destination) pat h=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=N ameOwnerChanged string ":1.239" string "" string ":1.239" signal sender=org.freedesktop.DBus -> dest=(null destination) pat h=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=N ameOwnerChanged string ":1.239" string ":1.239" string "" The strings appear to be name, old owner, new owner: http://dbus.freedesktop.org/doc/dbus...erChanged.html Still makes no sense. I think this is just a side-effect. The real action is happening somewhere else. Maybe a strace on lipc will reveal something? Last edited by pepijndevos; 11-10-2012 at 05:33 AM. |
![]() |
![]() |
![]() |
#29 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12
Karma: 152738
Join Date: Jul 2010
Device: Kindle DXG
|
Hello,
I just e-mailed with Pepijn and he said that he would take it on from here. Just some thoughts of mine on what remains to be done, in case someone else also wants to start working on this: The major part of the work required is probably to convert the output of /dev/input/event* to ASCII, for further processing by the insertKeystroke property. I already did some searches on that, and it seems like this is not going to be an easy thing. First of all, what is read from /dev/input/event* is a "struct input_event". This struct contains various members, among them the actual keycode of the key that was pressed/released. The challenge is then to convert that keyboard-layout dependent keycode into ASCII. In order to accomplish this, you will need to construct a mapping table from keycode to ASCII. Unfortunately the layout of the mapping table depends on your keyboard layout. So, for a generic application, you will need to also implement support for the various keyboard layouts. Normally keyboard layouts are handled by your GUI frontend, e.g. by the X11-Server or an embedded toolkit, such as QT embedded. Unfortunately, on the Kindle, there is no such frontend installed. Thus, you will have to take of the keyboard support for yourself. I already did some searches and to see if there are some apps that can be used as a string point and it seems like there are several that can be used as a starting point:
Regarding the time required to code that application, I think it varies on the level of complexity of your solution. In one day, you can probably code a simple app without support for multiple keyboard layouts. In one week, one can make a full-fledged application with keyboard layout support, custom actions for the function keys(F1-F12) etc. If you are heading for a simple app, you would probably fork from evtest. If you want something more complex, you can use QT Embedded as a starting point. Hope this helps! Regards, Chris |
![]() |
![]() |
![]() |
#30 | |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12
Karma: 152738
Join Date: Jul 2010
Device: Kindle DXG
|
Quote:
I have attached acode snippet to do this. Hope this helps to get you started! EDIT: I have now tested the code snippet and found a bug. Now it should compile & work just fine. Regards, Chris Last edited by choff; 11-12-2012 at 02:24 PM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Input Plugin] DOCX Input | SauliusP. | Plugins | 42 | 06-05-2013 04:01 AM |
Touch how to enable third-party input method in rooted nook touch | tigerszheng | Barnes & Noble NOOK | 5 | 10-24-2011 08:30 PM |
Select all function | megrose0222 | Library Management | 3 | 08-31-2011 07:31 PM |
select all | alansplace | Calibre | 4 | 08-03-2011 06:46 PM |
Android Penpower Input Method on Edge? | ricco | enTourage Archive | 0 | 04-26-2010 12:11 AM |