PDA

View Full Version : KeyEvent propagation to Desktop



^NyAw^
27th November 2007, 10:20
Hi,

Is there a way to make a QAction to emit a KeyEvent that the Desktop(Windows or X) will catch it?

I want to use a Multiple Desktop software that can be configured to change the desktop by a key combination and I want to send this key combination by a QAction. I want this behavior because I use a touch screen without any mouse or keyboard.

Thanks,

wysota
27th November 2007, 10:26
Is there a way to make a QAction to emit a KeyEvent that the Desktop(Windows or X) will catch it?
No, at least not using Qt.

If you are running KDE, you might switch the desktop from within your application by using dcop.

mchara
27th November 2007, 12:19
hi,
Under windows you can use PostMessage() from winApi to desktop window(QDesktopWidget::winId()) with WM_KEYUP/WM_KEYDOWN messages.

It's a bit OS hacking, but it's only possible way i know...

^NyAw^
27th November 2007, 12:38
Hi,

Thanks, will try it.