Sign in to follow this  
Followers 0
andrew.arnott

Consume keystrokes

8 posts in this topic

#1 ·  Posted (edited)

I'm wondering if it is possible to consume keystrokes with AutoIt and, if so, how.

[edit: snipped out]

Thanks,

Andrew

Edited by andrew.arnott

Share this post


Link to post
Share on other sites



You did see the announcement at the top of the forums ....right?

It isn't for botting (if that makes a difference, which it probably doesn't). But, no I hadn't seen it. It has been a while since I've posted here.

Subject matter aside (which I will be editing out of the original post), the question still stands. Can I consume keystrokes with AutoIt?

Thanks,

Andrew

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

It isn't for botting (if that makes a difference, which it probably doesn't). But, no I hadn't seen it. It has been a while since I've posted here.

What does the bit between brackets supposed to imply?

Subject matter aside (which I will be editing out of the original post), the question still stands. Can I consume keystrokes with AutoIt?

Seen HotKeySet() in the Helpfile() on your search quest?

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

What does the bit between brackets supposed to imply?

Oh, I just meant that I was not planning on automating the play of a game, but rather writing a utility that stops me from doing something stupid during a game. Which I guess really amounts to the same thing. Ignore the text in parentheses please :unsure:.

Seen HotKeySet() in the Helpfile() on your search quest?

I have thought of using HotKeySet(), but it isn't really a robust solution if I want to consume multiple keystrokes in a row at some point and make descisions based on that. It would certainly work for this particular problem, but I use AutoIt a lot and I thought that it might be a good idea to check with the community if there is a way within a script to consume keyboard input.

For example, suppose I want to consume all of the input a user gives until they press the enter key, and use that consumed text to perform some actions. Maybe this command can be triggered by a hotkey. So, when I press ctrl + ~ on my machine (for instance), you could type in a command, and then when you press enter, some complicated series of events would be carried out.

So, to be clear, I'm more asking this question to expand my knowledge of the language, which just happened to be spurred by a specific problem. I usually like to include context in my posts because it is easier to answer a specific problem with a specific solution.

Thanks,

Andrew

Share this post


Link to post
Share on other sites

Have a search for hotstrings udf

But if ultimately its a keylogger you are after, you're flogging a dead horse here.

Thanks! I'm not interested in a keylogger, although I suppose consuming input could do that. Although HotKeySet also could, I'm sure.

--Andrew

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

If you're in windows and not in a game, you could simply set a HotKey that will open a small InputBox() window,

and in that window, enter the command you wish, and then press enter.

A Switch block will later interpret the command, and do whatever you define each command to do.

That's what I did, when I needed a way to enter commands, no matter what current application is.

It works great, in regular windows.

But if you're in a game, you will need a different solution, because if you try to open a small window while in a game, it will take you out of the game..

Edited by Zohar

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