in reply to Keys beside keys on keyboards

Ok, going on 1 hour sleep in the last 36, so maybe I am to lagged to think, but my foggy mind wonders if one could write a java script(or similar) that captures the actual hex input from the keyboard port before it gets through the keyboard map. I would guess that if one could do that, then the the problem would be reduced to one 101 key grid in the program. Just a thought... Yes, those diagonal keys... and then the old sun/sparc keyboards.. Well anyway, for the diagonal keys maybe one could make an array for each row of keys. the diagonal keys would always be one row up/down and one index +/-. Your right, this is one of those little ideas that just kind of grabs you! I better get back to work... :-)

...the majority is always wrong, and always the last to know about it...

Replies are listed 'Best First'.
Re^2: Keys beside keys on keyboards
by Smaug (Pilgrim) on Nov 06, 2006 at 14:25 UTC
    Hi wjw,

    I had thought of that, and also wondered if perhaps the hex was sequential in which case it would be as easy as adding 1 or subtracting 1 to get the keys on either side. Granted the diagonal keys are still a problem.....

    Update:
    I went on to check my xmodmap file and found the following:

    keycode 54 = c C 0xbd 0xbc keycode 55 = v V 0xc9 0xc8 keycode 56 = b B 0xf9 0xf8 keycode 57 = n N 0xcb 0xca keycode 58 = m M 0xdf 0xde keycode 59 = comma less 0xab 0xa7 keycode 60 = period greater 0xa9 0xa6 keycode 61 = slash question 0xb1 0xa1
    The "keycode" is in the exact order of the keys on my keyboard and but the only other ordering I can see is the upper and lower cases being offset by 1.
      On my keyboard, the backquote/tilde key is next to the one/exclaimation mark key. The former has keycode 49, the latter keycode 10. On the other hand, keycode 51 is the backslash/pipe key, the key on the right end of the second row. Keycode 52 is the z key, which is the second key from the left on the fourth row.