GNOME Bugzilla – Bug 378202
There is no easy way to select the file with focus in files part
Last modified: 2008-07-02 16:14:31 UTC
For example, after you delete a file using keyboard (Del key), the focus still remains on the files part of the Nautilus, and a file item seems to be focused (A dotted-line box is drawn around it). To select (highlight) this file using keyboard, you can only do the following: Use arrow keys to select one of the files beside this file and again go back to the file you intended to select. This means that you should select the file by pressing "left" and then "right" arrow key (Or "up" and then "down" arrow key). Furthermore, if you delete every other file in the folder, and just one file remains, then you can not even use the above method, and you simply can't select the file using keyboard!! This seems very inconvenient. This makes keyboarding of Nautilus a bad experience for keyboarders! It would be better if we could select a focused file by just pressing "space bar" (As it is done in Windows).
*** Bug 488815 has been marked as a duplicate of this bug. ***
Confirming and adding 'usability' keyword.
It seems(In reply to comment #0) > > Furthermore, if you delete every other file in the folder, and just one file > remains, then you can not even use the above method, and you simply can't > select the file using keyboard!! This part is dup of bug 540107
(In reply to comment #0) > For example, after you delete a file using keyboard (Del key), the focus still > remains on the files part of the Nautilus, and a file item seems to be focused > (A dotted-line box is drawn around it). To select (highlight) this file using > keyboard, you can only do the following: Use arrow keys to select one of the > files beside this file and again go back to the file you intended to select. > This means that you should select the file by pressing "left" and then "right" > arrow key (Or "up" and then "down" arrow key). You can select the file by pressing CONTROL + SPACE bar... I've discovered it reading nautilus source code. > > This seems very inconvenient. This makes keyboarding of Nautilus a bad > experience for keyboarders! It would be better if we could select a focused > file by just pressing "space bar" (As it is done in Windows). > I also think it's much more discoverable as SPACE bar rather than CONTROL + SPACE bar.
Created attachment 113524 [details] [review] Patch to select icon with space bar when there's no icon selected Well, it's clear that 'space' is better that 'ctrl+space', but nautilus uses space bar to activate selected items, but our main case to use 'space' is when there is no icon selected, because we want to select some one,... so no problem, because when there is no icon selected we can't activate any icon with the bar, so in this case (when there's no selected icons) we make the 'space' bar act as if was 'control+space'. That's what the patch does. To summarize, currently, when there's any icon selected, pressing space bar causes nothing (as there's anything to activate), but with the patch it'll cause the current keyboard_focused_icon to get selected (i.e. like if we pressed 'ctrl+space'). Seems like a good approaching to me.
Same thing as your patch as a one-liner instead (which also avoids the extra allocation this patch adds): - if ((event->state & GDK_CONTROL_MASK) != 0) { + if ((event->state & GDK_CONTROL_MASK) != 0 || !has_selection (container)) { Not that I've had time enough to test it, but it sounds sane to me.
Works as advertised. Ack from me.
Created attachment 113528 [details] [review] Now using short if version Oh,, thanks for the suggestion :), I didn't know that using the large version added extra allocation,, good to know :) I've updated the patch.
Heh, I think you missed my meaning: we have a function in nautilus-icon-container called "has_selection()" [ nautilus-icon-container.c:6896: static gboolean has_selection (NautilusIconContainer *container) ] The one liner patch in #6 skips the extra list allocation/free, is easier to read, and implements the same behavior (and it works as you explained).
Oh, sorry for the misunderstanding.. ok, the one-liner in comment 6 is better of course.. Thanks
Oh, thank you very much guys for your paying attention to this issue. I didn't know that 'ctrl+space' does what I wanted to do, so there was some (non-easy) way to select the file ;) But, anyway, the patched that you have prepared looks very useful. Will it be merged in the next version of GNOME?
Thanks for your efforts, I committed another patch to trunk and to the GNOME 2.22 branch: http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14285 http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14286 2008-06-28 Christian Neumair <cneumair@gnome.org> * libnautilus-private/nautilus-icon-container.c (keyboard_move_to), (keyboard_space): If no icon is selected, but an icon has the keyboard focus, select it when pressing space. Thanks to Nelson Benítez León, A. Walton and Amir Reza Khosroshahi. Fixes #378202. It ensures that the keyboard focus is cleared, and that the icon is used as range selection base. Closing as fixed.
Cc'ing Vincent Alexander on this change-- may need to be documented in the keynav chapter of the accessibility guide.