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
    869
    Thanks
    70
    Thanked 59 Times in 57 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,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 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
    869
    Thanks
    70
    Thanked 59 Times in 57 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.