Jump to content

Script detect key interactions while not focused?


Recommended Posts

Is it possible to have a script that can take keyboard input while I have another program on top focused? For example... A game that is in window mode but is focused and actively being used, then when you press certain keys the script sees it and performs functions based on the keys it detected that it has functions for. ?

I have not messed with hotkeying and things yet, so I need to know any examples in as simple methodology as possible if you can show me a quick demo script on how that is done.

Thanks guys, you really know your stuff here!

Edited by Morthawt
Link to comment
Share on other sites

I am not talking about automating games.. I am talking about having something open and focused but that the script can continue getting input and perform options. I sometimes play games so thats what came to my mind first, simple to press a button and have it load ventrilo and connect to a server for example, or open up a notepad.exe so you can type something really fast. I already have built in macro's made in the game, I dont need an external program to automate a game that has a macro feature built right in.

Edited by Morthawt
Link to comment
Share on other sites

So open the helpfile and look at HotKeySet() then. What was the thread about again? :unsure:

Basically I want to make a nice script that sits in the background waiting for a certain key combo or individual key so that I can use it to load up other programs without having to go to the lengths of using the start menu. So I could be looking at a website, watching a video, playing a game etc etc and I push "chosen button" and wham.. ventrilo loads or notepad loads or something else I use all the time.

Will the hotkeyset function always work even in the background? Or do you have to have focus on a GUI in the script to work?

Link to comment
Share on other sites

Will the hotkeyset function always work even in the background?

Yes, that's what a hotkey does. If you don't want to intercept the keypress, just see if it's pressed, see _IsPressed()

Or do you have to have focus on a GUI in the script to work?

That's GUISetAccelerators().
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...