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

hotkey binding on ctrl 1-2 doesn't work #305

Closed
tombruijn opened this issue May 30, 2015 · 3 comments
Closed

hotkey binding on ctrl 1-2 doesn't work #305

tombruijn opened this issue May 30, 2015 · 3 comments

Comments

@tombruijn
Copy link
Contributor

I'm having some problems binding hotkeys to certain combinations.

Hotkeys using ctrl + # combinations work only for 3 and up. ctrl + 1 and ctrl + 2 do not respond. Numbered hotkeys do work with alt and cmd.

Any idea why? Can it be something on my machine or is it known behavior?

A test case that creates hotkeys for all ctrl, alt and cmd options using the top row keyboard keys and numbers:

mods = {"ctrl", "alt", "cmd"}
for _, mod in ipairs(mods) do
  symbols = {"§", "-", "="}
  for _, symbol in ipairs(symbols) do
    hs.hotkey.bind({mod}, symbol, function()
      hs.alert.show(mod .. " + " .. symbol)
    end)
  end

  -- Numbers
  for i = 0, 9 do
    hs.hotkey.bind({mod}, tostring(i), function()
      hs.alert.show(mod .. " + " .. tostring(i))
    end)
  end
end

Technical details:

OSX 10.10.3
Hammerspoon version 0.9.31
config, only the above example

@oskarols
Copy link
Contributor

I'm able to reproduce this, but only with ctrl+1.

Not sure what's causing it though.

@asmagill
Copy link
Member

Check System Preferences -> Keyboard -> Shortcuts and look under the Mission Control shortcuts...

I haven't tried your code myself yet, but Ctrl-# is the default for jumping to a specific screen, which caught my eye.

There is at least one other case that I know of where a system keyboard shortcut can't be overridden by Hammerspoon but I've not yet found a way to detect these at the time of binding.

On May 30, 2015, at 7:14 PM, Oskar Olsson notifications@github.com wrote:

I'm able to reproduce this, but only with ctrl+1.

Not sure what's causing it though.


Reply to this email directly or view it on GitHub #305 (comment).

@tombruijn
Copy link
Contributor Author

Aha! That was it. I didn't have the keyboard shortcut checkbox "Switch to Desktop 1" enabled, but just because it was set to it hammerspoon didn't want to respond to it. I now have set it to ctrl alt cmd shift 1/2 so it won't conflict. I can't seem to map "nothing" to it.

Thanks for the help!

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

No branches or pull requests

3 participants