From: Simon Strandgaard Date: 2005-01-07T02:28:20+09:00 Subject: Re: FXRuby: Reading keystates On Fri, 7 Jan 2005 01:26:29 +0900, Martin DeMello wrote: > How do I read the pressed state of the shift, ctrl etc keys from within > FXRuby? (And is the correct way to read a Ctrl-A to trap an OnKeypress > for A and check if Ctrl is pressed?) def onKeypress(sender, sel, event) p "keysym=#{event.code} state=#{event.state} text=#{event.text}" if (event.state & CONTROLMASK) != 0 if event.text == 'a' p "we got a" end end end elsewhere you must do widget.connect(SEL_KEYPRESS, method(:onKeypress)) (untested) -- Simon Strandgaard