Repository navigation
image-wlx 0.1.1: DC's viewer hotkeys work with the image focused - #37
Merged
Merged
Conversation
With the image focused, N / P and Alt+Right / Alt+Left did nothing (File > Next still worked): the canvas swallowed every key it did not use, and LCL handles its viewer hotkeys through NSApplication's -sendEvent: dispatch. The canvas now keeps only the zoom keys and the unmodified scroll keys and hands every other key to DC the way Esc already was, then takes focus back once DC has handled it, so the arrows pan the next image. test/keys_verify.m covers N, P, Alt+arrows, Q and a view-mode digit, and that the arrows and zoom keys stay with the image; it fails 16 checks on 0.1.0. Bump to 0.1.1.
Review findings on the hotkey hand-off, plus what the extended harness found: - Cmd+Up / Cmd+Down scroll to top / bottom again (the hand-off had sent them to DC, which has no binding for them); Shift+arrows now go to DC instead of being swallowed; Shift+Space pages up. - End and Cmd+Down landed at the top: the huge scroll delta overflowed in NSClipView's constraint arithmetic. Scroll by the real distance instead. - Scroll keys are handled by key code, not -interpretKeyEvents:, so a DefaultKeyBinding.dict that maps Home / End to line start / end no longer leaves them dead. - keys_verify: each key reaches DC exactly once; Tab to DC's file panel and a dialog taking the key window both keep focus away from the image; Home / End / Cmd+Up / Cmd+Down land on the right edge. - Comment and charter no longer claim strict ordering between the re-posted key and the focus reclaim (a nested run loop in DC runs it during).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the image focused in the F3 viewer, Double Commander's viewer hotkeys did nothing: N / P and Alt+→ / Alt+← (next / previous file), Q, the view-mode digits. File → Next in the menu still worked. LCL handles these keys through
NSApplication's-sendEvent:dispatch, and the image canvas consumed every key press itself.Fix
-interpretKeyEvents:. ADefaultKeyBinding.dictthat maps Home / End to line start / end used to leave them dead.NSClipView. They now scroll by the real distance.Tests
test/keys_verify.m, also wired into CI. It covers:ListLoadNext;=stay with the image and land where they should.Follow-up for the web-view plugins: #36.