Don't use exception for branching

pull/31/head
Takashi Kokubun 6 years ago
parent 8aefb73a5f
commit c7a69cadcd

@ -38,10 +38,10 @@ module Xremap
end
def to_keysym(keyexp)
begin
X11.const_get("XK_#{keyexp}")
rescue NameError # Allow non "XK_" expressions
if keyexp.start_with?('XF86XK_')
X11.const_get(keyexp)
else
X11.const_get("XK_#{keyexp}")
end
end
end

Loading…
Cancel
Save