| View previous topic :: View next topic |
| Author |
Message |
miscman
Joined: 25 Apr 2004 Posts: 13
|
Posted: Sun Apr 25, 2004 6:16 am Post subject: Feature Request |
|
|
First off, let me say that this program is amazing. I really must give you mad props for doing this, and even more, making it open source!
That being said, there is a feature that I could really use. There are some games that I play where Alt-tabbing out of the game to do certain things (check IM, email, control winamp) are not possible without screwing up the game.
I had been thinking about writing some sort of scriptable shell to allow me to execute various commands from inside the game and this program would get me 90% of the way there!!!
There is 1 more feature that would complete my quest, however.
if there were a function to call, say like, 'getString' where you pass it a terminating character and/or max string lengh. It would return a string made up of all the characters typed since it was called till it got to terminating cahracter or the string grew to the size of the maxsize.
This addition would make me insanly happy. Any idea how long something like this would take to add in? |
|
| Back to top |
|
 |
miscman
Joined: 25 Apr 2004 Posts: 13
|
Posted: Sun Apr 25, 2004 7:23 am Post subject: |
|
|
nnnnnnnnooooooooooooooooooooooooooo!!!!
after playing around with this program and my game, I have discovered that it seems to take the keypresses before they can be detected by this program...
is there any way to get around this? |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10463
|
Posted: Sun Apr 25, 2004 12:32 pm Post subject: |
|
|
If I understand you correctly, this topic should be of help. It allows you to type abbreviations and have them automatically expanded by the program:
http://www.autohotkey.com/forum/viewtopic.php?t=86&highlight=dakota
You'll have to adjust it to take action rather than typing a replacement word.
The above feature will be integrated into the program in the next few weeks. It should work something like this:
::;ahk::
MsgBox, You typed the magic word ";ahk".
return
| Quote: | | I have discovered that it seems to take the keypresses before they can be detected by this program... |
Try adding the line #UseHook to the top of your script (this will not work if you're using Win9x), saving, and then choosing "Reload This Script" from the tray menu. If that doesn't work, keep the #UseHook line in there but start your script *after* starting the game. This might allow the script to take precedence over the game's detection of the keys.
If it still doesn't work, it looks like the game is using some kind of low-level detection of keys and there might be no workaround. |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Apr 25, 2004 9:07 pm Post subject: |
|
|
Well what I had inteneded for the use of the feature was to be able to take dynamic input from the user in a non obtusive non gui way. To allow dynamic information to be collected without window focus being changed.
As for the game, the usehook does not work. I tried that last night to no avail. Would there be any way to get a hook in front of what they are doing? I cannot tell you how insanley annoying not being able to alt tab out of a game is... This program would be heaven. |
|
| Back to top |
|
 |
