Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Alt+space shortcut on Windows can't be intercepted

Alt+space shortcut on Windows can't be intercepted

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JamieKenyon
    wrote on last edited by
    #1

    I'm trying to intercept the system menu shortcut on Windows (alt and space).

    It appears as though Qt eats it without ever passing it to the application?!

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      I don't think it's Qt that eats it. It might be the OS.
      In any case, if non-portable solution isn't a problem you can dig to it using native event handler:
      @
      #include <windows.h>

      bool MyWidget::nativeEvent(const QByteArray&, void* message, long*) {
      MSG* msg = (MSG*)message;
      if(msg->message == WM_SYSKEYDOWN) {
      // msg->wParam is the key code
      }
      return false;
      }
      @

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JamieKenyon
        wrote on last edited by
        #3

        I can see in QKeyMapperPrivate::translateKeyEvent() that the event is being sent.

        Maybe it is the OS eating it. I'll try your suggestion :-)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved