Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved keyboard support #25

Open
sean-gugler opened this issue Jul 25, 2024 · 7 comments
Open

Improved keyboard support #25

sean-gugler opened this issue Jul 25, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@sean-gugler
Copy link

Lots of common keyboard shortcuts are already supported, which is great! After using CiderPress II 1.0.2 extensively I find myself wishing for a few more:

  • Every menu item should have a keyboard accelerator assigned. (Examples: File/Recent Files, Actions/Edit Attributes)
  • In file view, Tab key currently moves between fields. This is redundant with arrow keys; it would be more convenient if (Shift+)Tab changed focus to the (prev/)next UI element.
  • Continually hitting Tab key eventually gets "trapped" in the button bar
  • F2 to quickly rename a file. Ideally UI would be to edit the name directly in the main view, but for now bringing up the Info dialog with focus on the filename should be enough.
  • Press "Enter" to open elected file in Viewer
  • In Extract dialog, press "Enter" to invoke the "Select Here" button
@fadden
Copy link
Owner

fadden commented Jul 25, 2024

I like most of these, but anything related to changing focus in WPF can get weird. Just trying to get the initial focus on the file list was causing it to go off into the weeds and disable all actions. It took a while to get it to work as well as it does.

The inter-control tab behavior is probably less of a minefield, but it can be tricky to make it do what you want.

Why F2? Update: I just tried hitting F2 in Windows Explorer with a file selected... and it went into "rename" mode. Mystery solved. :-) FWIW, the filename edit field is already selected and focused when the dialog is opened, and hitting Enter will accept the change and close the dialog.

@fadden
Copy link
Owner

fadden commented Jul 26, 2024

In Extract dialog, press "Enter" to invoke the "Select Here" button

Perhaps it should work the same as double-click: if you do it on a directory it moves into the directory, if you do it on anything else it does Select Here. (The same dialog is also used to select a mix of files and folders for add/import.)

fadden added a commit that referenced this issue Aug 23, 2024
In the main file list, Enter now opens the file viewer (before it
had the default DataGrid behavior, and just moved down a line).

In the Edit Attributes dialog, added keyboard shortcuts for ProDOS
access attributes, e.g. Alt-W toggles the write-enabled permission.

In the file+folder selection dialog (used for Add Files and when
selecting a destination for Extract Files), Enter now triggers the
Select Here button when the file list has focus.  After creating
a new directory, focus is moved to the Select Here button so that
Enter works immediately.  Also, added mouse button 4 as a shortcut
for "nav up".

(for issue #25)
@fadden
Copy link
Owner

fadden commented Aug 23, 2024

Some new shortcuts...

Main file list:

  • Enter: open file viewer for selected entry.
  • Alt+Enter: open Edit Attributes for selected entry. (Same as "properties" in Windows Explorer.)

Edit attributes:

  • Alt+D/N/W/R/B/I/L toggle access flag.

File+folder selection dialog:

  • Enter: triggers Select Here.
  • mouse button 4: triggers Nav Up.

fadden added a commit that referenced this issue Aug 24, 2024
The File > Recents menu is generated from the list of recently-opened
archives when the menu is opened.  To allow keyboard shortcuts to
work through the standard Command mechanism, we need to change that
to be less dynamic.  The menu is still generated as needed, but now
have a fixed set of six commands with keyboard shortcuts.

The list of recents is updated whenever an archive is opened, which
has some interesting effects.  Ctrl+Shift+1 reopens the current
archive, which isn't hugely useful, but also it works when nothing is
open.  Ctrl+Shift+2 opens the previous archive, allowing you to flip
between two archives quickly (which would admittedly be more useful
if you could copy & paste without needing to keep the source archive
open).  Ctrl+Shift+3 rotates between three archives.

Also, added keyboard shortcuts for Create Directory (Ctrl+Shift+N,
same as Windows explorer) and Add Files (Ctrl+Shift+A, because Ctrl+A
is already used for "select all").

(issue #25)
@fadden
Copy link
Owner

fadden commented Aug 24, 2024

Main file list:

  • Ctrl+Shift+N: Create Directory (same as in Windows Explorer)
  • Ctrl+Shift+A: Add Files (Ctrl+A was taken by "select all")
  • Ctrl+Shift+1 through Ctrl+Shift+6: open recent file N

This makes Ctrl+Shift+2 flip back and forth between two archives, and Ctrl+Shift+3 rotate through a set of 3. Higher-numbered shortcuts become increasingly less useful. They do work when no file is open, so it might be worth displaying the full set on that screen (instead of just the most recent two) to allow Ctrl+W Ctrl+Shift+[#] to be a fast way to switch around.

@sean-gugler
Copy link
Author

This is awesome! A big help; many thanks.

Still on the wishlist: when focus is on main file list and a directory is selected, "Enter" does not behave as double-click. Instead it tries to open the first file entry found in the list, ignoring the selection, which feels a bit odd.

@fadden
Copy link
Owner

fadden commented Oct 13, 2024

Yeah that feels weird. The "view files" command expects to get a list of stuff to view. When only one file is selected, it acts as if all files in the window are selected, so you can use the forward/backward buttons. You can't really view directories, so it throws those out. So asking to view a single directory entry gets you the first thing in the window.

The basic problem is that Enter is a shortcut for "view files", rather than being equivalent to double-click, which has special behavior when only one entry is selected.

fadden added a commit that referenced this issue Oct 15, 2024
The Return key was mapped to View Files, but it's better if it acts
the same as double-click, which descends into directories and opens
embedded archives and disk images.

We now put the focus back on the file list after moving to a new
directory or moving up a level.  This allows keyboard navigation
through the directory tree while in single-dir view mode.

(issue #25)
@fadden
Copy link
Owner

fadden commented Oct 15, 2024

Updated in v1.0.5-dev1. You should be able to navigate through the directory hierarchy in "single directory" view mode using the keyboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants