After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 309287 - Remove the key binding that uses Enter for a select action in a combo box
Remove the key binding that uses Enter for a select action in a combo box
Status: RESOLVED DUPLICATE of bug 381254
Product: gtk+
Classification: Platform
Component: Widget: GtkComboBox
2.6.x
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 656816
 
 
Reported: 2005-07-01 15:53 UTC by Kathy Fernandes
Modified: 2017-08-25 01:03 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8



Description Kathy Fernandes 2005-07-01 15:53:34 UTC
The Enter key currently opens the list in a combo box. Support for Enter should
be removed because this key binding conflicts with the Windows model. The Enter
key should be used only to activate a default push button. 

Other information:
Comment 1 Daniel Boles 2017-03-03 15:07:19 UTC
I don't think this will be fixed. Enter is the general shortcut for activating a widget, ComboBox or otherwise. GTK+ follows its own model, not "the Windows model", when making design decisions.
Comment 2 Michal 'hramrach' Suchanek 2017-03-03 17:34:55 UTC
No, Space is the general shortcut for activating a widget.

Some widgets may use Enter for additional action but on combobox this is redundant and breaks dialog keyboard usability.
Comment 3 Daniel Boles 2017-03-03 17:45:23 UTC
(In reply to Michal 'hramrach' Suchanek from comment #2)
> Some widgets may use Enter for additional action but on combobox this is
> redundant and breaks dialog keyboard usability.

right - I kind of missed that detail by focussing on the 'because Windows' aspect

so reopening to see what maintainers think; this should be a simple fix if they agree
Comment 4 Daniel Boles 2017-03-03 19:26:13 UTC
...but this isn't an issue of GtkComboBox specifically, rather of all GtkButtons. So I think we're back to what I was trying to say initially: (afaict) default activation is only applied if
 * there is no keyboard focus yet
 * or the focus is on some other widget, which takes focus but does not consume Enter keypresses - and it is hard to think of many of those, with the exception of a GtkEntry with activates-default = TRUE.

It sounds like what you want, in contrast, is for Enter never to activate the focused Button (unless it is also to be the default). Is that right? If so, I think it's unlikely to be changed, but we'll see.
Comment 5 Michal 'hramrach' Suchanek 2017-03-04 11:48:58 UTC
do radio buttons, checkboxes, and sliders consume Enter?

I think not.

Also I am not against an activates-default on ComboBox that makes it not hijack the Enter key. It's after all similar to entry box so should behave like one. That it internally uses a button is totally irrelevant.

I also use Enter with list view to activate the default button but like Entry it probably does not work out of the box.

The situation with ComboBox is difficult in that 
 - it handles the Enter key internally without any option to forward it so you probably have to install keypress handler and just override Enter processing entirely to make it work
 - it makes sense for Enter to close the combobox when it is open and only when closed forward the key which is not something you can reasonably expect from external bolt-on handler
Comment 6 Daniel Boles 2017-03-04 13:50:16 UTC
of course, I meant 'the kind of Button that is in ComboBox', i.e. a base ToggleButton (and its base Button)

ComboBox itself does not specifically hijack Enter; the fact that it is activated by Enter is a property of the internal ToggleButton, whose button-toggled signal opens the menu in this case
Comment 7 Daniel Boles 2017-08-25 01:03:41 UTC
(In reply to Michal 'hramrach' Suchanek from comment #5)
> Also I am not against an activates-default on ComboBox that makes it not
> hijack the Enter key.

That seems like a better direction to me, and this bug for that request has a patch to build off:

*** This bug has been marked as a duplicate of bug 381254 ***