-
-
Save xvrdm/cb7ca9fe68eb568c90aceca22aa228e3 to your computer and use it in GitHub Desktop.
Hammerspoon - switch Mac Input Source / keyboard layout on Kinesis Advantage connect / disconnect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usbWatcher = nil | |
function usbDeviceCallback(data) | |
if (data["productName"] == "Kinesis Keyboard Hub") then | |
if (data["eventType"] == "added") then | |
hs.keycodes.setLayout("U.S. International - PC") | |
elseif (data["eventType"] == "removed") then | |
hs.keycodes.setLayout("Swiss French") | |
end | |
end | |
end | |
usbWatcher = hs.usb.watcher.new(usbDeviceCallback) | |
usbWatcher:start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment