Re: [gtkmm] Getting key events?



pks timing com writes:
 > Drinkin Park writes:
 >  >
 >  > How does one receive the keys that are being pressed/released from a 
 >  > GdkEventKey that is the parameter of an function called by a callback?
 >
 > bool
 > SomeClass::OnKeyPress(GdkEventKey *evt)
 > {
 > ...
 > }

I poorly named this method.

Given that it checks the GdkEventKey for both key press and release, it
would likely handle both Gtk::Widget::signal_key_press_event() and
signal_key_release_event(). I should have called it OnKeyPressOrRelease().

I always hit that send button too soon ;)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]