[Review request] Handling Enter key presses on Buttons in JavaFX

2016-06-16 Thread Jonathan Giles
Hi all, Thanks for all your feedback. I think we have mostly coalesced around doing the right thing per platform. I have therefore gone ahead and posted a webrev for review as part of the following Jira issue: Jira: https://bugs.openjdk.java.net/browse/JDK-8139509 Webrev: http://cr.openjdk.ja

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-08 Thread Pete Brunet
On 6/8/16 11:27 AM, Paul Furbacher wrote: > On June 7, 2016 at 6:41:37 PM EDT, Tomas Mikula > wrote: > >> This would be very confusing if you had two TextFields and after entering >> text into the first one the user hits Enter and the form gets submitted >> with empty second field. > Apple’s H

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-08 Thread Paul Furbacher
On June 7, 2016 at 6:41:37 PM EDT, Tomas Mikula wrote: > This would be very confusing if you had two TextFields and after entering > text into the first one the user hits Enter and the form gets submitted > with empty second field. Apple’s HIG documentation clarifies how such a situation should

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-08 Thread Richard Bair
>>> 2) Do we want to have different behaviors for OS X and non-OS X? I'm a >>> newly inducted member into the cult of Mac, and I don't yet have all >>> my bearings sorted out, so I don't have a strong opinion here. >> Please don't make different OSes behave differently as this is a real pain. >> I

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-08 Thread Scott Palmer
> On Jun 8, 2016, at 3:29 AM, Robert Lichtenberger > wrote: > > >> 2) Do we want to have different behaviors for OS X and non-OS X? I'm a >> newly inducted member into the cult of Mac, and I don't yet have all >> my bearings sorted out, so I don't have a strong opinion here. > Please don't ma

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-08 Thread Robert Lichtenberger
2) Do we want to have different behaviors for OS X and non-OS X? I'm a newly inducted member into the cult of Mac, and I don't yet have all my bearings sorted out, so I don't have a strong opinion here. Please don't make different OSes behave differently as this is a real pain. I would much pre

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-07 Thread Pete Brunet
I had a conversation about this earlier in the year and will post it here in case it's helpful: > 1. If a button has focus, Enter key should click the button (like it does on Windows). Currently Enter key always actions the default button on a dialog, even if another button has focus. Most people

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-07 Thread Tomas Mikula
On Tue, Jun 7, 2016 at 7:08 PM, Michael Berry wrote: > On 7 June 2016 at 23:57, Tomas Mikula wrote: > >> >> >> On Tue, Jun 7, 2016 at 6:48 PM, Michael Berry wrote: >> >>> On 7 June 2016 at 23:30, Tomas Mikula wrote: >>> On Tue, Jun 7, 2016 at 6:10 PM, Michael Berry wrote:

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-07 Thread Stefan Fuchs
Tomas Mikula wrote: On Tue, Jun 7, 2016 at 6:33 PM, Stefan Fuchs > wrote: Hi, well, if my dialog would include a TextField, an cancel- and an ok-button, I would obviously want to have the TextField the initial focus. Once the dialog opens I can im

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-07 Thread Tomas Mikula
On Tue, Jun 7, 2016 at 6:48 PM, Michael Berry wrote: > On 7 June 2016 at 23:30, Tomas Mikula wrote: > >> >> >> On Tue, Jun 7, 2016 at 6:10 PM, Michael Berry wrote: >> >>> On 7 June 2016 at 23:04, Tomas Mikula wrote: >>> What about forgetting the whole notion of a "default button" and the

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-07 Thread Tomas Mikula
On Tue, Jun 7, 2016 at 6:33 PM, Stefan Fuchs wrote: > Hi, > > well, if my dialog would include a TextField, an cancel- and an > ok-button, I would obviously want to have the TextField the initial focus. > > Once the dialog opens I can immediately type some text. > When I'm done, I hit enter to c

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-07 Thread Tomas Mikula
On Tue, Jun 7, 2016 at 6:10 PM, Michael Berry wrote: > On 7 June 2016 at 23:04, Tomas Mikula wrote: > >> What about forgetting the whole notion of a "default button" and the only >> effect of setting the default property to true being that the button will >> start as focused? >> >> So I add a qu

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-07 Thread Michael Berry
On 7 June 2016 at 23:04, Tomas Mikula wrote: > What about forgetting the whole notion of a "default button" and the only > effect of setting the default property to true being that the button will > start as focused? > > So I add a question: > > 3) Would anyone miss the "default button"? > Afrai

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-07 Thread Jonathan Giles
It's worth me quickly interjecting here to say that a button being default does not automatically imply that the button has the focus by default. Therefore, this suggestion is another behavioral change that needs to be carefully understood. -- Jonathan On 8/06/16 10:04 AM, Tomas Mikula wrote:

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-07 Thread Tomas Mikula
What about forgetting the whole notion of a "default button" and the only effect of setting the default property to true being that the button will start as focused? So I add a question: 3) Would anyone miss the "default button"? Tomas On Tue, Jun 7, 2016 at 5:47 PM, Jonathan Giles wrote: > H

Re: Handling Enter key presses on Buttons in JavaFX

2016-06-07 Thread Michael Berry
I can't comment on behalf of the Mac guys, but certainly from a Windows perspective I find the current behaviour confusing - I would ideally expect the enter key to fire the focused button, and the "default" button would get fired by default purely because it is the one first selected (as oppose to

Handling Enter key presses on Buttons in JavaFX

2016-06-07 Thread Jonathan Giles
Hi all, One thing I've been looking into recently is the issue of what the Enter key should do when it is pushed with regards to buttons in a UI where one of those buttons is a 'default' button. There are number of Jira issues on this topic, and I wanted to poll the community to understand it