Build Your Own Arcade Controls Forum

Main => Software Forum => Topic started by: mh12 on January 08, 2010, 07:42:39 pm

Title: Autohotkey ..blocking input with exception
Post by: mh12 on January 08, 2010, 07:42:39 pm
can't find a solution to this anywhere online. since a lot of you are good with Autohotkey, and it's for a cab, I thought I would ask here.

I'm launching a viewer application from my gamelist. Got this working fine, and exiting with my controls pressing Esc. However, some of my buttons are mapped to commands that screw things up in the application. I'd like to block all input except for exiting the program with Esc. Using BlockInput doesn't seem to allow exceptions. Any ideas?
Title: Re: Autohotkey ..blocking input with exception
Post by: headkaze on January 09, 2010, 05:11:17 am
What do you mean by "viewer application"?
Title: Re: Autohotkey ..blocking input with exception
Post by: mh12 on January 09, 2010, 12:16:58 pm
What do you mean by "viewer application"?

TV (launching movies is probably more common around here... it's basically the same thing). i made a AHK script to launch the proprietary app, make it fullscreen, and force it to close on Esc (a shifted key on my panel). there are a couple of buttons on my panel that will mess it up.. but for how often i watch TV, it's not worth the trouble of remapping buttons in winipac and all my emus. I'm surprised there's no simple way to make an exception to BlockInput. Maybe end BlockInput on Esc is possible? then hit it again to exit? Yesterday was the first time i used AHK.
Title: Re: Autohotkey ..blocking input with exception
Post by: brian_hoffman on January 09, 2010, 02:47:41 pm
Well, you say you only have a couple keys that affect the application, lets say keys A,D,L,K all affect the application. In ahk simly do this
A::
D::
L::
K::


That will re-map those inputs to nothing.
Title: Re: Autohotkey ..blocking input with exception
Post by: mh12 on January 09, 2010, 03:27:09 pm
thanks! didn't know that could be done
Title: Re: Autohotkey ..blocking input with exception
Post by: brian_hoffman on January 09, 2010, 04:19:19 pm
thanks! didn't know that could be done

You can also take it a step further and do this (it will remap keys to other keys)
A::T
B::S

and this (which will run a series of events)

A::
Run, notepad.exe
Sleep 3000
SendInput, Hello
ExitApp


Lets us know if you get it sorted.
Title: Re: Autohotkey ..blocking input with exception
Post by: mh12 on January 09, 2010, 05:25:08 pm
All good now, thank you!
I'd already remapped keys to do certain functions, but I didn't realize you could nullify certain keypresses, which is another way of doing exactly what I needed. Great program.