Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

"Re-Enable" a key

$
0
0

Hi guys,

I have searched arond but i don't have found any solution

 

I want to lock three keys, F1-F2-F3 for a external application, i have do this:

AutoIt         
#include <WinAPI.au3> HotKeySet("{ESC}", "Terminate") Global $pStub_KeyProc = DllCallbackRegister("_KeyProc", "int", "int;ptr;ptr") Global $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($pStub_KeyProc), _WinAPI_GetModuleHandle(0), 0) While 1     Sleep(100) WEnd Func _KeyProc($nCode, $wParam, $lParam)     If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)     Local $KBDLLHOOKSTRUCT = DllStructCreate("dword vkCode;dword scanCode;dword flags;dword time;ptr dwExtraInfo", $lParam)     Local $vkCode = DllStructGetData($KBDLLHOOKSTRUCT, "vkCode")     If $vkCode = 0x70 Then Return 1     If $vkCode = 0x71 Then Return 1     If $vkCode = 0x72 Then Return 1      _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc Func Terminate()     DllCallbackFree($pStub_KeyProc)     _WinAPI_UnhookWindowsHookEx($hHook) EndFunc

But if i want to reactivate one of those key ( example F1 ) but always stop the F2-F3...how i can do it?

 

Thanks


Viewing all articles
Browse latest Browse all 12506

Trending Articles