mgarin / weblaf

WebLaF is a fully open-source Look & Feel and component library written in pure Java for cross-platform desktop Swing applications.
http://weblookandfeel.com
GNU General Public License v3.0
1.13k stars 234 forks source link

File Chooser: keyboard navigation #163

Open Sciss opened 9 years ago

Sciss commented 9 years ago

Some suggestions for improvement: First of all, the tab key stops working when the right-hand side view (file list) has received focus and is in "details" mode (table). In general a fast shortcut to cycle focus between directories and files would be great.

It would be grain if one could navigate inside the right-hand-side view with alphanumerical keys to jump to a specific file. This already works inside the left-hand-side tree view.

Finally, you can descend into a folder by pressing enter, but if a file is selected, pressing enter has no effect. It would be great if pressing enter on a file would confirm the dialog with the current selection.

mgarin commented 9 years ago

First of all, the tab key stops working when the right-hand side view (file list) has received focus and is in "details" mode (table). In general a fast shortcut to cycle focus between directories and files would be great.

So what exactly should happen on TAB press? - At the moment it simply "runs" through focusable components, but stuck in table due to its key bindings.

It would be grain if one could navigate inside the right-hand-side view with alphanumerical keys to jump to a specific file. This already works inside the left-hand-side tree view.

Good point, I will add proper enhancements into the list and table view.

Finally, you can descend into a folder by pressing enter, but if a file is selected, pressing enter has no effect. It would be great if pressing enter on a file would confirm the dialog with the current selection.

I didn't go with this for the first release due to some issues I had, but I guess this is also a good thing to add. This won't work for folders though (even if folder selection is allowed within chooser) for understandable reasons - only for files.

I will include these enhancements into next (v1.29) update.

Sciss commented 9 years ago

So what exactly should happen on TAB press? - At the moment it simply "runs" through focusable components, but stuck in table due to its key bindings.

  • Switch between left-hand and right-hand view (like in TotalCommander)?
  • Simply "run" through focusable components as usual without being stuck in table?

Ideally you could jump with one press between left and right. Perhaps it's sufficient if these two views are next to each other in the focus traversal list.

Finally, you can descend into a folder by pressing enter, but if a file is selected, pressing enter has no effect. It would be great if pressing enter on a file would confirm the dialog with the current selection.

I didn't go with this for the first release due to some issues I had, but I guess this is also a good thing to add. This won't work for folders though (even if folder selection is allowed within chooser) for understandable reasons - only for files.

If there is an ambiguity with folders, perhaps one could use a different short cut such as Shift-Enter.

Thanks for your work!

mgarin commented 9 years ago

If there is an ambiguity with folders, perhaps one could use a different short cut such as Shift-Enter.

Usually it is Ctrl+Enter, though both shortcuts are free anyway and can be added.

Anyway, got the idea. These changes will be added soon. There will also be a few other fixes and improvements for file chooser.

Sciss commented 9 years ago

In this context: Having shortcuts to switch between icons/tiles/details view mode would be great. Perhaps one shortcut that cycles through these three states.

mgarin commented 9 years ago

Will also consider adding this one :)

Sciss commented 9 years ago

I see these two lines in WebFileChooserPanel.java:

approveButton.addHotkey ( WebFileChooserPanel.this, Hotkey.CTRL_ENTER ).setHotkeyDisplayWay ( TooltipWay.up );
cancelButton.addHotkey ( WebFileChooserPanel.this, Hotkey.ESCAPE ).setHotkeyDisplayWay ( TooltipWay.up );

Any reason that they are disabled? They seem to work fine.

mgarin commented 9 years ago

Sorry for the delay - I have read your question a while ago, though I still couldn't really find an answer - this is probably a change I have accidentally made while testing HotkeyManager.

So yes, those should be brought back :)