AutoHotkey Community

It is currently May 27th, 2012, 11:57 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: November 18th, 2005, 3:13 pm 
Offline

Joined: November 18th, 2005, 3:03 pm
Posts: 2
I write script:
---------------------------
Space & LButton:: ; hotkey #1
BlockInput, Mouse
send b
BlockInput, off
return

Space UP:: MouseClick, left, , , 2 ;hotkey #2
-------------------------
When i hold Space and Click .. hotkey #1 is working , all right.
and when i release Space , hotkey #2 do not work. !?

But when i press Space only, "Space UP" work.

I need:
Hold Space and click -> fire hotkey #1
release Space -> fire hotkey #2


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 18th, 2005, 4:35 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Ldir wrote:
I need:
Hold Space and click -> fire hotkey #1
release Space -> fire hotkey #2
This works:
Code:
Space & LButton::MsgBox, %A_ThisHotkey%

Space Up::MsgBox, %A_ThisHotkey%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2005, 4:44 pm 
Offline

Joined: November 18th, 2005, 3:03 pm
Posts: 2
not work.
i press Space , Click (hotkey #1 fire), release Space (Hotkey #2 not fire)

Windows 2000/SP4


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2005, 4:57 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Hmm it works for me (Win XP sp2).

Try #UseHook or #InstallKeybdHook.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2005, 7:25 pm 
Offline

Joined: September 25th, 2005, 4:31 pm
Posts: 610
I think this explains the problem:

manual wrote:
Numpad0 & Numpad1::MsgBox You pressed Numpad1 while holding down Numpad0.
Numpad0 & Numpad2::Run Notepad

In the above example, Numpad0 becomes a prefix key. Prefix keys can also be assigned their own actions such as in the next example, but their action will only be triggered when the key is released and only if you did not press any other keys while the key was begin held down:

Numpad0::WinMaximize A ; Maximize the active window.


Try this alternative method:

note: the first hotkey will be triggered when both Space and LButton are pressed, in any order.

Code:
Space::
   KeyWait, LButton, D T1
   
   if ( ! ErrorLevel )
      ToolTip, Space & LButton
return

Space up::
   ToolTip, Space up
return


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 27 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