Repository navigation
ADD: desktop right-drag, Shift+F10 and Menu key (#40) - #73
Merged
Merged
Conversation
The --desktop helper's mouse hook swallowed every right press on the desktop's icon list, so a right-drag never started. Once the pointer leaves the drag box, the press is now replayed with SendInput (tagged, passed through by the hook) so Explorer runs its own right-drag and drop menu; a release before the replay still gets our menu. Swapped buttons, desktop switches (Win+L, UAC) and one-pixel rounding in absolute coordinates are handled. A low-level keyboard hook answers Shift+F10 and the Menu key while the desktop list has the keyboard: rexplorer's menu for the selection, at the focused icon. After a cancelled menu, Rename, a view command, Copy, Cut or Create shortcut the desktop gets the keyboard back, as after Explorer's own menu; Paste and other shell verbs keep it. ContextMenu::show_in now reports the invoked verb. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #40.
What changes
Right-drag on desktop icons. The
--desktophelper's mouse hook used to swallow every right press on the desktop's icon list, so a right-drag never started. Now, once the pointer leaves the drag box, the swallowed press is replayed withSendInput: an absolute move to the press point, the button down, then a move back to the pointer. The replay is tagged, so the hook lets it through, and Explorer runs its own right-drag and drop menu (Move here, Copy here, Create shortcuts here). A release that comes before the replay still gets rexplorer's menu.Shift+F10 and the Menu key. These now open rexplorer's menu while the desktop list has the keyboard, which a new
WH_KEYBOARD_LLhook detects. The key-down, its auto-repeats and its key-up are all swallowed. The menu covers the selection and opens at the focused icon; with nothing selected it opens the background menu at the cursor. While an icon is being renamed, the keys go to the edit box as before.Keyboard focus after the menu. The desktop gets the keyboard back, as after Explorer's own menu, after any of these:
Paste and other shell verbs keep the foreground, because they may open a window of their own. To support this,
ContextMenu::show_innow returns the canonical verb it invoked (Picked::Invoked(String)).Review (Opus) — defects fixed before this PR
GetAsyncKeyState, which never sees a press the hook swallowed, so right-drag never fired. Now only the replay clearsPRESSED, so a release that comes first can no longer leave a button stuck.SendInputpresses physical buttons, so a right-drag became a left drag with no drop menu. It now usesLEFTDOWNwhenSM_SWAPBUTTONis set.EVENT_SYSTEM_DESKTOPSWITCHWinEvent now clears that state.vkCode0.Tests
cargo build/test --release --lockedwith-D warnings: app 87, core 86, all passing.menu_keys,virtual_screen_to_absolute,drag_box,verbs_that_return_the_keyboard.🤖 Generated with Claude Code