ruby-****@sourc*****
ruby-****@sourc*****
2004年 7月 29日 (木) 11:15:58 JST
------------------------- REMOTE_ADDR = 15.211.169.100 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp//?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