mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 11:11:47 +02:00
macOS: Allow assigning only the left or right :kbd:Option key to work as the :kbd:Alt key. See :opt:macos_option_as_alt for details
Fixes #1022
This commit is contained in:
@@ -348,6 +348,15 @@ cocoa_make_window_resizable(void *w, bool resizable) {
|
||||
return true;
|
||||
}
|
||||
|
||||
#define NSLeftAlternateKeyMask (0x000020 | NSEventModifierFlagOption)
|
||||
#define NSRightAlternateKeyMask (0x000040 | NSEventModifierFlagOption)
|
||||
|
||||
bool
|
||||
cocoa_alt_option_key_pressed(NSUInteger flags) {
|
||||
NSUInteger q = (OPT(macos_option_as_alt) == 1) ? NSRightAlternateKeyMask : NSLeftAlternateKeyMask;
|
||||
return ((q & flags) == q) ? true : false;
|
||||
}
|
||||
|
||||
void
|
||||
cocoa_focus_window(void *w) {
|
||||
NSWindow *window = (NSWindow*)w;
|
||||
|
||||
Reference in New Issue
Block a user