Ich hab aber eine Möglichkeit über Keyboard hooks gefunden, mit der bei einem Klick auf LCTRL die Taste solange gedrückt gehalten wird, bis sie erneut gedrückt wird.
Funktionsweise: 250ms nachdem LCTRL losgelassen wird, wird LCTRL gedrückt gehalten, bis LCTRL erneut (gedrückt und) losgelassen wird. Wird die 162 in Zeile 19 durch eine 163 ersetzt, löst die rechte CTRL Taste das gedrückt halten aus.
C
#include <WinAPI.au3>
#include <WindowsConstants.au3>
Global $bCtrlIsPressed=false
$hmod = _WinAPI_GetModuleHandle(0)
$hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
$hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod)
While sleep(100)
WEnd
Func keyDown($keycode)
;ConsoleWrite("KEYCODE: "&$KeyCode&" pressed"&@crlf)
EndFunc
Func keyUp($keycode)
;ConsoleWrite("KEYCODE: "&$KeyCode&" released"&@crlf)
If $keycode=162 Then
If NOT $bCtrlIsPressed Then AdlibRegister("_press",250)
$bCtrlIsPressed=NOT $bCtrlIsPressed
EndIf
EndFunc
Func _press()
AdlibUnRegister("_press")
Send("{LCTRL down}")
EndFunc
Func _KeyProc($nCode, $wParam, $lParam)
Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
Local $r=DllStructGetData($tKEYHOOKS, "vkCode")
If DllStructGetData($tKEYHOOKS,"flags")=$LLKHF_ALTDOWN Then $r="E"&DllStructGetData($tKEYHOOKS, "flags")
If $wParam = $WM_KEYDOWN Then keyDown($r)
If $wParam = $WM_KEYUP Then keyUp($r)
Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
EndFunc ;==>_KeyProc
Alles anzeigen
Ich hoffe, dass erfüllt jetzt deine Bedinungen ![]()
MfG Kanashius.