Dynamic binding of keyname/keysym. [oops, sent the previous one too fast]
Erik Enge
erik at nittin.net
Sun Mar 2 18:16:01 UTC 2003
hatchond at labri.fr writes:
> Should be normal. Because we don't handle the :mapping-notify event (clx
> 12.12.3), but we should handle it. If you look at the definition of this event,
> you'll see that we have a chance to handle this correctly.
> But first, I would like to know what happens if you change the keyboard map
> before lunching eclipse ? I don't figure how to handle a :mapping-notify with
> request :keyboard correctly for the moment, maybe you do.
> I was waiting for somebody like you (with strange keyboard mapping) to point
> this out. (I wasn't sure of the necessity of handling this event before :o( )
[snip]
> The trouble is: I don't have the (even the begining of) solution in my
> mind for the moment
According to the CLX (12.12.3), if REQUEST is :KEYBOARD then START and
COUNT indicate the range of the altered keycodes.
A snip from my ~/.Xmodmap file:
keycode 100 = Left
keycode 101 =
keycode 102 = Right
keycode 103 = End
keycode 104 = Down
keycode 105 = Next
keycode 106 = Insert
keycode 107 = Delete
keycode 108 = KP_Enter
keycode 109 = Control_R
keycode 110 = Pause Break
keycode 111 = Print Execute
When I run `xmodmap ~/.Xmodmap` Eclipse receives one MAPPING-NOTIFY
event for each line in the .Xmodmap file. The 'keycode' in the .Xmodmap
file ends up in the START slot of the MAPPING-NOTIFY event.
Now, seeing as the DEFINE-KEYSYM function takes `name` and `value`, I
assume I should be able to do something like this:
(define-keysym (keycode->keyname *display* (event-start event))
[assuming 'event' is a MAPPING-NOTIFY event object]
But that doesn't seem to make any sense as KEYCODE->KEYNAME seems to
want hexadecimal values for the keycodes.
Am I on the right track here? Should I just convert the 'keycode' to
hexadecimal and that's it? If so, we should perhaps have a function
that's called UPDATE-KEYSYM (or somesuch) as that would give more
meaning (at least to me).
Erik.
More information about the eclipse-devel
mailing list