{"action":"created","issue":{"url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/510","labels_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/510/labels{/name}","comments_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/510/comments","events_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/510/events","html_url":"https://github.com/Hammerspoon/hammerspoon/issues/510","id":102136757,"number":510,"title":"Binding action to caps lock key?","user":{"login":"lord","id":1976330,"avatar_url":"https://avatars.githubusercontent.com/u/1976330?v=3","gravatar_id":"","url":"https://api.github.com/users/lord","html_url":"https://github.com/lord","followers_url":"https://api.github.com/users/lord/followers","following_url":"https://api.github.com/users/lord/following{/other_user}","gists_url":"https://api.github.com/users/lord/gists{/gist_id}","starred_url":"https://api.github.com/users/lord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lord/subscriptions","organizations_url":"https://api.github.com/users/lord/orgs","repos_url":"https://api.github.com/users/lord/repos","events_url":"https://api.github.com/users/lord/events{/privacy}","received_events_url":"https://api.github.com/users/lord/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-20T13:17:50Z","updated_at":"2015-08-20T15:21:42Z","closed_at":"2015-08-20T15:11:45Z","body":"Is it possible to bind a function to a caps lock key press? (It'd be cool to not have to install an entire different program to just rebind caps lock) Doesn't look like there's a `capslock`...I've also tried created an `eventtap` to listen for caps lock key presses, but they don't seem to appear for modifier keys. I guess I could poll the new `checkKeyboardModifiers` but that seems pretty sub-optimal and it also means the caps lock key would continue to operate normally.\r\n\r\n(Also, thanks for creating this project, it's pretty incredible!)"},"comment":{"url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/comments/133047676","html_url":"https://github.com/Hammerspoon/hammerspoon/issues/510#issuecomment-133047676","issue_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/510","id":133047676,"user":{"login":"cmsj","id":353427,"avatar_url":"https://avatars.githubusercontent.com/u/353427?v=3","gravatar_id":"","url":"https://api.github.com/users/cmsj","html_url":"https://github.com/cmsj","followers_url":"https://api.github.com/users/cmsj/followers","following_url":"https://api.github.com/users/cmsj/following{/other_user}","gists_url":"https://api.github.com/users/cmsj/gists{/gist_id}","starred_url":"https://api.github.com/users/cmsj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmsj/subscriptions","organizations_url":"https://api.github.com/users/cmsj/orgs","repos_url":"https://api.github.com/users/cmsj/repos","events_url":"https://api.github.com/users/cmsj/events{/privacy}","received_events_url":"https://api.github.com/users/cmsj/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T15:21:42Z","updated_at":"2015-08-20T15:21:42Z","body":"@lord FWIW, my setup has Karabiner turn CapsLock into ```KeyCode::COMMAND_R, ModifierFlag::OPTION_R | ModifierFlag::SHIFT_R | ModifierFlag::CONTROL_R | ModifierFlag::NONE```\r\n\r\nI then do ```local hyper = {\"⌘\", \"⌥\", \"⌃\", \"⇧\"}``` in my ```~/.hammerspoon/init.lua``` and map all my hotkeys with that.\r\n\r\nAlmost all :)\r\n\r\nI have a few which use Karabiner to combine my fake Hyper key with the ```_L``` variants of the keyboard modifiers, allowing me to do things like shift-hyper/cmd-hyper. These don't work as hotkeys in Hammerspoon because there's no way to propagate up the \"both cmd keys are being held\" information, instead they are dispatched as URLs to ```hs.urlevent```. It's a bit weird, but very cool.\r\n\r\nThere are some details of how to make the URL events work, at http://www.hammerspoon.org/go/#karabinerurl"}}