AutoHotkey Community

It is currently May 26th, 2012, 11:15 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: November 14th, 2009, 7:52 pm 
Offline

Joined: November 12th, 2009, 9:37 pm
Posts: 8
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2009, 8:00 pm 
Post your script so we can see what the problem is


Report this post
Top
  
Reply with quote  
PostPosted: November 14th, 2009, 11:30 pm 
Offline

Joined: November 12th, 2009, 9:37 pm
Posts: 8
Problem solved. I added #InstallKeybdHook directive

Code:
GetKeyState, state, Control
    if state = D
        Send {Control Down}
    else
        Send {Control Up}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2009, 11:30 pm 
Offline

Joined: November 12th, 2009, 9:37 pm
Posts: 8
I meant :

Code:
#InstallKeybdHook
GetKeyState, state, Control
    if state = D
        Send {Control Down}
    else
        Send {Control Up}


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Cerberus, Google [Bot], joetazz, JSLover, Maestr0, rbrtryn, Tipsy3000 and 67 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group