Accelerators - odd behavior
swpalmer at gmail.com
Fri Sep 26 17:16:56 UTC 2014
What is very interesting about this is that I can't duplicate it with the
I've added all of the following to the scene accelerators and it still only
fires my "plus" action once for each press.
KeyCombination cmdPlus = new KeyCodeCombination(KeyCode.PLUS,
KeyCombination cmdAdd = new KeyCodeCombination(KeyCode.ADD,
KeyCombination cmdPlusAsShiftEquals = new
KeyCombination cmdPlusFromCharacter = new KeyCharacterCombination("+",
This is weird.
On Fri, Sep 26, 2014 at 1:01 PM, Scott Palmer <swpalmer at gmail.com> wrote:
> KeyCombination cmdMinus = new Key*Code*Combination(KeyCode.MINUS,
> KeyCombination cmdMinusFromCharacter = new Key*Character*Combination("-",
> Using the above like this:
> scene.getAccelerators().put(cmdMinus, runnable);
> scene.getAccelerators().put(cmdMinusFromCharacter, runnable);
> Will result in the runnable being fired twice from the same keypress.
> I propose changing the accelerator processing logic so that only one
> runnable gets called as the intention appears to be that a KeyCombination
> can only have one runnable associated with it, but the logic in Map doesn't
> see the above two KeyCombinations as the same key in the Map.
> Note: With the second combination above I really wanted something that
> worked for both MINUS and SUBTRACT simultaneously - since they both type
> the same Character and only one accelerator can be set on a MenuItem.
More information about the openjfx-dev