AutoHotkey Community

It is currently May 24th, 2012, 3:31 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Two Key Hotkey
PostPosted: January 31st, 2007, 3:30 am 
Offline

Joined: November 16th, 2006, 3:40 pm
Posts: 10
Hi I'm trying to get a hotkey so that when it is pressed once it sends one thing, but when I press it again just after the first press, it sends me something else. So, for example, when I press 'd' I get z, but if I press d again (so 'dd') the z is replaced with x.

So I though of something like:

Code:
D::
If bDAlreadyPressed
{
   Send {BACKSPACE}
   Send x
   bDshiftAlreadyPressed :=false
   return
}
else   
   Send z
   bDShiftAlreadyPressed :=true
return


This obviously doesn't work since pressing dd will indeed give me x, but pressing dfd, would give me dx. I was thinking about a timer, but that won't really get around the problem either, and hotstrings cannot work either because of some problematic limitations.

Anyone have any guidance?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 31st, 2007, 4:41 am 
Offline

Joined: November 26th, 2005, 10:35 pm
Posts: 196
If I understand you correctly, what you want would be something like this:

Code:
d::
{
If DPressed = 1
     {
     Send x
     DPressed = 0
     }
Else
     {
     Send z
     DPressed = 1
     }
}


That will make an output like this when I hold the d key: zxzxzxzxzxzxzxzxzxzxzxzxzxzxzxzxzxzxzxzxzxzxzxzx

_________________
http://thedbdclan.com/public/pingrep


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: CodeKiller, engunneer, fogus, janopn, Pulover, RaptorX, tomL and 29 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