Results 1 to 4 of 4

Thread: KeyEvent propagation to Desktop

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    866
    Thanks
    69
    Thanked 58 Times in 56 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default KeyEvent propagation to Desktop

    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,
    Òscar Llarch i Galán

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: KeyEvent propagation to Desktop

    Quote Originally Posted by ^NyAw^ View Post
    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.

  3. #3
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: KeyEvent propagation to Desktop

    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...
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  4. #4
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    866
    Thanks
    69
    Thanked 58 Times in 56 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: KeyEvent propagation to Desktop

    Hi,

    Thanks, will try it.
    Òscar Llarch i Galán

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.