Re: [gtk-vnc-devel] [PATCH][RFC] Support for ExtendedKeyEvent client message



Markus Armbruster wrote:
Anthony Liguori <anthony codemonkey ws> writes:

Not really.  PC key codes are well defined for one type of keyboard,
but are used by every keyboard.  I guess there's a 1-1 mapping of
Linux keycodes to PC keycodes.  I don't believe Linux keycodes are
richer than PC key codes though because PC key codes are what are
being generated from the actual keyboard.  By definition, there has to
be a PC key code for any given key while this isn't necessarily true
for Linux keycodes.

There has to be a PC key code for every physical key on a PC keyboard.

However, not every keyboard is a PC keyboard, and some of them have
keys that that don't exist on PC keyboards.

Well, I think this is our problem. When I say, PC key code, I don't mean the codes assigned to keys on a PC101 keycode. I mean any hardware keycode that is delivered through a PS/2 port.

GDK calls this a "hardware keycode" which is perhaps a better nomenclature.

Regards,

Anthony Liguori

What's PC key code the code for a power key?  The Linux key code is
KEY_POWER, easily looked up in linux/input.h.  If I read
atkbd2_set2_keycode[] correctly, the PC key code is 0xB7, but I'm not
sure.  I can't see KEY_LINEFEED, KEY_AGAIN, KEY_PROPS, KEY_UNDO,
KEY_FRONT and many more in that table.  If there are PC key codes for
these keys, I don't know how to find them.

So I guess it really comes down to, what benefit would we get by using
Linux key codes?

None, if PC key codes are at least as rich (which I doubt) and at
least as well-defined (which I doubt too).

Regards,

Anthony Liguori

Linux input layer key codes are an encoding for the physical keys of
any keyboard supported by Linux.

It's easy to map from PC key codes to Linux input layer key codes and
back.  The map doesn't depend on what keymap the user configured,
because both encodings identify physical keys.  But Linux input layer
key codes are a richer encoding.  What's the PC key code for
KEY_POWER?

Again, please excuse me if I talk nonsense, and try to use simple,
short sentences in your reply %-}





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]