flat assembler
Message board for the users of flat assembler.
Index
> Windows > SendInput won't release certain keys? |
Author |
|
randomdude 25 Nov 2013, 16:15
is it possible to release VK_CONTROL using SendInput? :S i tried everything with no success
another question, is it possible to disable a key from reaching any application except the one im using? in AutoHotkey i can use for example F1 for a macro and when pressing F1, the F1 key wont be detected by any other program. it seems to use BlockInput api but no idea how can i use it...
|
|||||||||||
25 Nov 2013, 16:15 |
|
baldr 26 Nov 2013, 10:25
|
|||
26 Nov 2013, 10:25 |
|
randomdude 26 Nov 2013, 12:15
great, thx!
Code: proc start stdcall RegisterHotKeys .msg_loop: invoke GetMessage,Msg,0,0,0 test eax,eax jz .end cmp dword[Msg.message],WM_HOTKEY jne .msg_loop stdcall CheckHotkey,dword[Msg.wParam] cmp byte[ExitApp],1 jne .msg_loop .end: stdcall UnregisterHotKeys ;invoke MessageBox,0,teststr,testcap,MB_OK invoke ExitProcess,0 endp now i just have the annoying problem of SendInput not releasing VK_CONTROL, does anyone have any idea of why? :/ |
|||
26 Nov 2013, 12:15 |
|
randomdude 27 Nov 2013, 12:43
edit:
jesus... finally i found out the issue... Code: INPUT INPUT_KEYBOARD,<VK_?,0,KEYEVENTF_KEYUP,0,0> every value was being send as a dword, so the dwFlags was always 0 now.. any idea on how can specify the value size in macro? |
|||
27 Nov 2013, 12:43 |
|
baldr 27 Nov 2013, 17:27
randomdude,
Swap mi and ki members of anonymous union inside INPUT structure. It's only a palliative solution, if you need both keyboard and mouse events, use something like INPUT INPUT_KEYBOARD,<VK_CONTROL+0 shl 16,KEYEVENTF_KEYUP,0,0> (i.e. use MOUSEINPUT template for initializer and pack wVk and wScan into doubleword manually). As a side note, invoke SendInput,4,keyboard_ctrl_v,sizeof.INPUT doesn't correspond with number of members in keyboard_ctrl_v array. |
|||
27 Nov 2013, 17:27 |
|
randomdude 06 Dec 2013, 13:44
for now i just removed the wScan parameter that im not using. thanks anyway for the suggestions, baldr
yeah, i forgot to remove the four VK_RETURN inputs from the example |
|||
06 Dec 2013, 13:44 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.