Skip to content
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

Cmd + ~ does not switch between OS windows in Kitty under Mac OS #4657

Closed
mattpolzin opened this issue Feb 8, 2022 · 22 comments
Closed

Cmd + ~ does not switch between OS windows in Kitty under Mac OS #4657

mattpolzin opened this issue Feb 8, 2022 · 22 comments
Labels

Comments

@mattpolzin
Copy link
Sponsor

Describe the bug
Cmd + ~ does not switch between OS windows in Kitty under Mac OS. For most apps, that shortcut would cycle between windows of the same application. For Kitty, you see a diagnostic-like output in the terminal of " (arg: 9)".

To Reproduce
Steps to reproduce the behavior:

  1. With more than one Kitty OS window open in Mac OS, press the tilde key while holding the command key.
  2. See indicated output text and note that the window with focus has not switched.

Environment details

kitty 0.24.2 created by Kovid Goyal
Darwin MacBook-Pro-2.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64
ProductName:	macOS ProductVersion:	11.6 BuildVersion:	20G165
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/bash
Loaded config files:
  /Users/mattpolzin/.config/kitty/kitty.conf

Config options different from defaults:
background_opacity            0.95
font_family                   JetBrains Mono Regular
macos_thicken_font            0.25
scrollback_pager_history_size 1073741824
shell_integration             frozenset({'disabled'})
tab_activity_symbol           ⦿
tab_bar_style                 powerline
tab_powerline_style           slanted
window_padding_width          FloatEdges(left=2.0, top=2.0, right=2.0, bottom=2.0)
Colors:
	color4                        #0000b2   
	foreground                    #b7cbff   

Environment variable names seen by the kitty process:
	COMMAND_MODE
	HOME
	LANG
	LOGNAME
	PATH
	SHELL
	SSH_AUTH_SOCK
	SSL_CERT_FILE
	TMPDIR
	USER
	XPC_FLAGS
	XPC_SERVICE_NAME
	__CFBundleIdentifier
	__CF_USER_TEXT_ENCODING

Additional context
The problem is reproducible with no configuration applied. Interestingly (but perhaps not importantly), the output noted above with "arg: 9" is only printed when using the bash shell. In zsh, the bug persists, but nothing is printed to the screen.

@mattpolzin mattpolzin added the bug label Feb 8, 2022
@kovidgoyal
Copy link
Owner

Works for me running from master with

kitty --config=NONE

You should run kitty with

kitty --debug-input

that will tell you what is happening to the keypresses. And the
"diagnostic output" you are talking about is just the encoded key event
being sent to the terminal.

@page-down
Copy link
Contributor

page-down commented Feb 9, 2022

Did you configure Cmd+` in System Preferences -> Keyboard -> Shortcuts -> Keyboard -> Move focus to next window?

If more than one instance of kitty is opened, for example by running the kitty command in the terminal, the OS windows of these two instances will not be switched via Cmd+` .

Unfortunately I no longer have macOS 11 available for testing, but I believe it should work fine.

@kujohn
Copy link

kujohn commented Feb 9, 2022

I am also having this issue, I have tried kitty --config=NONE and this is what I get:

6;9u

In other terminals without configuration, this would allow me to cycle windows. Any tips?

@page-down
Copy link
Contributor

page-down commented Feb 9, 2022

I am also having this issue

Are you using kitty 0.24.2? What's in your System Preferences "Shortcuts" ? (see my comment above)
Try running the following command to provide more information.

defaults read com.apple.symbolichotkeys

kitty --config=NONE --debug-input
# press cmd+` and see the logs

@mattpolzin
Copy link
Sponsor Author

I discovered that on one of my laptops, 0.24.2 was not exhibiting the issue even as my other laptop with the same version was... going to look into suggestions mentioned above next! Thanks!

The laptop this is working on is running Mac OS 11.5 whereas the one it is not working on is running 11.6, but that could also be total coincidence.

@mattpolzin
Copy link
Sponsor Author

mattpolzin commented Feb 9, 2022

Ok, I have not had time to digest the following yet, but I'll share in case anyone is curious. There does seem to be some meaningful difference in the output of --debug-input between the laptop where switching windows is working vs. the laptop where it is not working.

[EDIT] I should mention, I have also confirmed that I have Cmd+` turned on in my system preferences (and it works in other apps on both laptops).

Working:

-------------- flags changed -----------------
NSEvent: type=FlagsChanged loc=(829.236,263.865) time=348760.3 flags=0x100108 win=0x7fc77fc3a350 winNum=13374 ctxt=0x0 keyCode=55
flagsChanged: modifier: super native_key: 0x37 (<noname>) glfw_key: 0xe064 mods: super 
on_key_input: glfw key: 0xe064 native_code: 0x37 action: PRESS mods: super text: '' state: 0 updateIMEPosition: left=290.500000, top=68.500000, width=7.000000, height=15.000000
ignoring as keyboard mode does not support encoding this event
---------------- key down -------------------
NSEvent: type=KeyDown loc=(829.236,263.865) time=348760.6 flags=0x100108 win=0x7fc77fc3a350 winNum=13374 ctxt=0x0 chars="`" unmodchars="`" repeat=0 keyCode=50
keyDown triggerred global macOS shortcut ignoring
----------------- key up --------------------
NSEvent: type=KeyUp loc=(829.236,263.865) time=348760.6 flags=0x100108 win=0x7fc77fc3a350 winNum=13374 ctxt=0x0 chars="`" unmodchars="`" repeat=0 keyCode=50
keyUp ignored as corresponds to previous keyDown that trigerred a shortcut
-------------- flags changed -----------------
NSEvent: type=FlagsChanged loc=(829.236,263.865) time=348760.8 flags=0x100 win=0x7fc77fc3a350 winNum=13374 ctxt=0x0 keyCode=55
flagsChanged: modifier: super native_key: 0x37 (<noname>) glfw_key: 0xe064 mods: none 
on_key_input: glfw key: 0xe064 native_code: 0x37 action: RELEASE mods: none text: '' state: 0 updateIMEPosition: left=290.500000, top=68.500000, width=7.000000, height=15.000000
ignoring as keyboard mode does not support encoding this event

Not working (different laptop):

-------------- flags changed -----------------
NSEvent: type=FlagsChanged loc=(575.594,1081.6) time=4724080.8 flags=0x100108 win=0x7f9209e3bb30 winNum=144427 ctxt=0x0 keyCode=55
flagsChanged: modifier: super native_key: 0x37 (<noname>) glfw_key: 0xe064 mods: super 
on_key_input: glfw key: 0xe064 native_code: 0x37 action: PRESS mods: super text: '' state: 0 updateIMEPosition: left=115.000000, top=68.000000, width=7.000000, height=15.000000
ignoring as keyboard mode does not support encoding this event
---------------- key down -------------------
NSEvent: type=KeyDown loc=(575.594,1081.6) time=4724081.2 flags=0x100108 win=0x7f9209e3bb30 winNum=144427 ctxt=0x0 chars="`" unmodchars="`" repeat=0 keyCode=50
Press: native_key: 0x32 (`) glfw_key: 0x60 mods: super char_count: 1 deadKeyState: 0 repeat: 0 
	TextInputCtx: doCommandBySelector: (noop:)
text: <none> glfw_key: ` marked_text: ()
on_key_input: glfw key: 0x60 native_code: 0x32 action: PRESS mods: super text: '' state: 0 updateIMEPosition: left=115.000000, top=68.000000, width=7.000000, height=15.000000
sent encoded key to child
----------------- key up --------------------
NSEvent: type=KeyUp loc=(575.594,1081.6) time=4724081.3 flags=0x100108 win=0x7f9209e3bb30 winNum=144427 ctxt=0x0 chars="`" unmodchars="`" repeat=0 keyCode=50
Release: native_key: 0x32 (`) glfw_key: 0x60 mods: super 
on_key_input: glfw key: 0x60 native_code: 0x32 action: RELEASE mods: super text: '' state: 0 updateIMEPosition: left=115.000000, top=68.000000, width=7.000000, height=15.000000
ignoring as keyboard mode does not support encoding this event
-------------- flags changed -----------------
NSEvent: type=FlagsChanged loc=(575.594,1081.6) time=4724081.6 flags=0x100 win=0x7f9209e3bb30 winNum=144427 ctxt=0x0 keyCode=55
flagsChanged: modifier: super native_key: 0x37 (<noname>) glfw_key: 0xe064 mods: none 
on_key_input: glfw key: 0xe064 native_code: 0x37 action: RELEASE mods: none text: '' state: 0 updateIMEPosition: left=115.000000, top=68.000000, width=7.000000, height=15.000000
ignoring as keyboard mode does not support encoding this event

@mattpolzin
Copy link
Sponsor Author

Finally (regarding prior suggested troubleshooting), here's the output of the defaults read on my laptop where switching is not working:

mattpolzin: ~ $ defaults read com.apple.symbolichotkeys
{
    AppleSymbolicHotKeys =     {
        15 =         {
            enabled = 0;
        };
        16 =         {
            enabled = 0;
        };
        164 =         {
            enabled = 1;
            value =             {
                parameters =                 (
                    262144,
                    4294705151
                );
                type = modifier;
            };
        };
        17 =         {
            enabled = 0;
        };
        18 =         {
            enabled = 0;
        };
        19 =         {
            enabled = 0;
        };
        20 =         {
            enabled = 0;
        };
        21 =         {
            enabled = 0;
        };
        22 =         {
            enabled = 0;
        };
        23 =         {
            enabled = 0;
        };
        24 =         {
            enabled = 0;
        };
        25 =         {
            enabled = 0;
        };
        26 =         {
            enabled = 0;
        };
        79 =         {
            enabled = 1;
        };
        80 =         {
            enabled = 1;
        };
        81 =         {
            enabled = 1;
        };
        82 =         {
            enabled = 1;
        };
    };
}

@mattpolzin
Copy link
Sponsor Author

Whoa! So, the output of that defaults read was really different on my other laptop. On a whim, I went into my system preferences and I unchecked and then re-checked the box next to "Move focus to next window" and that fixed the problem!

Thanks so much for the help looking into this!

@page-down
Copy link
Contributor

Thank you for the debugging information.

So the the values were all non-existent, right?

The only way I could fix this would be to use the default values when they don't exist.
Unless there is another way to read the unconfigured default values.

@mattpolzin
Copy link
Sponsor Author

At the end of this all, it seems to me there was some kind of bug in Mac OS (since simply toggling a preference back and forth fixed it).

So, doesn't seem like Kitty needs to address the problem directly, but I suppose even a warning message on startup (or via a flag of some kind like --check-system-defaults) that the defaults values look broken could help.

Again, I don't see this as a problem Kitty needs to fix. This comment thread was instrumental in me being able to fix it for myself, though.

@kujohn
Copy link

kujohn commented Feb 10, 2022

I followed @mattpolzin suggestion of disable/enabling and it works now, thank you!

@kovidgoyal
Copy link
Owner

@page-down: Perhaps we need to keep a default set of shortcuts, and use
that if the definition for a particular action is missing from the
plist. I assume that toggling the preference causes the shortcut to be
written to the plist with "disabled", so when the shortcut is missing
altogether from the plist, we assume it has a default value and is
enabled?

@page-down
Copy link
Contributor

page-down commented Feb 10, 2022

@kovidgoyal

Perhaps we need to keep a default set of shortcuts ...

This seems to be the only way to go for now, but Apple is likely to change things in future versions.
(And I don't know about the defaults in previous macOS version.)

... when the shortcut is missing altogether from the plist,
we assume it has a default value and is enabled? ...

If it does not exist (the entire plist not exist or the individual id not exist),
then the default state from the current system will be used.
However, only some shortcuts are enabled by default.

(Toggling any of these will save all (default) configured shortcuts with value, whether enabled or disabled.)

@page-down
Copy link
Contributor

page-down commented Feb 10, 2022

Maybe it should be used with CopySymbolicHotKeys.

See Hammerspoon static int hotkey_systemAssigned(lua_State* L)
https://github.com/Hammerspoon/hammerspoon/blob/0.9.93/extensions/hotkey/libhotkey.m#L210

{
    kHISymbolicHotKeyCode = 50;
    kHISymbolicHotKeyEnabled = 1;
    kHISymbolicHotKeyModifiers = 131072;
},
...

@kovidgoyal
Copy link
Owner

kovidgoyal commented Feb 10, 2022 via email

@page-down
Copy link
Contributor

... does that return the effective settings or just the result of reading the plist ...

This function returns the hotkeys that are currently in effect.
That's what I get when I delete plist and the global_shortcuts is empty in kitty.

@kovidgoyal
Copy link
Owner

Then it seems like the right API to use.

@kovidgoyal
Copy link
Owner

I looked into this a little and I'm afraid its not really
workable. Problems:

  1. The array returned contains only the key code, modifiers and
    enabled for every entry. For many enabled shortcuts the keycode is 0xffff, so this is
    not a valid key. There is even an enabled entry with keycode 0xffff and
    modifiers 0, no clue what that is. Similarly there are entries with key
    code 0, which again it is not clear how to interpret.

  2. There is no way to map these keys to actions, so we dont know which
    key events are useful and which are not.

  3. This is a deprecated Carbon API. This is not a big deal, but makes it
    less worthwhile to invest effort into it.

So I think its actually better to just track which actions are not
present in the plist file and assume they have the default values. I
doubt Apple changes default global shortcuts very often it would be very
disruptive.

I have attached the result of calling that function onmy system:

(
{
kHISymbolicHotKeyCode = 53;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 48;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 256;
},
{
kHISymbolicHotKeyCode = 48;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 768;
},
{
kHISymbolicHotKeyCode = 1;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 4352;
},
{
kHISymbolicHotKeyCode = 53;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 2816;
},
{
kHISymbolicHotKeyCode = 120;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 99;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 118;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 96;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 97;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 122;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 98;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 12;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 6912;
},
{
kHISymbolicHotKeyCode = 28;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 67;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 24;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 69;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 27;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 78;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 28;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6400;
},
{
kHISymbolicHotKeyCode = 67;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6400;
},
{
kHISymbolicHotKeyCode = 42;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 50;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 47;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6400;
},
{
kHISymbolicHotKeyCode = 43;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6400;
},
{
kHISymbolicHotKeyCode = 50;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 256;
},
{
kHISymbolicHotKeyCode = 20;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 768;
},
{
kHISymbolicHotKeyCode = 20;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 4864;
},
{
kHISymbolicHotKeyCode = 21;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 768;
},
{
kHISymbolicHotKeyCode = 21;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 4864;
},
{
kHISymbolicHotKeyCode = 126;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 125;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 126;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135680;
},
{
kHISymbolicHotKeyCode = 125;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135680;
},
{
kHISymbolicHotKeyCode = 103;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 103;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131584;
},
{
kHISymbolicHotKeyCode = 49;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 4352;
},
{
kHISymbolicHotKeyCode = 50;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 2;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 107;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 113;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 107;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133120;
},
{
kHISymbolicHotKeyCode = 113;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133120;
},
{
kHISymbolicHotKeyCode = 100;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 53;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 2048;
},
{
kHISymbolicHotKeyCode = 96;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131328;
},
{
kHISymbolicHotKeyCode = 49;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 49;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 111;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 111;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131584;
},
{
kHISymbolicHotKeyCode = 49;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 256;
},
{
kHISymbolicHotKeyCode = 49;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 2304;
},
{
kHISymbolicHotKeyCode = 2;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 4352;
},
{
kHISymbolicHotKeyCode = 53;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 256;
},
{
kHISymbolicHotKeyCode = 100;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 100;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 131584;
},
{
kHISymbolicHotKeyCode = 98;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 98;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 131584;
},
{
kHISymbolicHotKeyCode = 123;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 123;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135680;
},
{
kHISymbolicHotKeyCode = 124;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 124;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135680;
},
{
kHISymbolicHotKeyCode = 0;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 0;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4608;
},
{
kHISymbolicHotKeyCode = 0;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 0;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4608;
},
{
kHISymbolicHotKeyCode = 104;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 102;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 114;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 44;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 768;
},
{
kHISymbolicHotKeyCode = 122;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131328;
},
{
kHISymbolicHotKeyCode = 129;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 129;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133120;
},
{
kHISymbolicHotKeyCode = 130;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 130;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133120;
},
{
kHISymbolicHotKeyCode = 144;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 144;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133120;
},
{
kHISymbolicHotKeyCode = 145;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 145;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133120;
},
{
kHISymbolicHotKeyCode = 160;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 160;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133120;
},
{
kHISymbolicHotKeyCode = 160;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131328;
},
{
kHISymbolicHotKeyCode = 160;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133376;
},
{
kHISymbolicHotKeyCode = 160;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131840;
},
{
kHISymbolicHotKeyCode = 160;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131584;
},
{
kHISymbolicHotKeyCode = 130;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131584;
},
{
kHISymbolicHotKeyCode = 160;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 160;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 137216;
},
{
kHISymbolicHotKeyCode = 160;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135680;
},
{
kHISymbolicHotKeyCode = 18;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 19;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 20;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 21;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 23;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 22;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 26;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 28;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 25;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 29;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 18;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 19;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 20;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 21;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 23;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 22;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 83;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 84;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 85;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 86;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 87;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 88;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 89;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 91;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 92;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 82;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4096;
},
{
kHISymbolicHotKeyCode = 83;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 84;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 85;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 86;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 87;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 88;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 6144;
},
{
kHISymbolicHotKeyCode = 145;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131328;
},
{
kHISymbolicHotKeyCode = 144;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131328;
},
{
kHISymbolicHotKeyCode = 144;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133632;
},
{
kHISymbolicHotKeyCode = 145;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133632;
},
{
kHISymbolicHotKeyCode = 107;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133632;
},
{
kHISymbolicHotKeyCode = 113;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133632;
},
{
kHISymbolicHotKeyCode = 49;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 4608;
},
{
kHISymbolicHotKeyCode = 3;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 768;
},
{
kHISymbolicHotKeyCode = 101;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 109;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 65535;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 65535;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 512;
},
{
kHISymbolicHotKeyCode = 96;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133376;
},
{
kHISymbolicHotKeyCode = 65535;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 65535;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 113;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 107;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 144;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 145;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 113;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 137728;
},
{
kHISymbolicHotKeyCode = 107;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 137728;
},
{
kHISymbolicHotKeyCode = 144;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 137728;
},
{
kHISymbolicHotKeyCode = 145;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 137728;
},
{
kHISymbolicHotKeyCode = 131;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 131;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131584;
},
{
kHISymbolicHotKeyCode = 65535;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 65535;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 53;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 2048;
},
{
kHISymbolicHotKeyCode = 127;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 65535;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 65535;
kHISymbolicHotKeyEnabled = 0;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 22;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 768;
},
{
kHISymbolicHotKeyCode = 22;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 4864;
},
{
kHISymbolicHotKeyCode = 23;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 768;
},
{
kHISymbolicHotKeyCode = 23;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 4864;
},
{
kHISymbolicHotKeyCode = 176;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 177;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 179;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 178;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 12;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 65535;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 0;
},
{
kHISymbolicHotKeyCode = 123;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 124;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 125;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 126;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 4;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 3;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 125;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 123;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 124;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 135168;
},
{
kHISymbolicHotKeyCode = 50;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 50;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131584;
},
{
kHISymbolicHotKeyCode = 42;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 42;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133120;
},
{
kHISymbolicHotKeyCode = 123;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133120;
},
{
kHISymbolicHotKeyCode = 124;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 133120;
},
{
kHISymbolicHotKeyCode = 42;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131328;
},
{
kHISymbolicHotKeyCode = 42;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131840;
},
{
kHISymbolicHotKeyCode = 1;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 0;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 8;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 45;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 46;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131072;
},
{
kHISymbolicHotKeyCode = 0;
kHISymbolicHotKeyEnabled = 1;
kHISymbolicHotKeyModifiers = 131584;
}
)

@page-down
Copy link
Contributor

page-down commented Feb 10, 2022

Ok. Then just take care of the important ones that are on by default when they don't exist (don't care the ones with shortcuts but disabled by default), that's good enough.

@kovidgoyal
Copy link
Owner

I have committed a framework for this, I would appreciate it if some mac
user could fill in the contents of the
default_global_character_shortcut() and default_global_vk_shortcut()
functions

@page-down
Copy link
Contributor

Thanks. I haven't had time to deal with this yet, but I looked at the commit.

If the user removes cmd+backtick, will it be considered an enabled shortcut by default?

I'd like to handle it this way, giving default shortcut codes for important actions that are enabled by default, when the action is not in the plist or is enabled but has no value. Add it directly to the global shortcut, since that is the effective shortcut.

@kovidgoyal
Copy link
Owner

The way it works is that if a key appears in the plist either dibled or
enabled, then the hardcoded defaults are not checked. Only if the key
does not appear in the plist is the hardcoded list checked. This is
necessary because otherwise a user that say disables move focusto next
window (cmd+`) in the system preferences will still not be able to use
the key in kitty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants