fn - A function that will be called when the input source changes.Sets the function to be called when your input source (i.e. Not all layouts/methods have icons, so you should assume this will return nil at some pointĮxtensions/keycodes/libkeycodes.m line 566.An hs.image object, or nil if no image could be found.sourceName - A string containing the name of an input method or keyboard layout.Gets an hs.image object for a given keyboard layout or input method Hs.keycodes.iconForLayoutOrMethod(sourceName) -> hs.image object If no parameter is provided, returns a string containing the source id for the current keyboard layout or input method if a parameter is provided, returns true or false specifying whether or not the input source was able to be changed.Įxtensions/keycodes/libkeycodes.m line 334.sourceID - an optional string specifying the input source to set for keyboard input.Get or set the source id for the keyboard input source Hs.keycodes.currentSourceID() -> string | boolean An hs.image object containing the icon, if availableĮxtensions/keycodes/libkeycodes.m line 387Įxtensions/keycodes/libkeycodes.m line 472.Gets the icon of the current keyboard layout Hs.keycodes.currentLayoutIcon() -> hs.image object A string containing the name of the current keyboard layoutĮxtensions/keycodes/libkeycodes.m line 370.Gets the name of the current keyboard layout shift, rightshift, cmd, rightcmd, alt, rightalt, ctrl, rightctrl,.home, pageup, forwarddelete, end, pagedown, left, right, down, up,.padclear, padenter, return, tab, space, delete, escape, help,.Valid strings are any single-character string, or any of the following strings:.This is primarily used by the hs.eventtap and hs.hotkey extensions.
![hammerspoon remap a key hammerspoon remap a key](https://www.techilife.com/wp-content/uploads/2020/04/Remap-Windows-Keyboard-For-MAc-300x173.png)
![hammerspoon remap a key hammerspoon remap a key](http://www.andreas-kleinert.de/Guter_Rat_is-_gratis/Tools/Key-Remap/KeyRemapStartimage2.gif)
Functions - API calls offered directly by the extensionĪPI Documentation Constants map SignatureĪ mapping from string representation of a key to its keycode, and vice versa.Constants - Useful values which cannot be changed.Also provides functionality for querying and changing keyboard layouts. Hammerspoon docs: hs.keycodes docs » hs.keycodesĬonvert between key-strings and key-codes.