| View previous topic :: View next topic |
| Author |
Message |
ictium
Joined: 12 Nov 2009 Posts: 8
|
Posted: Sat Nov 14, 2009 6:52 pm Post subject: Control Down/Up detection when code finishes executing |
|
|
Hi All,
I wrote an autoreplace AHK code that triggers when I use a shortcut involving the Ctrl key.
If I keep the Ctrl key hold down until the end of the execution of the code, I cannot use it combined with an arrow key (let's say right arrow) to move in the text (forward from one word to another in this case). The computer does not detect that the Ctrl key is still pressed. (I need to release the key, and once released I can use Ctrl+right arrow to move.)
I want the computer to detect whether or not the Ctrl key is pressed.
I tried solutions built on "GetKeyState", but I did not manage to make them work.
Please help. Thanks a lot.
Cris |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Nov 14, 2009 7:00 pm Post subject: |
|
|
| Post your script so we can see what the problem is |
|
| Back to top |
|
 |
ictium
Joined: 12 Nov 2009 Posts: 8
|
Posted: Sat Nov 14, 2009 10:30 pm Post subject: Control Down/Up detection when code finishes executing |
|
|
Problem solved. I added #InstallKeybdHook directive
| Code: | GetKeyState, state, Control
if state = D
Send {Control Down}
else
Send {Control Up} |
|
|
| Back to top |
|
 |
ictium
Joined: 12 Nov 2009 Posts: 8
|
Posted: Sat Nov 14, 2009 10:30 pm Post subject: |
|
|
I meant :
| Code: | #InstallKeybdHook
GetKeyState, state, Control
if state = D
Send {Control Down}
else
Send {Control Up} |
|
|
| Back to top |
|
 |
|