Skip to content

Instantly share code, notes, and snippets.

@oren
Created March 28, 2010 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oren/347060 to your computer and use it in GitHub Desktop.
Save oren/347060 to your computer and use it in GitHub Desktop.
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