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. Keyboard state help
QtWS25 Last Chance

Keyboard state help

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 2.0k Views
  • 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
    Jeronimo
    wrote on last edited by Jeronimo
    #1

    i put the follow code

    BYTE keyboard_state[256];
    GetKeyboardState(keyboard_state);
    UpdateKeyState(keyboard_state, VK_SHIFT);
    UpdateKeyState(keyboard_state, VK_CAPITAL);
    UpdateKeyState(keyboard_state, VK_CONTROL);
    UpdateKeyState(keyboard_state, VK_MENU);
    try to change the key info
    

    //try to convert the key info

    int result = ToUnicodeEx(cKey.vkCode, cKey.scanCode, keyboard_state, buffer,4,0, keyboard_layout);
    

    show me this code obviously because i am not capturing this event.
    "\u0004"....

    To capture event:

    if( wParam == WM_SYSKEYDOWN ){
               switch (wParam)
                           {
                               case VK_SHIFT:
    
                                   qDebug() << "prueba";
    
                                   break;
    
                               default:
                                   break;
                           }
           }
    

    But my problem is when i try to capture my events like ctrl, shif, etc it's for one keyboard virtual. it seems dont work so any idea is good sorry for all and bye! niceday! I can capture normal keys but in my keyboard i need these events..

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      The reason you are not getting any replies is that we have no way of knowing what you are doing.
      You need to show how you setup the hook and rest of the function with

      if( wParam == WM_SYSKEYDOWN ){
      switch (wParam)

      so please stop making new posts with same issue as it won't help :)

      https://forum.qt.io/topic/72179/using-virtual-key-s-with-windows
      https://forum.qt.io/topic/72151/help-with-virtual-keyboard

      Im assuming you are trying something like
      http://stackoverflow.com/questions/22975916/global-keyboard-hook-with-wh-keyboard-ll-and-keybd-event-windows

      Qt has support for virtual keyboards but I assume you want one that also work for non Qt apps?

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

        @mrjj said in Keyboard state help:
        Yes i was trying with hook of windows to show these events. This i was trying. But not seems to work. I tried too that but i can't capture these events. Sorry for other posts but i wanted to finish my virtual keyboard sorry a lot.

        1 Reply Last reply
        0
        • mrjjM mrjj

          Hi
          The reason you are not getting any replies is that we have no way of knowing what you are doing.
          You need to show how you setup the hook and rest of the function with

          if( wParam == WM_SYSKEYDOWN ){
          switch (wParam)

          so please stop making new posts with same issue as it won't help :)

          https://forum.qt.io/topic/72179/using-virtual-key-s-with-windows
          https://forum.qt.io/topic/72151/help-with-virtual-keyboard

          Im assuming you are trying something like
          http://stackoverflow.com/questions/22975916/global-keyboard-hook-with-wh-keyboard-ll-and-keybd-event-windows

          Qt has support for virtual keyboards but I assume you want one that also work for non Qt apps?

          J Offline
          J Offline
          Jeronimo
          wrote on last edited by
          #4

          @mrjj will be something like this
          https://www.youtube.com/watch?v=yIsQHinTw00
          But for windows

          mrjjM 1 Reply Last reply
          1
          • J Jeronimo

            @mrjj will be something like this
            https://www.youtube.com/watch?v=yIsQHinTw00
            But for windows

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Jeronimo
            Ok, seems nice. If for your own Qt application,
            http://doc.qt.io/qt-5/qinputmethod.html#details
            can be used to integrate a virtual keyboard.

            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