From a11ac2c8978135669c5c1e66026758902078b513 Mon Sep 17 00:00:00 2001 From: Mitsutaka Mimura Date: Fri, 17 Sep 2021 00:24:51 +0900 Subject: [PATCH] support aliase in define_mode_key --- src/ruby/lib/keyboard.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ruby/lib/keyboard.rb b/src/ruby/lib/keyboard.rb index 57aace8e..61ca06d2 100644 --- a/src/ruby/lib/keyboard.rb +++ b/src/ruby/lib/keyboard.rb @@ -546,11 +546,12 @@ def define_mode_key(key_name, param) on_release_action = case on_release.class when Symbol # @type var on_release: Symbol - keycode_index = KEYCODE.index(on_release) + key = KC_ALIASES[on_release] ? KC_ALIASES[on_release] : on_release + keycode_index = KEYCODE.index(key) if keycode_index keycode_index * -1 - elsif KEYCODE_SFT[on_release] - (KEYCODE_SFT[on_release] + 0x100) * -1 + elsif KEYCODE_SFT[key] + (KEYCODE_SFT[key] + 0x100) * -1 end when Array # @type var on_release: Array[Symbol]