[ruby-gnome2-doc-cvs] [Hiki] update - tips_key_pressed

アーカイブの一覧に戻る

ruby-****@sourc***** ruby-****@sourc*****
2004年 4月 5日 (月) 10:38:41 JST


-------------------------
REMOTE_ADDR = 200.216.146.191
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/en/?tips_key_pressed
-------------------------
+ {{link nil, "Ruby-GNOME2+Tips", nil, nil}}
+ 
  = Investigate what key is pressed
  Run this script and press key what you investigate. You can get key value and that Gdk::Keyval constant easily.
  
   require 'gtk2'
   Gtk.init
   
   window = Gtk::Window.new
   window.add_events(Gdk::Event::KEY_PRESS)
   window.add(Gtk::Label.new("Press Key!"))
   
   window.signal_connect("key-press-event") do |w, e|
     p "#{e.keyval}, Gdk::Keyval::GDK_#{Gdk::Keyval.to_name(e.keyval)}"
   end
   
   window.set_default_size(100, 100).show_all
   
   Gtk.main
  
  P.S.
  
  Please notice this script can get the key value on your own environment only.
  Some key values have different values on each environments.
  
  == ChangeLog
  :2003-10-12 ((<Masao>))
   Initial Release





ruby-gnome2-cvs メーリングリストの案内
アーカイブの一覧に戻る