Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Autohotkey ..blocking input with exception  (Read 2766 times)

0 Members and 1 Guest are viewing this topic.

mh12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 125
  • Last login:December 24, 2010, 10:03:57 am
Autohotkey ..blocking input with exception
« 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?

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Autohotkey ..blocking input with exception
« Reply #1 on: January 09, 2010, 05:11:17 am »
What do you mean by "viewer application"?

mh12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 125
  • Last login:December 24, 2010, 10:03:57 am
Re: Autohotkey ..blocking input with exception
« Reply #2 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.

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: Autohotkey ..blocking input with exception
« Reply #3 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.

mh12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 125
  • Last login:December 24, 2010, 10:03:57 am
Re: Autohotkey ..blocking input with exception
« Reply #4 on: January 09, 2010, 03:27:09 pm »
thanks! didn't know that could be done

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: Autohotkey ..blocking input with exception
« Reply #5 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.

mh12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 125
  • Last login:December 24, 2010, 10:03:57 am
Re: Autohotkey ..blocking input with exception
« Reply #6 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.