about summary refs log tree commit diff stats
path: root/keychord.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-30 15:36:53 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-30 15:36:53 -0700
commit3b4dacaee81ec55a1dccdb50584d45ca5bbe00ec (patch)
treef2ad712b7918c018840763620eff862dbf2dcad1 /keychord.lua
parentfd5a47f8bf513f4fbb97087a7f2fb90721c12b55 (diff)
downloadlines.love-3b4dacaee81ec55a1dccdb50584d45ca5bbe00ec.tar.gz
regression: typing uppercase letters in text
Diffstat (limited to 'keychord.lua')
-rw-r--r--keychord.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/keychord.lua b/keychord.lua
index 0ec4143..4cdee2b 100644
--- a/keychord.lua
+++ b/keychord.lua
@@ -12,17 +12,16 @@ end
 
 function App.combine_modifiers(key)
   local result = ''
-  local down = love.keyboard.isDown
-  if down('lctrl') or down('rctrl') then
+  if App.ctrl_down() then
     result = result..'C-'
   end
-  if down('lalt') or down('ralt') then
+  if App.alt_down() then
     result = result..'M-'
   end
-  if down('lshift') or down('rshift') then
+  if App.shift_down() then
     result = result..'S-'  -- don't try to use this with letters/digits
   end
-  if down('lgui') or down('rgui') then
+  if App.cmd_down() then
     result = result..'s-'
   end
   result = result..key
@@ -30,7 +29,7 @@ function App.combine_modifiers(key)
 end
 
 function App.modifier_down()
-  return array.any(Modifiers, love.keyboard.isDown)
+  return App.ctrl_down() or App.alt_down() or App.shift_down() or App.cmd_down()
 end
 
 function App.ctrl_down()
@@ -45,7 +44,7 @@ function App.shift_down()
   return love.keyboard.isDown('lshift') or love.keyboard.isDown('rshift')
 end
 
-function App.gui_down()
+function App.cmd_down()
   return love.keyboard.isDown('lgui') or love.keyboard.isDown('rgui')
 end