AutoHotkey Community

It is currently May 26th, 2012, 3:50 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: April 8th, 2009, 3:41 am 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
Hi,

I wrote the little script today:

Code:
LButton::SendInput {LButton down}
LButton UP::SendInput {LButton up}
~LButton & RButton::SendInput {MButton down}
~LButton & RButton UP::SendInput {MButton up}   


and was disappointed to see that it did not perform as I had expected. The first key is interpreted as a modifier, like control or alt. Modifier keys are held down prior to the action key and typically released after, as well.

Is it possible to define a hotkey that behaves like a chord? That is, all the keys of the chord are pressed in unison.

I used to have this functionality enabled via a mouse driver setting, but have a new mouse which does not support this configuration.

please help!
~cheek


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 8th, 2009, 10:49 am 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
Maybe something like this will point you in the right direction?

Code:
#SingleInstance Force

return

LButton::
RButton::
   BothAreDown := GetKeyState( "LButton" , "P" ) and GetKeyState( "RButton" , "P" )
   if( BothAreDown ) {
      SoundPlay *64
      SendInput {MButton}
   }
   else
      SendInput {%A_ThisHotkey% Down}
return

LButton Up::
RButton Up::
   if( !BothAreDown )
      SendInput {%A_ThisHotkey%}
   BothAreDown := false
return

ESC::ExitApp

_________________
Sector-Seven - Freeware tools built with AutoHotkey


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: BrandonHotkey, Exabot [Bot], notsoobvious and 20 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