[Enhancement]: Enable WASD to Work as Navigation in the Grid #58

Closed
opened 2026-06-12 07:02:25 +00:00 by ValleyGeek · 6 comments
Owner

Affected area

Grid View

Current behavior

Keyboard navigation is limited to the arrow keys in the grid view

Desired improvement

Add WASD as arrow key equivalents in the grid view for moving from image to image.

References

No response

### Affected area Grid View ### Current behavior Keyboard navigation is limited to the arrow keys in the grid view ### Desired improvement Add WASD as arrow key equivalents in the grid view for moving from image to image. ### References _No response_
Member

Implemented on branch 0.1.44/issue-55-58-72-87-grid-nav-zoom (chained off the previous dev branch, not merged to main yet).

WASD now act as arrow-key equivalents in the grid: W=Up, A=Left, S=Down, D=Right, only when no other modifier is held (so e.g. Ctrl+A still selects all). Implemented as a GridWasdNavFilter event filter on the grid's QListView that remaps the key event and re-dispatches it, so it reuses the exact same navigation/selection logic as the real arrow keys. Covered by new tests in tests/test_grid_input_filters.py.

Bundled with #55, #87, and #72 in the same branch/PR since they all touch grid/viewer input handling.

Implemented on branch `0.1.44/issue-55-58-72-87-grid-nav-zoom` (chained off the previous dev branch, not merged to `main` yet). WASD now act as arrow-key equivalents in the grid: `W`=Up, `A`=Left, `S`=Down, `D`=Right, only when no other modifier is held (so e.g. Ctrl+A still selects all). Implemented as a `GridWasdNavFilter` event filter on the grid's `QListView` that remaps the key event and re-dispatches it, so it reuses the exact same navigation/selection logic as the real arrow keys. Covered by new tests in `tests/test_grid_input_filters.py`. Bundled with #55, #87, and #72 in the same branch/PR since they all touch grid/viewer input handling.
Author
Owner

S & W aren't affecting vertical movement between rows in the grid

S & W aren't affecting vertical movement between rows in the grid
Member

Found it — pushed to 0.1.47/issue-111-86-64-89-feedback-fixes (0.1.55).

Root cause: "Previous/next duplicate group" also defaults to W/S and was registered as an application-wide shortcut. Qt's shortcut dispatch intercepts a matching key press before it's ever delivered as a normal key event to the focused widget — so W/S got eaten before the grid's own WASD handling ever saw them. A/D had no competing shortcut, which is why those worked. The original tests for this feature used a stripped-down grid that never registers the dupe-group shortcuts, so the collision slipped through.

Fix: those two shortcuts are now only active while the Duplicates workbench is open (including its Single viewer, since that's where group-navigation is actually used) — W/S are free for grid navigation everywhere else.

Please re-test when convenient.

Found it — pushed to `0.1.47/issue-111-86-64-89-feedback-fixes` (0.1.55). Root cause: "Previous/next duplicate group" also defaults to W/S and was registered as an application-wide shortcut. Qt's shortcut dispatch intercepts a matching key press *before* it's ever delivered as a normal key event to the focused widget — so W/S got eaten before the grid's own WASD handling ever saw them. A/D had no competing shortcut, which is why those worked. The original tests for this feature used a stripped-down grid that never registers the dupe-group shortcuts, so the collision slipped through. Fix: those two shortcuts are now only active while the Duplicates workbench is open (including its Single viewer, since that's where group-navigation is actually used) — W/S are free for grid navigation everywhere else. Please re-test when convenient.
Author
Owner

W & S are now working.

Bug Identified: Select an image, open in the image viewer, navigate to a different image, return to the grid (with 'e' for instance) the new active image is correctly highlighted; however, when pressing W, A, S, or D it begins navigation from the image that was used to leave the grid instead of the newly active image.

W & S are now working. Bug Identified: Select an image, open in the image viewer, navigate to a different image, return to the grid (with 'e' for instance) the new active image is correctly highlighted; however, when pressing W, A, S, or D it begins navigation from the image that was used to leave the grid instead of the newly active image.
Member

Good catch — found it, pushed to 0.1.47/issue-111-86-64-89-feedback-fixes (0.1.57).

Returning from the viewer was updating the visual highlight on the grid but not its internal navigation cursor — Qt's arrow-key/WASD movement resumes from that cursor, not from whatever is merely highlighted, so the two could point at different rows. There's already a correct pattern for this elsewhere in the same file (a single call that updates both together); the viewer-return path was the one place that didn't use it.

Reproduced and confirmed against the old code before fixing (the cursor was actually left completely unset, not just stale) and added a regression test that opens the viewer, navigates, returns, and presses a WASD key to confirm it now continues from the right row.

Please re-test when convenient.

Good catch — found it, pushed to `0.1.47/issue-111-86-64-89-feedback-fixes` (0.1.57). Returning from the viewer was updating the visual highlight on the grid but not its internal navigation cursor — Qt's arrow-key/WASD movement resumes from that cursor, not from whatever is merely highlighted, so the two could point at different rows. There's already a correct pattern for this elsewhere in the same file (a single call that updates both together); the viewer-return path was the one place that didn't use it. Reproduced and confirmed against the old code before fixing (the cursor was actually left completely unset, not just stale) and added a regression test that opens the viewer, navigates, returns, and presses a WASD key to confirm it now continues from the right row. Please re-test when convenient.
Member

Closing as part of wrapping up this branch chain into PRs (the W/S navigation collision and the post-viewer currentIndex bug from the last two rounds of testing are both included in the final PR, #129). Shipped across PR #126 (original WASD nav) and PR #129 (both regression fixes). If anything else turns up after this lands, feel free to reopen or file a new issue.

Closing as part of wrapping up this branch chain into PRs (the W/S navigation collision and the post-viewer currentIndex bug from the last two rounds of testing are both included in the final PR, #129). Shipped across PR #126 (original WASD nav) and PR #129 (both regression fixes). If anything else turns up after this lands, feel free to reopen or file a new issue.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ai-collab/bulk-image-organizer#58
No description provided.