Hi,

r10422 contains improvements (I hope) in keyboard handling.

In the past, when a key was pressed/released the generated virtual
keycode was lookued up based on the character gtk reported for the
keypress. A major problem were keyboards where the same character could
be constructed by different keys and where utf8 chars were generated.

On a keypress/release gtk2 also reports an unique keycode of the key
pressed. This keycode can be more reliable and easier mapped to a
virtual keycode. So the new code is based on this and should always
report the correct key.
For gtk1 I added some extra X dependent code to retrieve the same
keycode. This way both gtk1 and gtk2 work the same way. Since we support
gtk1 unix/x only, I don't see that as a problem.

Side effect of these changes was that I discovered a possible flaw in
the use of modifier keys. (AltGr key pressed or not). On one system
numlock was mapped to mod4 and altgr to mod5, on another numlock was
only mapped to mod5. In code we used hardcoded values for those
modifiers. I've added code maye this based on the actual values.

As a result of this it is in theory possible to add extra values for the
Shift value in the keyUp/Down events. Currently only [ssShift, ssCtrl,
ssAlt} are reported there, but IMO [ssSuper, ssHyper, ssMeta, ssAltGr]
can be possible. I'll look what changes are needed.

Marc

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to