Skip to content

Commit

Permalink
support aliase in define_mode_key
Browse files Browse the repository at this point in the history
  • Loading branch information
takkanm committed Sep 16, 2021
1 parent 9973e5e commit a11ac2c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ruby/lib/keyboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit a11ac2c

Please sign in to comment.