Re: Accelerators - odd behavior

2014-09-27 Thread Tomas Mikula
On Sat, Sep 27, 2014 at 12:02 AM, Kevin Rushforth kevin.rushfo...@oracle.com wrote: Can you add this information to the JIRA? https://javafx-jira.kenai.com/browse/RT-38830 I added it to https://javafx-jira.kenai.com/browse/RT-27602. Tomas Thanks. -- Kevin Tomas Mikula wrote: Anyway,

Accelerators - odd behavior

2014-09-26 Thread Scott Palmer
KeyCombination cmdMinus = new Key*Code*Combination(KeyCode.MINUS, KeyCombination.CONTROL_DOWN); KeyCombination cmdMinusFromCharacter = new Key*Character*Combination(-, KeyCombination.CONTROL_DOWN); Using the above like this: scene.getAccelerators().put(cmdMinus, runnable);

Re: Accelerators - odd behavior

2014-09-26 Thread Kevin Rushforth
It seems to me that this is working as designed. You have created two different KeyCombinations and asked that both fire your runnable. Further, both of the KeyCombinations match your key input since both a KeyPressed and a KeyTyped event are sent when pressing a key that has an associated

Re: Accelerators - odd behavior

2014-09-26 Thread Scott Palmer
What is very interesting about this is that I can't duplicate it with the + character. 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.CONTROL_DOWN);

Re: Accelerators - odd behavior

2014-09-26 Thread Kevin Rushforth
This does seem somewhat strange. Do you get multiple calls to your runnable if you use a KeyCharacter combination and KeyCode combination for CTRL-a or other key that generates a key char without needing a shift? -- Kevin Scott Palmer wrote: What is very interesting about this is that I

Re: Accelerators - odd behavior

2014-09-26 Thread Tomas Mikula
Hi Scott, On Fri, Sep 26, 2014 at 7:01 PM, Scott Palmer swpal...@gmail.com wrote: 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

Re: Accelerators - odd behavior

2014-09-26 Thread Stephen F Northover
I am only seeing the runnable fired once in FX 8u40. Steve Steps: 1) Run TestKeyCombination 2) Press Control+- Here is the test code: import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import

Re: Accelerators - odd behavior

2014-09-26 Thread Kevin Rushforth
Is this on a Mac or on Windows? I just ran your test case and I get two runnables, which is what I would expect. -- Kevin Stephen F Northover wrote: I am only seeing the runnable fired once in FX 8u40. Steve Steps: 1) Run TestKeyCombination 2) Press Control+- Here is the test code:

Re: Accelerators - odd behavior

2014-09-26 Thread Tomas Mikula
Hi Kevin, On Fri, Sep 26, 2014 at 7:16 PM, Kevin Rushforth kevin.rushfo...@oracle.com wrote: It seems to me that this is working as designed. You have created two different KeyCombinations and asked that both fire your runnable. Further, both of the KeyCombinations match your key input since

Re: Accelerators - odd behavior

2014-09-26 Thread Stephen F Northover
This is on Mac. Will try Windows. Steve On 2014-09-26, 1:24 PM, Kevin Rushforth wrote: Is this on a Mac or on Windows? I just ran your test case and I get two runnables, which is what I would expect. -- Kevin Stephen F Northover wrote: I am only seeing the runnable fired once in FX

Re: Accelerators - odd behavior

2014-09-26 Thread Scott Palmer
I'm on Windows 7. On Fri, Sep 26, 2014 at 1:25 PM, Stephen F Northover steve.x.northo...@oracle.com wrote: This is on Mac. Will try Windows. Steve On 2014-09-26, 1:24 PM, Kevin Rushforth wrote: Is this on a Mac or on Windows? I just ran your test case and I get two runnables, which

Fwd: Accelerators - odd behavior

2014-09-26 Thread Scott Palmer
Forgot to include the list. (I'm testing with 8u20 btw) -- Forwarded message -- From: Scott Palmer swpal...@gmail.com Date: Fri, Sep 26, 2014 at 1:25 PM Subject: Re: Accelerators - odd behavior To: Kevin Rushforth kevin.rushfo...@oracle.com Yes, for CTRL+a I do see it fire

Re: Accelerators - odd behavior

2014-09-26 Thread Tomas Mikula
The explanation could be that on some systems the KeyCharacterCombination(-).match picks the same key code as the one produced by key press (e.g. MINUS), while on other systems it picks the other one (SUBTRACT). On Fri, Sep 26, 2014 at 7:24 PM, Kevin Rushforth kevin.rushfo...@oracle.com wrote:

Re: Accelerators - odd behavior

2014-09-26 Thread Scott Palmer
: Scott Palmer swpal...@gmail.com Date: Fri, Sep 26, 2014 at 1:25 PM Subject: Re: Accelerators - odd behavior To: Kevin Rushforth kevin.rushfo...@oracle.com Yes, for CTRL+a I do see it fire twice. On Fri, Sep 26, 2014 at 1:21 PM, Kevin Rushforth kevin.rushfo...@oracle.com wrote: This does

Re: Accelerators - odd behavior

2014-09-26 Thread Kevin Rushforth
This means that the method can return true only for KEY_PRESSED andKEY_RELEASED events, but not for KEY_TYPED events, which don't have valid key codes. Ah, I missed that. I would expect such a disclaimer for KeyCodeCombination but not for KeyTypedCombination. In any case, it still seems

Re: Accelerators - odd behavior

2014-09-26 Thread Scott Palmer
That would imply that 8u40 is broken (where '-' only fired once for Stephen), or it's broken for the + key. Scott On Fri, Sep 26, 2014 at 1:29 PM, Kevin Rushforth kevin.rushfo...@oracle.com wrote: This means that the method can return true only for KEY_PRESSED andKEY_RELEASED events, but

Re: Accelerators - odd behavior

2014-09-26 Thread Scott Palmer
Attached my test case... On Fri, Sep 26, 2014 at 1:31 PM, Scott Palmer swpal...@gmail.com wrote: That would imply that 8u40 is broken (where '-' only fired once for Stephen), or it's broken for the + key. Scott On Fri, Sep 26, 2014 at 1:29 PM, Kevin Rushforth kevin.rushfo...@oracle.com

Re: Accelerators - odd behavior

2014-09-26 Thread Stephen F Northover
Two on Windows, one on Mac. See https://javafx-jira.kenai.com/browse/RT-38830 Steve On 2014-09-26, 1:25 PM, Stephen F Northover wrote: This is on Mac. Will try Windows. Steve On 2014-09-26, 1:24 PM, Kevin Rushforth wrote: Is this on a Mac or on Windows? I just ran your test case and I

Re: Accelerators - odd behavior

2014-09-26 Thread Scott Palmer
Okay.. so what is going on with Windows and CTRL+PLUS ? Scott On Fri, Sep 26, 2014 at 1:35 PM, Stephen F Northover steve.x.northo...@oracle.com wrote: Two on Windows, one on Mac. See https://javafx-jira.kenai.com/ browse/RT-38830 Steve On 2014-09-26, 1:25 PM, Stephen F Northover wrote:

Re: Accelerators - odd behavior

2014-09-26 Thread Kevin Rushforth
It may or may not be a bug, but it will be good to investigate. -- Kevin Stephen F Northover wrote: Two on Windows, one on Mac. See https://javafx-jira.kenai.com/browse/RT-38830 Steve On 2014-09-26, 1:25 PM, Stephen F Northover wrote: This is on Mac. Will try Windows. Steve On

Re: Accelerators - odd behavior

2014-09-26 Thread Kevin Rushforth
: Fri, Sep 26, 2014 at 1:25 PM Subject: Re: Accelerators - odd behavior To: Kevin Rushforth kevin.rushfo...@oracle.com Yes, for CTRL+a I do see it fire twice. On Fri, Sep 26, 2014 at 1:21 PM, Kevin Rushforth kevin.rushfo...@oracle.com wrote: This does seem somewhat strange. Do you get

Re: Accelerators - odd behavior

2014-09-26 Thread Stephen F Northover
Agree. Suggest that we move the discussion to the JIRA to capture the background information for whoever will address the bug. Steve On 2014-09-26, 1:41 PM, Kevin Rushforth wrote: It may or may not be a bug, but it will be good to investigate. -- Kevin Stephen F Northover wrote: Two on

Re: Accelerators - odd behavior

2014-09-26 Thread Scott Palmer
What started all this was that I sued CTRL +/- to zoom in and out in my app. People found that one press to zoom out needed two presses to zoom back in. If the behavior is platform-specific it will be awkward to deal with. Specially since I want it to work with the numeric keypad as well.. so I

Re: Accelerators - odd behavior

2014-09-26 Thread Scott Palmer
Please attach the test case I mailed earlier to the JIRA issue. On Fri, Sep 26, 2014 at 1:42 PM, Stephen F Northover steve.x.northo...@oracle.com wrote: Agree. Suggest that we move the discussion to the JIRA to capture the background information for whoever will address the bug. Steve

Re: Accelerators - odd behavior

2014-09-26 Thread Tomas Mikula
The cause of the problem seems clear to me. This is what I observe on my (Linux) system. Pressing '-' on the main part of the keyboard produces MINUS key code pressed. Pressing '-' on the numeric keypad produces SUBTRACT key code pressed. KeyCharacterCombination(-) matches MINUS pressed, but

Re: Accelerators - odd behavior

2014-09-26 Thread Tomas Mikula
Here is a possible solution to Scott's original problem: KeyCombination CtrlMinus = new KeyCombination(CONTROL_DOWN) { @Override public boolean match(KeyEvent event) { return super.match(event) event.getEventType() == KEY_PRESSED

Re: Accelerators - odd behavior

2014-09-26 Thread Scott Palmer
I should note that KeyCodeCombintation(KeyCode.EQUALS, KeyCombination.CONTROL_DOWN, KeyCombination.SHIFT_DOWN) is undesirable as it requires knowledge of the keyboard layout that shouldn't be required. On Fri, Sep 26, 2014 at 6:58 PM, Scott Palmer swpal...@gmail.com wrote: While looking into