[fxruby-users] Problem detecting keypresses in FXTable

Will Parsons wbparsons at cshore.com
Fri Apr 9 16:59:14 EDT 2010


I'm using an RXTable in my application and I would like to be able to
select a row and then press the Delete key to delete the selected row.
This does not seem to work, however, as apparently keypresses are not
initially recognized.  In my FXTable derived class I have:

   connect(SEL_KEYRELEASE) do |sender, selector, event|
      puts "code = #{'%X' % event.code}"
      case event.code
         when KEY_Delete, KEY_KP_Delete
            puts "Delete key hit"
            # process...
         # ...
      end
   end

When I left-click on a row header, the row gets properly selected and
highlighted, but hitting any key does not result in being recognized
(i.e., the messages above do not appear).  If I then click on a table
cell, then subsequent keypresses cause the connected code to fire, and
things work as expected.  Do I have to do something to receive key
events initially?

-- 
Will


More information about the fxruby-users mailing list