Wednesday, October 30, 2019

Autohotkey - toggle keys

I want to achieve this



  1. press "a" > output "a"

  2. press "a" again > output "b"

  3. press "a" again > output "a"

  4. press "a" again > output "b"

  5. keep repeating these...


Below script does what I want, but with little issue.
When I press and hold "a", it output "abababab"......
But I need it to act like keep outputing the current character until I release the key and activate the toggling.


i.e. press and hold "a" > output "aaaaaaaa"... > release "a" > stop outputing and toggle to "b"


Anyone know how can I achieve that? Thanks in advance!


Toggle:=0
$a::
Toggle:=!Toggle
if(Toggle=1) {
send, a
} else {
send, b
}
return

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...