Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

control key getting stuck after script runs


  • Please log in to reply
3 replies to this topic
cynflux
  • Members
  • 59 posts
  • Last active: Nov 02 2015 05:34 PM
  • Joined: 01 Jul 2014

Control key getting stuck after AutoHotKey scripts run.

The ahk file has many embedded scripts.

It causes havoc when i am trying to select a file or menu item.

Do i need to add a Send, {CTRLUP} to the end of every embedded script or there a global script that only needs to be entered on 1 line?

In the interim, i have Send, {CTRLUP} at the first and line of the ahk file. Not sure if this will help or make things worse.

Thank you in advance for your help.

 

 



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

Seeing your code will be important. There might be something you can do with this:

SetTimer, ctrlup, 1000
 
ctrlup:
KeyWait, ctrl, L T1 ; wait 1 second
If ErrorLevel ; If the script DOES time out, that means that ctrl was held down for about a second
   Send {Ctrl up}
return

Of course, edit that time based on the purpose of your script, if it's a viable option.



cynflux
  • Members
  • 59 posts
  • Last active: Nov 02 2015 05:34 PM
  • Joined: 01 Jul 2014

Thanks for the quick response.

I have several hundred lines of code that consist of the following types of scripts:

 

TEXT REPLACEMENTS

TIME-BASED FUNCTIONS

KEYBOARD SHORTCUTS

PROGRAM SHORTCUTS

FOLDER FUNCTIONS

STRING REPLACE

REGEX FUNCTIONS

SOUND CONTROLS

WINDOW SPECIFIC

 

In which location, do you recommend that I place your code in the ahk file?

Thank you in advance.



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

SetTimer, ctrlup, 1000

 

That should go at the very top, in the auto-execute section. This way the timer is started whenever the script is started.

 

The label and its contents can go right after your auto-execute section, or thrown at the bottom of the script, or between any hotkeys.