-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow binding side modifier keys #3364
Comments
Accepted. Ghostty is already aware of left/right modifiers so expanding this to bindings should not be difficult. |
Working on this, can someone assign this to me? |
Documenting some research on this: The current behaviour is that Parsing as a modifier requires adding to the modifier parsing section. Then the Set used to lookup mappings between Triggers and Actions needs to consider the now distinguishing sides field in lookup, considering hashing and equality checks to avoid collisions between a Modifying the terminal inspector display the side of modifiers is a bonus and can help debugging. It looks like there's code in the swift and gtk apprts for describing sided input, |
Representing a Trigger internally can support this. However the APIs for existing apprts do not provide indicators whether a modifier (shift, ctrl, alt, super) came from which side of {left,right}. Our gtk key callback is bound here ghostty/src/apprt/gtk/Surface.zig Line 592 in f1f1120
and use the gtk_mods to determine the active modifiers for a non-modifer key. Instrumenting the terminal inspector we see: We can write config that uses specifically lctrl, lshift or rshift etc pretty simply, but we can't tell whether input is side-specific such as if a Shift modifier on 'a' was from left_shift or right_shift currently. APIs without side information: APIs that can query key-state (including sides): To support this, I think we need to maintain our own key-state, at least for modifiers, accumulating over key-event stream given by the existing APIs instead of relying on toolkit APIs. @mitchellh This doesn't seem as simple as expected, can you review if we still want to implement? |
keybind = left_shift+a=open_config
is rejected despite the fact that it's inThe text was updated successfully, but these errors were encountered: