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

Unable to use Cmd + Number on last HEAD #30

Closed
crisidev opened this issue Mar 28, 2018 · 3 comments
Closed

Unable to use Cmd + Number on last HEAD #30

crisidev opened this issue Mar 28, 2018 · 3 comments
Labels

Comments

@crisidev
Copy link

Hello,
part of my workflow is to switch desktop using Cmd+number. This triggers a qes emit keypress which actually triggers mission control and switches my desktop in a consistent way when using different monitors setups.

Latest HEAD (9096762) is not working anymore for me when I hit Cmd+number. If I go back to stable (0.0.10) it works again. All other key binding works normally.

Here is the debug info if I start skhd from my terminal (no errors). I think there is a regression somewhere :)

❯❯❯ ~ skhd
skhd: using config '/Users/matbigoi/.skhdrc'
hotkey :: #2 {
        mod: 'cmd'
        mod: 'alt'
        key: 'q' (0x0c)
        cmd: 'PATH=$HOME/.pyenv/versions/3.6.4/bin:$PATH $HOME/.bin/chunkwm-profile --stop'
}
hotkey :: #5 {
        mod: 'cmd'
        mod: 'alt'
        key: 's' (0x01)
        cmd: 'PATH=$HOME/.pyenv/versions/3.6.4/bin:$PATH $HOME/.bin/chunkwm-profile --start'
}
hotkey :: #8 {
        mod: 'cmd'
        mod: 'alt'
        key: 'r' (0x0f)
        cmd: 'bash $HOME/.chunkwmrc'
}
hotkey :: #11 {
        mod: 'ctrl'
        mod: 'shift'
        key: 'f12' (0x6f)
        cmd: 'm screensaver'
}
hotkey :: #14 {
        mod: 'ctrl'
        mod: 'shift'
        key: 'f11' (0x67)
        cmd: 'm sleep'
}
hotkey :: #17 {
        mod: 'hyper'
        key: 'b' (0x0b)
        cmd: 'chunkc tiling::desktop --layout bsp'
}
hotkey :: #20 {
        mod: 'hyper'
        key: 'm' (0x2e)
        cmd: 'chunkc tiling::desktop --layout monocle'
}
hotkey :: #23 {
        mod: 'hyper'
        key: 'n' (0x2d)
        cmd: 'chunkc tiling::desktop --layout float'
}
hotkey :: #26 {
        mod: 'hyper'
        key: 'r' (0x0f)
        cmd: 'chunkc tiling::desktop --rotate 90'
}
hotkey :: #29 {
        mod: 'hyper'
        key: 'p' (0x23)
        cmd: 'pass -c login'
}
hotkey :: #32 {
        mod: 'hyper'
        key: 'return' (0x24)
        cmd: 'osascript $HOME/.bin/iterm.scpt'
}
hotkey :: #35 {
        mod: 'hyper'
        key: 'f11' (0x67)
        cmd: 'osascript $HOME/.bin/crisidev_irc.scpt'
}
hotkey :: #38 {
        mod: 'hyper'
        key: 'f12' (0x6f)
        cmd: 'osascript $HOME/.bin/other_irc.scpt'
}
hotkey :: #41 {
        mod: 'hyper'
        key: 'v' (0x09)
        cmd: 'open -a VimR'
}
hotkey :: #44 {
        mod: 'hyper'
        key: 'space' (0x31)
        cmd: 'osascript $HOME/.bin/finder.scpt'
}
hotkey :: #47 {
        mod: 'shift'
        mod: 'ctrl'
        key: 'l' (0x25)
        cmd: 'PATH=$HOME/.pyenv/versions/3.6.4/bin:$PATH $HOME/.bin/chunkwm-profile -p laptop'
}
hotkey :: #50 {
        mod: 'shift'
        mod: 'ctrl'
        key: 'm' (0x2e)
        cmd: 'PATH=$HOME/.pyenv/versions/3.6.4/bin:$PATH $HOME/.bin/chunkwm-profile -p 1monitor'
}
hotkey :: #53 {
        mod: 'shift'
        mod: 'ctrl'
        key: 'n' (0x2d)
        cmd: 'PATH=$HOME/.pyenv/versions/3.6.4/bin:$PATH $HOME/.bin/chunkwm-profile -p 2monitor'
}
hotkey :: #56 {
        mod: 'hyper'
        key: 'f' (0x03)
        cmd: 'chunkc tiling::window --toggle fullscreen'
}
hotkey :: #59 {
        mod: 'hyper'
        key: 'h' (0x04)
        cmd: 'chunkc tiling::window --toggle native-fullscreen'
}
hotkey :: #62 {
        mod: 'hyper'
        key: 'd' (0x02)
        cmd: 'chunkc tiling::window --toggle parent'
}
hotkey :: #65 {
        mod: 'hyper'
        key: 's' (0x01)
        cmd: 'chunkc tiling::window --toggle float'
}
hotkey :: #68 {
        mod: 'hyper'
        key: 'g' (0x05)
        cmd: 'chunkc tiling::window --toggle split'
}
hotkey :: #71 {
        mod: 'hyper'
        key: 'a' (0x00)
        cmd: 'chunkc tiling::desktop --equalize'
}
hotkey :: #74 {
        mod: 'hyper'
        key: 'b' (0x0b)
        cmd: 'chunkc tiling::window --focus biggest'
}
hotkey :: #77 {
        mod: 'ctrl'
        key: 'up' (0x7e)
        cmd: '$HOME/.bin/chunkwm-focus up'
}
hotkey :: #78 {
        mod: 'ctrl'
        key: 'down' (0x7d)
        cmd: '$HOME/.bin/chunkwm-focus down'
}
hotkey :: #79 {
        mod: 'ctrl'
        key: 'left' (0x7b)
        cmd: '$HOME/.bin/chunkwm-focus left'
}
hotkey :: #80 {
        mod: 'ctrl'
        key: 'right' (0x7c)
        cmd: '$HOME/.bin/chunkwm-focus right'
}
hotkey :: #83 {
        mod: 'cmd'
        mod: 'alt'
        key: 'left' (0x7b)
        cmd: 'chunkc tiling::window --use-temporary-ratio 0.05 --adjust-window-edge west; chunkc tiling::window --use-temporary-ratio -0.05 --adjust-window-edge east'
}
hotkey :: #84 {
        mod: 'cmd'
        mod: 'alt'
        key: 'up' (0x7e)
        cmd: 'chunkc tiling::window --use-temporary-ratio 0.05 --adjust-window-edge north; chunkc tiling::window --use-temporary-ratio -0.05 --adjust-window-edge south'
}
hotkey :: #85 {
        mod: 'cmd'
        mod: 'alt'
        key: 'down' (0x7d)
        cmd: 'chunkc tiling::window --use-temporary-ratio 0.05 --adjust-window-edge south; chunkc tiling::window --use-temporary-ratio -0.05 --adjust-window-edge north'
}
hotkey :: #86 {
        mod: 'cmd'
        mod: 'alt'
        key: 'right' (0x7c)
        cmd: 'chunkc tiling::window --use-temporary-ratio 0.05 --adjust-window-edge east; chunkc tiling::window --use-temporary-ratio -0.05 --adjust-window-edge west'
}
hotkey :: #89 {
        mod: 'cmd'
        key: 'f18' (0x4f)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f1"'
}
hotkey :: #90 {
        mod: 'cmd'
        key: 'f1' (0x7a)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f9"'
}
hotkey :: #91 {
        mod: 'cmd'
        key: 'f2' (0x78)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f2"'
}
hotkey :: #92 {
        mod: 'cmd'
        key: '1' (0x53)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f10"'
}
hotkey :: #93 {
        mod: 'cmd'
        key: '2' (0x54)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f3"'
}
hotkey :: #94 {
        mod: 'cmd'
        key: '3' (0x55)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f6"'
}
hotkey :: #95 {
        mod: 'cmd'
        key: '4' (0x56)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f4"'
}
hotkey :: #96 {
        mod: 'cmd'
        key: 'f4' (0x76)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f5"'
}
hotkey :: #97 {
        mod: 'cmd'
        key: 'f3' (0x63)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f11"'
}
hotkey :: #98 {
        mod: 'cmd'
        key: '5' (0x57)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f7"'
}
hotkey :: #99 {
        mod: 'cmd'
        key: 'f5' (0x60)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f8"'
}
hotkey :: #102 {
        mod: 'hyper'
        key: 'f18' (0x4f)
        cmd: 'chunkc tiling::window -d 1'
}
hotkey :: #103 {
        mod: 'hyper'
        key: 'f1' (0x7a)
        cmd: 'chunkc tiling::window -d 9'
}
hotkey :: #104 {
        mod: 'hyper'
        key: 'f2' (0x78)
        cmd: 'chunkc tiling::window -d 2'
}
hotkey :: #105 {
        mod: 'hyper'
        key: '1' (0x53)
        cmd: 'chunkc tiling::window -d 10'
}
hotkey :: #106 {
        mod: 'hyper'
        key: '2' (0x54)
        cmd: 'chunkc tiling::window -d 3'
}
hotkey :: #107 {
        mod: 'hyper'
        key: '3' (0x55)
        cmd: 'chunkc tiling::window -d 6'
}
hotkey :: #108 {
        mod: 'hyper'
        key: '4' (0x56)
        cmd: 'chunkc tiling::window -d 4'
}
hotkey :: #109 {
        mod: 'hyper'
        key: 'f4' (0x76)
        cmd: 'chunkc tiling::window -d 5'
}
hotkey :: #110 {
        mod: 'hyper'
        key: 'f3' (0x63)
        cmd: 'chunkc tiling::window -d 11'
}
hotkey :: #111 {
        mod: 'hyper'
        key: '5' (0x57)
        cmd: 'chunkc tiling::window -d 7'
}
hotkey :: #112 {
        mod: 'hyper'
        key: 'f5' (0x60)
        cmd: 'chunkc tiling::window -d 8'
}
hotload: watching file '.skhdrc' in directory '/Users/matbigoi'

The non working bindings are:

hotkey :: #92 {
        mod: 'cmd'
        key: '1' (0x53)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f10"'
}
hotkey :: #93 {
        mod: 'cmd'
        key: '2' (0x54)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f3"'
}
hotkey :: #94 {
        mod: 'cmd'
        key: '3' (0x55)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f6"'
}
hotkey :: #95 {
        mod: 'cmd'
        key: '4' (0x56)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f4"'
}
hotkey :: #98 {
        mod: 'cmd'
        key: '5' (0x57)
        cmd: '$HOME/.bin/qes -k "cmd + ctrl + alt - f7"'
}
@koekeishiya
Copy link
Owner

So when I changed the keycode cache to prevent the bug mentioned in #28, I forgot that some keys have the same literal (e.g: the number-row and numpad), and so what is happening in your case is that the number literals are translated into the numpad equivalent keycode instead of the number-row.

You can work around this by using they keycodes until I figure out the best way to deal with this.

@crisidev
Copy link
Author

Ok, gotcha. Thanks! If you need me to test anything, I'll be happy to help.

@koekeishiya
Copy link
Owner

koekeishiya commented Mar 30, 2018

I just fixed this the "easy" way, by not allowing an existing entry to be overridden, so numpad will now essentially be ignored from the literal cache. The numpad keys must now be referenced using the keycode, and the number-row will be mapped from actual number literals.

Essentially the same behavior as before, when we used CFDictionary for caching.

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

2 participants