Sign in to follow this  
Followers 0
Neimo

poll the keyboard or inputBox without buttons?

3 posts in this topic

#1 ·  Posted (edited)

Just like it's possible to get a pixel's color, I want to check what keys are being pressed, or a specific key. Ideally it would be a modifier key like Shift so that Windows won't do anything with the input before or after the polling.

So far I've got a MsgBox that will do what I want if the user selects OK. After 2 seconds the box times out and the default action happens instead. What I really want is no waiting at all. If the user is holding down a key, do "A", otherwise, do "B" which is the default. Similar to how most of the time people want their CDs or DVDs to Autorun, but occasionally when they don't, they hold down the Shift key. That's what I want. Is it workable?

edit Ummm, I guess HotKey is the closest I'm going to find, right? Enable one, check for it, and then disable it? Can't use Shift though...

Edited by Neimo

Share this post


Link to post
Share on other sites



Look up "_IsPressed" in the User-Defined Functions category of the help file. If it's not there, you may need to download the latest beta version of AutoIt.

Share this post


Link to post
Share on other sites

Outstanding, thanks very much! Now I'm playing with Beta Power! Turns out I only had 3.1.0 installed, but _IsPressed is not in 3.1.1 either, only the Beta has it. Now it works just like I want it to.

Share this post


Link to post
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
Sign in to follow this  
Followers 0