Skip to content

Add , and . keyboard shortcuts to switch models#651

Open
henrikvilhelmberglund wants to merge 1 commit into
sdatkinson:mainfrom
henrikvilhelmberglund:feat-keyboard-nav
Open

Add , and . keyboard shortcuts to switch models#651
henrikvilhelmberglund wants to merge 1 commit into
sdatkinson:mainfrom
henrikvilhelmberglund:feat-keyboard-nav

Conversation

@henrikvilhelmberglund

@henrikvilhelmberglund henrikvilhelmberglund commented Jul 12, 2026

Copy link
Copy Markdown

This PR adds , and . keyboard shortcuts for changing the current model in the model list. You click in the VST window to give focus to the VST, then , or . to change the model, the model loading wraps end to start like the UI arrows. There are no other shortcuts for loading/clearing and such, I was only interested in changing models quickly without reaching for the mouse.

The code was written using Claude.

Description

(by Claude)
Exposes prev/next file navigation on NAMFileBrowserControl as public methods and installs a plugin-level key handler that maps kVK_LEFT and kVK_RIGHT (no modifiers) to the model browser's prev/next actions. Requires the plugin window to have keyboard focus. Text entries and other controls that consume the key still take precedence.

PR Checklist

  • Did you format your code using format.bash?
  • Does the VST3 plugin pass all of the unit tests in the VST3PluginTestHost? (Download it as part of the VST3 SDK here.)
    • Windows
    • macOS
  • Does your PR add, remove, or rename any plugin parameters? If yes...
    • Have you ensured that the plug-in unserializes correctly?
    • Have you ensured that older versions of the plug-in load correctly? (See Unserialization.cpp.)
  • Does your PR add or remove any graphical assets? If yes, are they defined in config.h and added in the two required locations in main.rc?

Exposes prev/next file navigation on NAMFileBrowserControl as public
methods and installs a plugin-level key handler that maps , and .
to the model browser's prev/next actions. Detection is done via the
utf8 field of IKeyPress so the mapping works with any keyboard layout
that produces those characters unshifted. Requires the plugin window
to have keyboard focus. Text entries and other controls that consume
the key still take precedence.

Arrow keys were considered but on Windows they are intercepted by the
dialog manager (WM_KEYDOWN gets translated to WM_NEXTDLGCTL) in some
hosts, making the shortcut unreliable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@henrikvilhelmberglund

Copy link
Copy Markdown
Author

Changed keys to , and . due to focus being janky on Windows when using the arrow keys.

@henrikvilhelmberglund henrikvilhelmberglund changed the title Add Left/Right arrow keyboard shortcuts to switch models Add . and , keyboard shortcuts to switch models Jul 15, 2026
@henrikvilhelmberglund henrikvilhelmberglund changed the title Add . and , keyboard shortcuts to switch models Add , and . keyboard shortcuts to switch models Jul 15, 2026
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