AutoHotkey Community

It is currently May 26th, 2012, 8:34 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: BlockInput Alt Key
PostPosted: August 22nd, 2009, 2:55 pm 
Offline

Joined: August 8th, 2009, 10:10 pm
Posts: 17
I want to switch off blockinput with a key, but blockinput blocks any keys (except ctrl+alt+del)...

I found this on AHK Help
Quote:
Input blocking is automatically and momentarily disabled whenever an ALT event is sent (then re-enabled afterward).


I tried to press ALT but it doesn't work.

I tried some ALT Hotkey too...

I made this script in order to test alt key.
If Alt+b is pressed, var is set to 1. It waits 5 sec, then show results.

Code:
var = 0

BlockInput, On

Sleep, 5000

BlockInput, off
Msgbox, %var%

ExitApp

!b::var = 1


Alt+b hotkey doesn't work if blockinput is on...

How to do?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2009, 5:45 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
AutoHotkey Help wrote:
Certain types of hook hotkeys can still be triggered when BlockInput is on. Examples include "MButton" (mouse hook) and "LWin & Space" (keyboard hook with explicit prefix rather than modifiers "$#").

So try:
Code:
var = 0

BlockInput, On

Sleep, 5000

BlockInput, off
Msgbox, %var%

ExitApp

LAlt & b::
var := 1
Return

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2009, 8:11 pm 
Offline

Joined: August 8th, 2009, 10:10 pm
Posts: 17
Thanks :)

I think should be specified on help file :wink:


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, joetazz, Mickers, tidbit, tomoe_uehara and 55 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