Bill Fenner wrote:
>   I'm using xxe 2.11 on MacOS 10.4.2 with Apple's java 1.4.2_09.  I
> wanted to bind a command to meta-PLUS, so I tried
> 
> <keyPressed code="PLUS" modifiers="meta"/>
> 
>   However, this didn't work.  It turns out I have to use
> 
> <keyPressed code="EQUALS" modifiers="shift meta"/>
> 
>   Since the plus key is not shift-equals in all keyboard layouts, this
> means I am not guaranteed to get plus when I ask for shift-equals. 
> Similarly, there may be some keyboard layout where equals itself is
> shifted, so this binding may not work.
> 
>   I'm assuming this is more of a java issue than an xxe one - xxe
> looks like it's just taking the events that java is handing it - but
> is there any conventional wisdom about how to make this kind of
> binding?

With <keyPressed/>, you must use the code of keys found on *all*
keyboards. This means: limit yourself to A, B, C, ..., F1, F2, ..., Esc,
space bar, ...

The alternative is to use the following *sequence*:

[1] <keyPressed code="X" modifiers="meta" /> <-- use here any ``prefix''
you want.

[2] <keyTyped char="+" /> <-- Unlike keyPressed, keyTyped allows you to
precisely specify any character you want.

Reply via email to