[vox-tech] convert keycodes to characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vox-tech] convert keycodes to characters
Hi,
As an academic endeavour, I am writing a program that will make data regarding
keyboard usage (key frequency, etc). So far I've got a program that can read
keyboard events via /dev/input/event0, but that gets me as far as keycodes and
event types such as 'key release' or 'key press'. What I would like next is to
convert the codes into characters, so different keymaps don't create spurious
data. That is, if I press the key labeled 'd', I want the code 32 to be
converted to a 'd' if using qwerty, xor to a 'e' if using Dvorak (32 is the code
generated by the key labeled 'd', regardless if typing on the console or in X
and regardless of console keymap and X keymap).
Ideally I could handle both console and X, but as I'm mainly in X the following
questions will suffice:
1. Can I programmatically figure out what the X keymap is?
2. Can I programmatically use the X keymap to convert keycodes to characters?
The corresponding questions re: the console would also be nifty. :)
-Bryan
p.s. I keep thinking it myself, so I assume some of you will think it: Yes, this
sounds like a keylogger. I promise, I'm not evil. 0:)
--
Bryan Richter
UCDTT President
UC Davis Undergrad, Physics Dept.
-
A PGP signature is (probably) attached to this email.
Attachment:
signature.asc
Description: Digital signature
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech
|