View Single Post
Old 05-23-2016, 11:28 PM   #281
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: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
I should have browsed the source code earlier, but more interesting now that I can actually compile code snippets... This will come in really handy (K1 keyboard keycodes, as used by "waitforkey"):
PHP Code:
unsigned char kbd_ioc_xlate_dvt1[FIONA_KEYMAP_SIZE] =  {
    
KEY_1KEY_7KEY_EKEY_OKEY_GKEY_XKEY_LEFTALTKEY_HENKAN,      /* 0x00 - 0x07 */
    
KEY_2KEY_8KEY_RKEY_PKEY_HKEY_CKEY_SPACEKEY_HIRAGANA,      /* 0x08 - 0x0F */
    
KEY_3KEY_9KEY_TKEY_AKEY_JKEY_VKEY_PAGEDOWNKEY_LEFTSHIFT,  /* 0X10 - 0X17 */
    
KEY_4KEY_0KEY_YKEY_SKEY_KKEY_BKEY_PAGEUPKEY_MUHENKAN,     /* 0X18 - 0X1F */
    
KEY_5KEY_QKEY_UKEY_DKEY_LKEY_NKEY_KPJPCOMMAKEY_SLASH,     /* 0x20 - 0x27 */
    
KEY_6KEY_WKEY_IKEY_FKEY_ZKEY_MKEY_COMPOSEKEY_KPSLASH,     /* 0X28 - 0X2F */
    
KEY_VOLUMEUPKEY_VOLUMEDOWNKEY_BACKSPACEKEY_ENTER,                 /* 0X30 - 0X33 */
    
KEY_DOTKEY_KATAKANAKEY_YEN,                                         /* 0X34 - 0X36 */

    
KEY_NONEKEY_NONEKEY_NONEKEY_NONEKEY_NONE,                       /* 0x37 - 0x3F */
    
KEY_NONEKEY_NONEKEY_NONEKEY_NONE,                                 /* Not defined */
    
    
KEY_HANJAKEY_HANGUEL,                                                 /* 0X40 - 0X41 */
}; 
And perhaps we can setup a keymap for the "myts" terminal. Well, except for that little "no input event devices" problem... I will need to borrow code from the GPL source for reading keys, no simple (obvious) device access (yet)...

Interesting that the key labels are rotated 90-degrees from their sequential keycode mapping on the keyboard layout. And those Japanese keycodes are interesting, considering that the K1 was only released in the USA, with EVDO (not 3G) whispernet.

EDIT: Umm... Except that a firmware install script defined the "R" keycode as decimal 19, and I successfully used that in my scripts, but how does that fit they keycode table above? More research needed... I need to find the VALUES of those key names in that table. But I did find this:
PHP Code:
// Some handy key defs for identifying ALT+FONT key events
#define ALT_KEY_PRESSED     KEY_LEFTALT
#define ALT_KEY_RELEASED    (ALT_KEY_PRESSED | 0x80)
#define FONT_KEY_PRESSED    KEY_KATAKANA
#define FONT_KEY_RELEASED   (KEY_KATAKANA | 0x80) 
Okay, I found where 'R' is keycode 19 -- in kernel source that lab126 did not change, with way more keycodes than any kindle supports. I think they are raw codes for a typical IBM keyboard, and that translation table above is so a ton of existing keyboard support can stay unchanged. Here is an "standard IBM keyboard" keycode table: http://www.penticoff.com/nb/kbds/ibm104kb.htm


EDIT2: FYI, it looks like the "standard" keycodes in the linux headers mostly ascend in column-major QWERTY layout, while the K1 uses row-major QWERTY layout -- just a matter of swapping the row and column lines on the connector cabling (fixed in that software lookup table).

Last edited by geekmaster; 07-24-2016 at 02:31 PM.
geekmaster is offline   Reply With Quote