RE: Capture all key press events
- From: Paul Davis <paul linuxaudiosystems com>
- To: Sirisha Muppavarapu <sirisha muppavarapu veralight com>
- Cc: gtkmm-list gnome org
- Subject: RE: Capture all key press events
- Date: Wed, 21 Feb 2007 22:09:56 -0500
On Wed, 2007-02-21 at 15:31 -0700, Sirisha Muppavarapu wrote:
>
> I fixed the problem myself. Solution(for newbies out there):
>
> signal_key_press_event().connect(sigc::mem_fun(*this,&MyClass::key_pressed),false);
>
> Having false at the end says that default handler should handle all
> the events key_pressed event didn't handle.
> Process the events captured in key_pressed method as required and
> return a true or false.
> Returning true from key_pressed method says key_pressed method handled
> processing of the event.
> Returning false says key_pressed method didn't handle the event,
> default handler should handle the event.
btw, its slightly more efficient to define
bool on_key_press_event (GdkKeyEvent*);
in your derived class.
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]