AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

'Custom Hotkeys' as correct 'chord' behavior?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
cheek



Joined: 01 Apr 2009
Posts: 2

PostPosted: Wed Apr 08, 2009 2:41 am    Post subject: 'Custom Hotkeys' as correct 'chord' behavior? Reply with quote

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
Back to top
View user's profile Send private message
Icarus



Joined: 24 Nov 2005
Posts: 824

PostPosted: Wed Apr 08, 2009 9:49 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group