Jump to content

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

Hello need help with hold and release for toggle a key


  • Please log in to reply
2 replies to this topic
Zivo
  • Members
  • 14 posts
  • Last active: May 29 2019 12:08 AM
  • Joined: 15 Nov 2013

hello this is my first time writing here

i am using Autohotkey for only a few days and i have a lot of ideas i cant write

 

try to help me with this

 

the ideal:

i am usually write in my language and need words in English during the writing

instead of using Alt+Shift to change to English write one word do Alt+Shift again to go back to Hebrew i would like to have a key like capslock to change my language once when the key is down and once when the key release, that way i could write in Hebrew hold capslock and write in English release capslock and write back in Hebrew, the catch is that i want a single quick press to change the language once not twice as it does when holding.

 

i want to set a minimum time for holding

if i hold for more than 200ms than when i release do X

if i hold for less than 200ms than when i release do nothing

 

 

the goal: a key (Capslock) with dual Behavior

 

1. quick single press =
Capslock::Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}

 

2. when hold the key for as much as i want and release it =
Capslock::Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}
Capslock UP::Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}

 

baiscaly the idea is:

when pressing the key make X

when pressing and holding the key make X (one time not repeating)

and when releasing the key make X again

 

Thanks



Zivo
  • Members
  • 14 posts
  • Last active: May 29 2019 12:08 AM
  • Joined: 15 Nov 2013

ok as i wrote this Q i understand what i need to do

 

$Capslock::Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}
$Capslock UP::
if(A_PriorHotKey = "$Capslock" AND A_TimeSincePriorHotkey > 500)
{
 Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}
}
else
Return

 

any other ideas ?



Zivo
  • Members
  • 14 posts
  • Last active: May 29 2019 12:08 AM
  • Joined: 15 Nov 2013

OK

 

Now i want to improve it more

Now i would like to make all of the above and add a double key strok to actually toggle Capslock on and off

 

the Key is Capslock

single Key strok - change language

Holding - change language for the holding time until release

double key stroke - toggle Capslock on and off

 

Thank you