Created
March 28, 2010 21:39
-
-
Save oren/347060 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bind_hotkey | |
if !@mnemonic.nil? | |
ch = @mnemonic.downcase()[0] ## FIXME 1.9 | |
puts("test") | |
# meta key | |
mch = ?\M-a + (ch - ?a) | |
if @label_for.is_a? RubyCurses::Button and @label_for.respond_to? :fire | |
@form.bind_key(mch, @label_for) { |_form, _butt| _butt.fire } | |
else | |
$log.debug " bind_hotkey label for: #{@label_for}" | |
@form.bind_key(mch, @label_for) { |_form, _field| _field.focus } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment