From: James S. <jsi...@su...> - 2001-01-12 22:14:29
|
> I am just sitting down to write a kernel module for an Apple Newton serial > keyboard,a nd I am slightly confused by the terminology about scancodes. > > 1.7 The keycode, keycodemax, keycodesize fields > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > These two fields will be used for any inpur devices that report their data > as scancodes. If not all scancodes can be known by autodetection, they may > need to be set by userland utilities. The keycode array then is an array > used to map from scancodes to input system keycodes. The keycode max will > contain the size of the array and keycodesize the size of each entry in it > (in bytes). Scancodes are what are generated by the hardware. If you press a 7 on say a alpha you might get a code from hardware of say 34. On a PC you get a value of 117. The input system has a bunch of defined values for specific keys. So if you are reading /dev/eventX and you get KEY_7 this means you press a 7 no matter what the value was the hardware generated. Each input driver has a keycode array to perform this mapping which basically goes from hardware specific codes to universal codes. keycode_max is the size of the array which is the maximum number of keys that can generate codes times what the size of the each field (keycodesize). |