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 53579 - KEYNAV: GtkCombo
KEYNAV: GtkCombo
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
1.3.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 70202 90109 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2001-04-25 10:48 UTC by Calum Benson
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch provides fixes for some keynav problems in gtkcombo. (2.19 KB, patch)
2002-04-01 14:49 UTC, Narayana Pattipati
none Details | Review

Description Calum Benson 2001-04-25 10:48:36 UTC
When the input field of a dropdown combo box has focus and the list is not
currently displayed, pressing Alt+down arrow should drop down the list. 
(Currently this is done by pressing Enter).  

If the current contents of the entry field match an entry in the list, that
list entry should be given focus.  Otherwise no entry in the list should be
given focus until you press the down arrow a second time.

The keyboard focus within the list should be changeable by using:

- up and down arrow keys to select previous and next entry respectively

- PageUp to select the top item currently visible, then the top item on the
previous "page" if pressed again

- PageDn to select the bottom item currently visible, then the bottom item
on the next "page" if pressed again

- Home and End to select the first and last item in list respectively

- Typing any printable character to select the next item in the list
starting with that character.  (Should ideally work with "select the next
item in the list starting with the 'n' characters I just typed", too, as MS
Windows does.  But that's more work as it would require a global timeout
setting which would have to be adjustable somewhere to cope with people who
can only type slowly-- which is something Windows doesn't provide, I don't
think).

While the list is being displayed, pressing Enter should select the
currently-focused item and hide the list, leaving keyboard focus on the
combo box's entry field.  (If the list is rolled up, pressing Enter should
activate the default button in the window, if there is one, otherwise do
nothing.)

The user's currently-enforced cut, copy and paste keyboard accelerators
should be supported in the input field.

[Check http://developer.gnome.org/projects/gap/keyboardnav.html for any
later proposals that may not have filtered through to this bug report yet]
Comment 1 padraig.obriain 2001-10-03 14:30:06 UTC
GtkCombo, which uses GtkList, a deprecated widget, for the list, will
be replaced in GTK+-2.2.

The only thing which could be addressed at this point is implementing
Alt+down arrow to drop down the list.

The focus changing works as requested  except that Home and End keys
are defined as keybindings on the list item and do horizontal
scrolling.
Comment 2 padraig.obriain 2001-10-03 15:13:05 UTC
Dropping down the list of a combo when the entry field has focus is
implemented by a signal handler on the "activate" signal on the entry
field; the entry field has "activates-default" set to FALSE.

Reimplementing dropping down the list on Alt+down arrow is best left
to the replacement for GtkCombo.
Comment 3 Luis Villa 2002-01-22 21:30:07 UTC
Adding GNOME2 keyword to all keynav bugs per sander's request. You can filter on
the phrase 'luis doing GNOME2 work' to catch all instances of this so that you
can ignore them.
Comment 4 Anders Carlsson 2002-02-10 14:22:05 UTC
*** Bug 70202 has been marked as a duplicate of this bug. ***
Comment 5 Narayana Pattipati 2002-04-01 14:46:18 UTC
I have fixed some of the keynav problems existing with Gtkcombo.

I will attach a patch which has the following implemented for
gtkcombo:

a) Implemented Ctrl+Down for dropping down the list.
b) Implement Ctrl+Up for rolling up the list.
c) Sound a system beep when the user tries to navigate past
   the first/last entries in the list with Up/Down arrow keys
   without dropping down the list.
Comment 6 Narayana Pattipati 2002-04-01 14:49:12 UTC
Created attachment 7497 [details] [review]
Patch provides fixes for some keynav problems in gtkcombo.
Comment 7 Narayana Pattipati 2002-04-01 14:52:27 UTC
Please apply the patch(id=7497) with the following version of file(s):

gtkcombo.c    - 1.64
Comment 8 Calum Benson 2002-07-12 13:30:32 UTC
For future reference when the rewrite happens, you probably also ought
to be able to select an item in the dropdown list by pressing Spacebar
in addition to Return.
Comment 9 Calum Benson 2002-07-24 17:08:56 UTC
Bill has just indicated his concerne to me that we're not making at
least the latter change now (Spacebar to select an item from the
list), even though the widget is due to be deprecated soon... he feels
the behaviour is sufficiently inconsistent with the other widgets to
be a potential problem, and that we should be starting to address
these sorts of issues now that we're post-2.0 rather than having to
wait for the new widget to come along.

Is there any chance this could be addressed sometime soon? 
Comment 10 Calum Benson 2002-08-13 11:45:51 UTC
See also bug #90109
Comment 11 Owen Taylor 2002-11-14 04:17:16 UTC
*** Bug 90109 has been marked as a duplicate of this bug. ***
Comment 12 Owen Taylor 2002-11-14 04:18:27 UTC
Moving back to the 2.2 milestone since I was doing some bug
fixage on GtkCombo anyways.
Comment 13 Owen Taylor 2002-11-14 05:05:07 UTC
Keynav behavior now:

 * When focus is on entry, Alt-Down or (when not disabled via
   the API) Return/Enter pop down the list.

 * When focus is on entry, arrow keys move always move selection
   subject to to gtk_combo_set_use_arrows(). [Defaults to TRUE]

 * When list is popped down, arrow keys move selection, but do
   *not* change contents of the entry. 

 * Return updates the contents of the entry and closes the
   dropdown.

 * Space updates the contents of the entry but does not close
   the dropdown.

 * Escape/Alt-Up close the drop down without updating the
   entry.

This is reasonably close to what Windows/Qt/Mozilla do though
it doesn't correspond exactly to any of them. (And Mozilla
and probably windows are internally inconsistent)

Differences from the keynav spec:

 * I went with the standard Alt-Down/Alt-Up instead of Control,
   since it doesn't seem parallel to the notebook case to me,
   so I figured being consistent with other platforms was better.
 
 * Space doesn't close the dropdown (behavior is like GtkMenu,
   in drop down combos on other platforms, space does nothing,
   but I think an immediate update of the control is useful)

 * No beep. (We don't beep elsewhere, so adding it here seemed
   pointless)

The keynav is still do ad-hoc rather than GtkBindingSet, fixing
that would be really hard and GtkCombo will be replaced a
anyways.


Wed Nov 13 17:03:19 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkcombo.c: Change so that updates of selection
        don't take effect immediately, but only when popdown
        is closed with a button release within the combo
        or Return/Enter.

        * gtk/gtkcombo.c: Support Alt-Down to pop down the
        combo, Alt-Up to pop it back up, Space to immediately
        select current item.

        * gtk/gtkcombo.c (gtk_combo_entry_key_press): Don't
        move the focus when we get to the ends of the list
        entries.

        * gtk/gtkcombo.c: Fix handling of state in ad-hoc
        keybinding handling to be a bit more reasonable.

        * gtk/gtkcombo.c (gtk_combo_init): Make
        gtk_combo_set_use_arrows_always, enable_arrows_always
        properties do nothing, they were an awful idea.
        Always behave as if enable_arrows_always is true.