diff options
author | Teddy Wing | 2023-01-31 20:52:03 +0100 |
---|---|---|
committer | Teddy Wing | 2023-01-31 20:52:03 +0100 |
commit | 8f600b057c85f63bf0dabe9287f58a1f130e45ee (patch) | |
tree | 67cdf970204535add0d6a665390817584282dc5d /keyboard_layout.lua | |
parent | 2e2cbb6296d2022d588a21fdefe3900015d17ea1 (diff) | |
download | dothammerspoon-8f600b057c85f63bf0dabe9287f58a1f130e45ee.tar.bz2 |
keyboard_layout: Add Keychron check
Add a check for another keyboard I'm using to have it switch keyboard
layouts on connection and disconnection.
Diffstat (limited to 'keyboard_layout.lua')
-rw-r--r-- | keyboard_layout.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/keyboard_layout.lua b/keyboard_layout.lua index 26a38af..8a62be3 100644 --- a/keyboard_layout.lua +++ b/keyboard_layout.lua @@ -23,6 +23,12 @@ local function is_imate(event) and event['productID'] == 1029 end +local function is_keychron(event) + return event['productName'] == 'Keychron C2' + and event['vendorID'] == 1452 + and event['productID'] == 591 +end + local function is_generic_keyboard(event) local product_name_contains_word_keyboard = string.find( string.lower(event['productName']), @@ -34,6 +40,7 @@ end keyboard_usb_watcher = hs.usb.watcher.new(function(event) if not is_imate(event) + and not is_keychron(event) and not is_generic_keyboard(event) then return |