// Look up a keycode by name constcode = hs.keycodes.map["a"] // e.g. 0 on ANSI US // Look up a name by keycode constname = hs.keycodes.map["0"] // e.g. "a"
Switching layouts
hs.keycodes.setLayout("British")
Watching for input source changes
hs.keycodes.addWatcher(() => { console.log("Switched to: " + hs.keycodes.currentLayout()) })
Access information about the current keyboard layout and input sources, and respond to changes.
Reading the current layout
Key code mapping
Switching layouts
Watching for input source changes