Skip to content

Commit

Permalink
DeskTop: Make arrow keys navigate icons spatially
Browse files Browse the repository at this point in the history
Previously, arrow keys would iterate through icons in index order,
with up/down behaving the same as left/right. While simple, this was
surprising to users.

Now, in icon views, Arrow keys will navigate the icons "spatially".
That is, pressing the Right Arrow key will try to find an icon to the
right of the current selection, pressing the Down Arrow key will try
to find an icon below the current selection, and so on. If there is no
such icon, selection remains unchanged. This works by searching for an
icon in the indicated direction, which is fast if there is an icon. At
1MHz if there is no such icon then there can be a bit of a delay
depending on the number of icons in the window. Also, if icons are in
the regular grid then the behavior is very predictable. If you move
icons so that they overlap, things are a bit weird... so don't do
that.

In list views, the Up/Down Arrow keys retain their current behavior,
but the Left/Right Arrow keys are now ignored.

This also corrects several edge cases:

* In icon views, if nothing is selected in the active window (or
  desktop if none), the first icon becomes selected.

* In list views, if nothing is selected in the active window, the
  first or last icon is selected depending on whether Down Arrow or Up
  Arrow was pressed.

* If selection doesn't change (e.g. there's nothing to select in the
  active window, or there's nothing further to select), then selection
  doesn't change.

Resolves #300
  • Loading branch information
inexorabletash committed Oct 10, 2024
1 parent 36b330d commit 635dcec
Show file tree
Hide file tree
Showing 3 changed files with 264 additions and 98 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Project Page: https://github.com/a2stuff/a2d
* Fix Apple+O to not "Open and Close" when menu already showing. ([#796](https://github.com/a2stuff/a2d/issues/796))
* Allow keyboard selection of icons in all windows.
* Show tip about copying PRODOS during Format/Erase process.
* Arrow keys now move icon selection in appropriate direction. ([#300](https://github.com/a2stuff/a2d/issues/300))

### Selector

Expand Down
Loading

0 comments on commit 635dcec

Please # to comment.