AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Control Down/Up detection when code finishes executing

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ictium



Joined: 12 Nov 2009
Posts: 8

PostPosted: Sat Nov 14, 2009 6:52 pm    Post subject: Control Down/Up detection when code finishes executing Reply with quote

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
View user's profile Send private message
Guest






PostPosted: Sat Nov 14, 2009 7:00 pm    Post subject: Reply with quote

Post your script so we can see what the problem is
Back to top
ictium



Joined: 12 Nov 2009
Posts: 8

PostPosted: Sat Nov 14, 2009 10:30 pm    Post subject: Control Down/Up detection when code finishes executing Reply with quote

Problem solved. I added #InstallKeybdHook directive

Code:
GetKeyState, state, Control
    if state = D
        Send {Control Down}
    else
        Send {Control Up}
Back to top
View user's profile Send private message
ictium



Joined: 12 Nov 2009
Posts: 8

PostPosted: Sat Nov 14, 2009 10:30 pm    Post subject: Reply with quote

I meant :

Code:
#InstallKeybdHook
GetKeyState, state, Control
    if state = D
        Send {Control Down}
    else
        Send {Control Up}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group