新規作成  編集  Ruby-GNOME2 Project Website  ページ一覧  検索  更新履歴  編集履歴  RSS  ログイン

Gtk::Accelerator

Module Functions

Gtk::Accelerator.valid(keyval, modifier)
Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator. For example, the Gdk::Keyval::GDK_a keyval plus Gdk::Window::CONTROL_MASK is valid - this is a "Ctrl+a" accelerator. But, you can't, for instance, use the Gdk::Keyval::GDK_Control_L keyval as an accelerator.
  • keyval : a GDK keyval(Gdk::Keyval constants)
  • modifiers : modifier mask(GdkModifierType)
  • Returns : true if the accelerator is valid
Gtk::Accelerator.parse(accelerator)
Parses a string representing an accelerator. The format looks like "<Control>a" or "<Shift><Alt>F1" or "<Release>z" (the last one is for key release). The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". If the parse fails, accelerator_key and accelerator_mods will be set to 0 (zero).
  • accelerator: string representing an accelerator
  • Returns: [key, mods]
    • key: return accelerator keyval
    • mods: return accelerator modifier mask(GdkModifierType)
Gtk::Accelerator.to_name(key, mods)
Converts an accelerator keyval and modifier mask into a string parseable by Gtk::Accelerator.parse. For example, if you pass in Gdk::Keyval::GDK_q and Gdk::Keyval::GDK_CONTROL_MASK, this method returns "<Control>q".
  • keyval: accelerator keyval(Gdk::Keyval constants)
  • modifiers: accelerator modifier mask(GdkModifierType)
  • Returns: an accelerator name
Gtk::Accelerator.default_mod_mask
Gets the value set by Gtk::Accelerator.set_default_mod_mask.
Gtk::Accelerator.set_default_mod_mask(default_mod_mask)
Sets the modifiers that will be considered significant for keyboard accelerators. The default mod mask is Gdk::Window::CONTROL_MASK | Gdk::Window::SHIFT_MASK | Gdk:Window::MOD1_MASK, that is, Control, Shift, and Alt. Other modifiers will by default be ignored by Gtk:AccelGroup. You must include at least the three default modifiers in any value you pass to this method. The default mod mask should be changed on application startup, before using any accelerator groups.
  • default_mod_mask: accelerator modifier mask (GdkModifierType)
  • Returns: self
更新日時:2006/03/18 11:17:49
キーワード:
参照:[Gtk::AccelKey] [Gtk::Accelerator] [Gtk::ActionGroup] [Gtk::ItemFactory]