![]()
Or for more advanced users, using the Homebrew command-line tool by running the below command in the terminal of your choice (e.g. #Best use of hammerspoon downloadYou can download it from the Karabiner Elements website and follow the installation instruction, It is a free application with an easy setup for changes in the functionality of your keys. If you want to remap some of your keys, the easiest way to do that is to use the Karabiner Elements application. As a result, you will be not stretching your hands but confidently pressing only two keys on your keyboard. #Best use of hammerspoon how toAnd you are right! Such a combination makes my shortcuts unique, and now I will show you how to remap not so often used keys to this tricky combination. You can think that it is a lot of keys to be pressed at once. I defined my shortcuts using HYPER + selected letter. ![]() The right global shortcut has to be unique to not overlap with any shortcuts in your system or IDE. Later in the post, I will call this combination a Hyper Key. In my case, it will be the combination of 4 other control keys pressed at once: CMD (⌘) + SHIFT (⇧) + OPTION (⌥) + CTRL(˄). In my particular case, CAPSLOCK (⇪) is the least used key - I can remap it to a combination of keys, which would be more useful for me! When I need to type capital letters, I hold the SHIFT (⇧) key most of the time. There's a few features in there now that I am not covering in this post, but we'll get to them later in this series.Easy way to remap keys - Karabiner Elementsĭid you ever wonder what key do you use the least often? I figured out it was a CAPSLOCK (⇪) key. Maybe instead of the cron I could use Hammerspoon. It's possible it's gone through new versions since this post. There is probably a much better way to get notifications from this file, but that was quick and easy. If you want to read a at the time of this blog post, it's available on my GitHub. #Best use of hammerspoon seriesNo more discovering that weird app behavior is due to a double-bound keybinding.Īs this series continues, I'll list the examples of how I connect a to other automations here. All my keybindings are declared in one place, and I know they will never conflict with any new applications that I download. I use a as the "entry point" for nearly all my Hammerspoon based automation. My most common use of a is to launch an application, so I have a table of applications that I can define a "hyper key" for, and optionally some local bindings that I bind inside that application to use globally. hyper : bind (, 'r', nil, function () hs. Press `HYPER+r`, get the Hammerspoon console. By the way, you can learn Lua by reading others. Because your "hyper key" is not a cluster of modifier keys, you can actually use it in conjunction with any normal modifiers. Hammerspoon is a powerful tool allowing you to have powerful effects on your system by writing Lua scripts. One big advantage to using Hammerspoon as a "man-in-the-middle" is using modifiers with your hyper key. Brett Terpstra first wrote about this in "A Useful Caps Lock Key" in 2012. In this as in all things, I am not the first. ![]() ![]() Instead of having every single application listening to all the keystrokes, I can control it one place. I use a single often-unused key (in my case, F19) to trigger a hs.hotkey.modal in Hammerspoon. In my case, Hammerspoon becomes a single "router" to all the automation and UI customization on my Mac. Using a single keycode as your "hyper" key, and handling the translation at the automation layer is much more expressive. Because of this a lot of hyper key setups are limited to "leader key" style interactions. Using the "hyper chord" as the entire "hyper key", you can't add any more modifiers, because it is already all the modifiers. ![]() While it works well, it has its limitations. You can absolutely do this in Hammerspoon if you want. #Best use of hammerspoon softwareThe user would then use some kind of automation software like Alfred or Keyboard Maestro to listen for the "hyper chord" and fire different automations. Traditionally, a Hyper key is implemented by sending to the Operating System "hyper chord" of ⌘⌥⇧⌃ by modifying the keyboard firmware or using Karabiner-elements.app. #Best use of hammerspoon codeThe code isn't that complex so this post will be focused on the advantages of this approach. I'm using hs.hotkey.modal to capture an F19 keystroke, and only sending the "hyper chord" of ⌘⌥⇧⌃ if absolutely required. At the moment, my hyper implementation is contained in a lua module called a, with some dependencies on Karabiner-Elements.app. I talked in the last post about my history with the concept, how I learned from Steve Losh's post on the topic and borrowed from Brett Terpstra… and I've expanded the idea a bit. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |