aboutsummaryrefslogtreecommitdiffstats
path: root/keyboard_layout.lua
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard_layout.lua')
-rw-r--r--keyboard_layout.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/keyboard_layout.lua b/keyboard_layout.lua
index 34404b7..9e6e1aa 100644
--- a/keyboard_layout.lua
+++ b/keyboard_layout.lua
@@ -25,6 +25,14 @@ keyboard_usb_watcher = hs.usb.watcher.new(function(event)
return
end
+ local product_name_contains_word_keyboard = string.find(
+ string.lower(event['productName']),
+ "keyboard"
+ )
+ if not product_name_contains_word_keyboard then
+ return
+ end
+
if event['eventType'] == 'added' then
hs.keycodes.setLayout('U.S.')
elseif event['eventType'] == 'removed' then