Skip to content

Expand shortcuts, window commands, and mouse gestures - #163

Open
leafOfTree wants to merge 29 commits into
mainfrom
shortcuts-and-gestures
Open

leafOfTree wants to merge 29 commits into
mainfrom
shortcuts-and-gestures

Conversation

@leafOfTree

@leafOfTree leafOfTree commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Closes #161

Summary

  • SendKeys (Win & media keys): Support Win modifier chords (e.g. Win+Shift+S, Win+Shift+T, Win+D), media/volume keys (Vol+, Vol-, Mute, Play/Pause, Next, Prev), and PrtSc in GestureKeys and AnyKey shortcut editors, using a scoped WH_KEYBOARD_LL capture hook during recording so Windows does not intercept Win+* shortcuts before capture completes.
  • General window commands: Add 7 global (Everywhere, unbound by default) commands to Commands.all and the Command Palette: minimize-window, maximize-window (toggle maximize/restore), snap-window-left, snap-window-right (compensating invisible DWM frame bounds), move-window-next-monitor, close-window, and open-system-screenshot (ms-screenclip:).
  • Custom programs & commands (Execute): Add customCommands in settings.json and GestureRun in GestureAction to launch programs, scripts, or URIs (with optional arguments and hidden-window toggle) from global shortcuts, the Command Palette, mouse gestures, edge scroll, and screen corners, with full bidirectional shortcut conflict resolution.
  • Freehand gestures — Record one stroke for all apps or one executable. Saved drawings appear in a compact, horizontally scrollable row with a persistent add button. Hover over a thumbnail to remove it, or focus it and press Delete. The Test gesture window lists the saved samples above the canvas and highlights the closest sample on a match. Save as sample adds the trial drawing to that list. Matching uses stroke order and shape, allows small rotations and rejects close ties between actions. Settings and the command palette let users adjust the minimum similarity from 0% to 100%, with a default of 87% for both practice and live gestures. The original 16 direction gestures remain available.
  • Gesture trail & Mouse Gestures layout: Add a translucent click-through layered GestureTrail overlay (showGestureTrail, enabled by default alongside showGestureHint), place + Add gesture directly beneath the gesture rows, and move the right-click hint legend to the footer below the toggles.
  • Screen edge scroll & hot corners: Add opt-in enableEdgeScroll (wheel up and wheel down on outer monitor edges) and enableHotCorners (hotCornerDelay, default 200 ms, with leave hysteresis, outer-corner multi-monitor checks, and full-screen/mouse-down guards) with independent bindings for each trigger. In Add gesture, select Screen gestures and pick an edge and wheel direction or a corner on the screen diagram. Configured triggers appear in the Everywhere list for editing or removal. The page retains separate enable switches and the corner delay. Each binding can send a shortcut, run a WindowTabs command, or launch a program, script or URI.
  • Docs & localization: Document external screenshot/OCR integration (Win+Shift+S, PowerToys Text Extractor, Umi-OCR) in README.md and provide translations across en, zh, ja, ar, and ko.

Verification

  • dotnet build WindowTabs.sln (Debug & Release, 0 warnings / 0 errors)
  • Native regression suites: MouseGestures, CommandPalette, SettingsEditors, Architecture, SettingsTheme, DpiLayout

- Support Win-key combinations and media keys in gesture SendKeys and low-level shortcut recording
- Add general window commands (minimize, maximize/restore, snap left/right half, move to next monitor, close window, system screenshot)
- Add custom programs and commands (Execute) across shortcuts, the command palette, and mouse gestures with bidirectional conflict resolution
- Add live stroke trail rendering while drawing mouse gestures (enabled by default) and move + Add gesture directly below the gesture table
- Add opt-in screen edge scrolling and screen corner triggers under Mouse Gestures with multi-monitor inner-border exclusion and dwell hysteresis

Refs #161
- Save a custom command's edits even when another program still holds its
  shortcut, and run what is saved now when the key is pressed.
- Give hand-written custom commands without an id a stable one, so their
  shortcut can be found and released.
- Take the release and repeats of a key a shortcut box recorded, so no key
  is left down after recording a Win chord or media key.
- Draw the gesture trail onto one surface per stroke instead of repainting
  a new bitmap every tick.
- Word a blank program target from the interface strings.
- Rebuild the custom command rows after their own buttons' clicks.
- Label the button that clears an edge or corner action "Remove action".
- Set each screen edge's scroll and each corner from the command palette,
  and find a choosing command by the value it shows.
# Conflicts:
#	WtProgram/CommandPalette.fs
#	WtProgram/Commands.fs
#	WtProgram/ManagerViewService/SettingsEditors.fs
#	WtProgram/ManagerViewService/Views/HotKeyView.fs
#	WtProgram/Program.fs
#	WtProgram/Shared/ProgramTypes.fs
#	WtProgram/Shared/Services.fs
#	WtProgram/Shared/Strings.fs
#	WtProgram/WtProgram.fsproj
#	tests/Architecture.fsx
#	tests/CommandPalette.fsx
#	tests/GroupEditor.fsx
#	tests/GroupLifecycle.fsx
#	tests/GroupOperations.fsx
#	tests/SettingsEditors.fsx
#	tests/SplitViewDesktop.fsx

This branch has not been deployed

No deployments
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