Accelerators - odd behavior

Tomas Mikula tomas.mikula at gmail.com
Fri Sep 26 19:22:11 UTC 2014


Anyway, the algorithm used in KeyCharacterCombination looks odd to me.

What it does is it tries to find a key code capable of producing the
character and then compares it to the event's key code.

It would make more sense to me if it took the event, converted it to a
character it produced and then compare the characters.

This way your first attempt to capture both MINUS and SUBTRACT with a
single KeyCharacterCombination("-") would work, as well as capturing
all of Shift-EQUALS, PLUS, ADD with a single
KeyCharacterCombination("+").

Tomas

On Fri, Sep 26, 2014 at 9:11 PM, Tomas Mikula <tomas.mikula at gmail.com> wrote:
>> That doesn't explain why this isn't happening for PLUS.
>
> KeyCodeCombination(KeyCode.PLUS, KeyCombination.CONTROL_DOWN)
>
> is never matched. It might even be impossible to get a KEY_PRESSED
> event with key code PLUS with English keyboard layout. When I switch
> keyboard layout to Slovak, which has the '+' sign accessible without
> Shift, I do get the runnable fired twice.
>
> Best,
> Tomas


More information about the openjfx-dev mailing list