Keyboard state help
-
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..
-
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 withif( 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-keyboardIm assuming you are trying something like
http://stackoverflow.com/questions/22975916/global-keyboard-hook-with-wh-keyboard-ll-and-keybd-event-windowsQt has support for virtual keyboards but I assume you want one that also work for non Qt apps?
-
@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. -
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 withif( 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-keyboardIm assuming you are trying something like
http://stackoverflow.com/questions/22975916/global-keyboard-hook-with-wh-keyboard-ll-and-keybd-event-windowsQt has support for virtual keyboards but I assume you want one that also work for non Qt apps?
-
@mrjj will be something like this
https://www.youtube.com/watch?v=yIsQHinTw00
But for windows@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.