On Monday 02 January 2006 10:41, David Faure wrote:
> On Monday 02 January 2006 10:39, Stefan Kombrink wrote:
> > Hi everybody,
> >
> > I'd like my application to catch global key press events. I could do it
> > using pure X11 but I don't think that's the very clean way.
> > Maybe there's a possibiliy to do it in KDE?
> > Just point me to the proper class, then!

>
> KGlobalAccel, then


Thanks for answering so quickly.
However, I want to trace any keypress events, not a certain global accelerator
sequence.
I tried something like this:

Syndock::Syndock()
{
....
....
....
m_toggle_pad = new KGlobalAccel( this );
m_toggle_pad->insert( "Toggle Pad Accel", i18n( "Toggle Pad" ),
i18n( "switch the touch pad on and off temporarily" ),
KKeySequence( i18n( "ALT+CTRL+P" ) ), 0,
this, SLOT( toggleEnableDisable() )
);

m_toggle_pad->updateConnections();

m_toggle_pad->installEventFilter( this );
....
....
....
}

and providing a

bool SynDock::eventFilter( QObject*, QEvent* )
{
kdDebug() << "eventFilter" << endl;
return false;
}


I understood that incoming events of the m_toggle_pad object should call
SynDock::eventFilter, then.
Unfortunately it doesn't seem to work that way...

Am I supposed to solve that problem in an other way?

greets,
Stefan K. >8^)

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<