andrew.arnott Posted April 18, 2011 Share Posted April 18, 2011 (edited) I'm wondering if it is possible to consume keystrokes with AutoIt and, if so, how. [edit: snipped out] Thanks, Andrew Edited April 18, 2011 by andrew.arnott Link to comment Share on other sites More sharing options...
Developers Jos Posted April 18, 2011 Developers Share Posted April 18, 2011 You did see the announcement at the top of the forums ....right? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
andrew.arnott Posted April 18, 2011 Author Share Posted April 18, 2011 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted April 18, 2011 Developers Share Posted April 18, 2011 (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 April 18, 2011 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
andrew.arnott Posted April 18, 2011 Author Share Posted April 18, 2011 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 .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 Link to comment Share on other sites More sharing options...
JohnOne Posted April 18, 2011 Share Posted April 18, 2011 Have a search for hotstrings udf But if ultimately its a keylogger you are after, you're flogging a dead horse here. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
andrew.arnott Posted April 18, 2011 Author Share Posted April 18, 2011 Have a search for hotstrings udfBut 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 Link to comment Share on other sites More sharing options...
Zohar Posted April 19, 2011 Share Posted April 19, 2011 (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 April 19, 2011 by Zohar Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now