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

Zurück zum Archiv-Index

ruby-****@sourc***** ruby-****@sourc*****
2003年 10月 12日 (日) 22:11:21 JST


-------------------------
REMOTE_ADDR = 218.231.205.39
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/?tips_key_pressed
-------------------------
  = Investigate what key is pressed
- Run this sample and press key what you investigate.
+ 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.
+ Some key values have different values on each environment.
  
  == ChangeLog
  :2003-10-12 ((<Masao>))
   Initial Release





ruby-gnome2-cvs メーリングリストの案内
Zurück zum Archiv-Index