From: Ned Konz Date: 2001-10-18T06:33:50+09:00 Subject: [ruby-talk:22691] Re: Gtk::Text connect_signal key_press_event eat keystroke? On Wednesday 17 October 2001 02:07 pm, Phlip wrote: > Rubies: > > In Gtk I want to handle a keystroke, and then remove it from the food > chain. > > I call this from the initialize of a class derived from Gtk::Text: > > signal_connect ('key_press_event') { |w, e| > e.keyval = 0 if e.string == "\t" > } > > That should, for example, disable the Tab key for my hapless user. > > But e.keyval has no e.keyval= version, so the above does not execute. > > How do I censor a keystroke? What about signal_emit_stop() or emit_stop_by_name() ? -- Ned Konz currently: Stanwood, WA email: ned@bike-nomad.com homepage: http://bike-nomad.com