miscman
Joined: 25 Apr 2004 Posts: 13
|
Posted: Sun Apr 25, 2004 9:20 pm Post subject: |
|
|
| blah... deleted cookies.... forgot to log in... cant spellcheck.. :( |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10463
|
Posted: Mon Apr 26, 2004 12:59 am Post subject: |
|
|
And you also tried launching your script after the game is already running?
Perhaps games that use direct input bypass any hooks that may be installed. Someday I hope to find out for sure and document it.
One other thing you can try is a mouse hotkey. It's conceivable the game allows such hotkeys even though keyboard hotkeys are bypassed. An example would be:
lbutton & rbutton::
MsgBox You pressed the right mouse button while the left was held down.
return
And another thing you might experiment with is GetKeyState. Try to find out if the state of a key can be reliably detected while the game is running. If it can, you might be in luck because you can build your own hotkey handler using GetKeyState. We can help you with that.
There is a feature planned in the next few weeks that might do part of what you wanted, assuming the hook can see the keys as you press them (probably not, from what you've said). An example would be that if you press alt-semicolon, the hook will suppress your keystrokes for a certain amount of time, watching for you to type a "magic command". If you type a valid command, the script will perform some action for you.
Last edited by Chris on Mon Apr 26, 2004 3:13 am; edited 1 time in total |
|
| Back to top |
|
 |
miscman
Joined: 25 Apr 2004 Posts: 13
|
Posted: Mon Apr 26, 2004 2:54 am Post subject: |
|
|
I'll have to think of soething to launch it after the game starts... perhaps a timer or schedule it to run after a bit of time.
I will also try the mouse hotkeys tomorrow, and let you know how that goes.
I don't know that the feature you plan on introducing is worth it. If you consider it, having a readstring command that will take all keypresses up to a terminal symbol or for a duration period and put it in a variable is far more robust and flexible than somthing for predefined macros.
Just my $0.02, but it seems that most of the functionality would be implemented, you would just be imposing limits on its use by requiring the macros be predefined. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10463
|
Posted: Mon Apr 26, 2004 3:11 am Post subject: |
|
|
| Quote: | | ... having a readstring command that will take all keypresses up to a terminal symbol or for a duration period and put it in a variable is far more robust and flexible than somthing for predefined macros. |
That's an interesting idea. The reason I don't just do that is that most users would want the action to take effect immediately when they type a valid abbreviation. They wouldn't want it to wait for the timeout to expire.
I haven't even completed the design for this feature, so ideas like this are welcome. Maybe I'll have the typed text put into a variable in addition to the rest of the planned behavior. |
|
| Back to top |
|
 |
miscman
Joined: 25 Apr 2004 Posts: 13
|
Posted: Mon Apr 26, 2004 3:20 am Post subject: |
|
|
| cmallett wrote: | The reason I don't just do that is that most users would want the action to take effect immediately when they type a valid abbreviation. They wouldn't want it to wait for the timeout to expire.
|
Well then that's why they could enter in a terminal character.
so that all commands could be, for example, terminated by a ' ; '
popup;
volumeup;
dosomething;
or even a \n character
the string in the block would be analyzed and then an approprate subroutine would be called.
My uses include wanting maybe to ask the user to enter in a number to repeat something. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10463
|
Posted: Mon Apr 26, 2004 4:27 am Post subject: |
|
|
Now you're sounding a little like Jay the typing acceleration guru.
Having a terminating key is fine, but don't you still need an initiate key? Most users would probably want to avoid having both (even if they were the same key). That's the whole idea behind having a leading key rather than a trailing key, and having predefined abbreviations that are quickly recognized by the hook.
It is planned that these abbreviations can be dynamic also. For example, a command like this might be added:
RegisterHotkey, ;ahk, LabelAHK
...
LabelAHK:
Send, http://www.autohotkey.com
return |
|
| Back to top |
|
 |
miscman
Joined: 25 Apr 2004 Posts: 13
|
Posted: Mon Apr 26, 2004 5:33 am Post subject: |
|
|
| cmallett wrote: | Now you're sounding a little like Jay the typing acceleration guru.
|
I don't know Jay, but he sounds like a cool guy ;D
#C:: ; for command
GetString, str, '\n'
; do something with the string
; comand control code here
return |
|
| Back to top |
|
 |
miscman
Joined: 25 Apr 2004 Posts: 13
|
Posted: Mon Apr 26, 2004 5:38 am Post subject: |
|
|
My point is that you can easily use what i proposed to mimic what you had in mind, yet make it much more powerful. :)
It's your program tho, I would dig into it myself, but I have ben programmin Java for a while and got too used to it. I need to brush up on C++ but mid semester is not the time. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10463
|
Posted: Mon Apr 26, 2004 5:52 am Post subject: |
|
|
I like that idea since it is very flexible. It does seem a little inconvenient: A user must first press the hotkey that does the GetString, type the desired phrase, then type an ending character of some kind (the same hotkey could be pressed as the ending key).
One of the subsets of this whole idea is AutoReplace, where in you type something like ;otoh and the program will backspace and automatically replace it with "On the other hand". I'm not sure whether this should be a separate command or whether they can all be integrated into one generic command or syntax. |
|
| Back to top |
|
 |
miscman
Joined: 25 Apr 2004 Posts: 13
|
Posted: Mon Apr 26, 2004 5:18 pm Post subject: |
|
|
| cmallett wrote: | | At it's current position, it would probably be 30 days or more before it gets done. But all it takes is someone to express ongoing interest and the priority gets raised :) |
Stolen from another thread. >.<
I would like to take this time to express my ongoing interest! |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10463
|
Posted: Mon Apr 26, 2004 6:10 pm Post subject: |
|
|
| This string hotkeys feature is already a very high priority; I plan to work on it for the release after this one. I just have to figure out the best way to manifest it in commands, syntax, and behavior. I'll definitely be putting some thought into your GetString idea, so thanks. |
|
| Back to top |
|
 |
|