Files
fizzy/app/helpers/hotkeys_helper.rb
Jason Zimdars 6bb1a7238c No need to special case shift
The symbol isn't doing it
2025-12-01 14:12:46 -06:00

15 lines
355 B
Ruby

module HotkeysHelper
# Pass in an array of chorded keys, e.g. ["ctrl", "shift", "J"]
def hotkey_label(hotkey)
hotkey.map do |key|
if key == "ctrl" && platform.mac?
""
elsif key == "enter"
platform.mac? ? "return" : "enter"
else
key
end.capitalize
end.join("+").gsub(/\+/, "")
end
end