Skip to content

Add option for Escape to close the viewer - #97

Open
Omegadarling wants to merge 1 commit into
voidtools:masterfrom
Omegadarling:escape-closes
Open

Omegadarling wants to merge 1 commit into
voidtools:masterfrom
Omegadarling:escape-closes

Conversation

@Omegadarling

Copy link
Copy Markdown

Pressing Escape now closes the viewer when Escape has nothing else to do. The existing Escape behaviour keeps priority, in this order: cancelling the current action, leaving fullscreen, then any command bound to Escape. Key repeats are ignored, so holding Escape to leave fullscreen does not also close the viewer.

The option is on by default and can be turned off in Options > Controls > "Escape key closes the viewer" (ini: escape_closes).

Notes for merging

  • master does not build until one of the open build-fix pull requests (88 or 95) lands. The new control ID is 1067 so it does not collide with the IDs those add (1055-1066). The companion "zoom out past best fit" pull request uses 1068.
  • res/voidImageViewer.rc will conflict with 88/95 in IDD_CONTROLS, because they rename the IDs on the lines this change moves down. The right resolution keeps their IDs (IDC_COMMANDS_STATIC, the *_COMBOBOX names and so on) with this change's positions: the checkbox at 0,53, "&Commands:" at 0,70 and the command list at 0,81,193,61. Taking their side whole drops the checkbox, which silently turns the option off every time Options is closed with OK. I'm happy to rebase once a build fix is merged.
  • The Chinese label is a best-effort translation and may need a native speaker's review.

🤖 Generated with Claude Code

Pressing Escape now closes the viewer when Escape has nothing else to
do. The existing Escape behaviour keeps priority, in this order:
cancelling the current action, leaving fullscreen, then any command
bound to Escape. Key repeats are ignored, so holding Escape to leave
fullscreen does not also close the viewer.

The option is on by default and can be turned off in Options > Controls
> "Escape key closes the viewer" (ini: escape_closes).

Notes for merging:
- master does not build until one of the open build-fix pull requests
  (88 or 95) lands. The new control ID is 1067 so it does not collide
  with the IDs those add (1055-1066). The companion "zoom out past best
  fit" pull request uses 1068.
- res/voidImageViewer.rc will conflict with 88/95 in IDD_CONTROLS,
  because they rename the IDs on the lines this change moves down. The
  right resolution keeps their IDs (IDC_COMMANDS_STATIC, the *_COMBOBOX
  names and so on) with this change's positions: the checkbox at 0,53,
  "&Commands:" at 0,70 and the command list at 0,81,193,61. Taking their
  side whole drops the checkbox, which silently turns the option off
  every time Options is closed with OK. I'm happy to rebase once a build
  fix is merged.
- The Chinese label is a best-effort translation and may need a native
  speaker's review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant