| View previous topic :: View next topic |
| Author |
Message |
keiner Guest
|
Posted: Wed Dec 29, 2004 10:09 am Post subject: send CTRL or ALT Kes |
|
|
Hi i wrote a small script for a rpg. I send commands to the programm via ControlSend (also tried with send).
| Code: | ; WICHTIG sonst geht es bei mir nicht
SetKeyDelay 30,20
; Kein Windows Key verwenden, sonst geht es auch nicht
SHIFT & 1::
Gosub GetHealth
Return
; --- Proceduren ------
; Recycle Time: 6
; Cast Time 3
GetHealth:
ControlSend, , {END}^2, GameName
MsgBox, This line is commented out (disabled).
Sleep 4000
Return |
If i use the windows Key as a shortcut the programm failes to send the CTRL+X or ALT+x keystrokes. If i use SHIFT & 1 like above it works. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Wed Dec 29, 2004 12:50 pm Post subject: |
|
|
| Quote: | | If i use the windows Key as a shortcut the programm failes to send the CTRL+X or ALT+x keystrokes. If i use SHIFT & 1 like above it works. | Some games might restrict which hotkeys can be used. Do you mean that "LWin & 1" didn't work? If you meant something like #1, you might be able to get it to work in this particular game by putting a $ prefix in front of it: $#1.
Also, to use the windows key itself as a hotkey:
RWin:: ; Right Win key.
...actions...
return
If you find a particular hotkey that doesn't work even outside the game, please let me know because that could be a bug. |
|
| Back to top |
|
 |
keiner Guest
|
Posted: Wed Dec 29, 2004 2:00 pm Post subject: |
|
|
no, the problem is that all other keys work, like only pressing 2 or whatever (even {HOME} works), only key combinations with CTRL,ALT or SHIFT don't work if the shortcut for the macro is using the windows key.
With the SHIFT & 1 shortcut everything works fine |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Wed Dec 29, 2004 6:33 pm Post subject: |
|
|
Thanks for clarifying.
I tried the following script and its hotkey seems to have the desired effect (select-all) in Notepad. Maybe you can try it too. If it doesn't work in Notepad, it would be good to know the version of AutoHotkey you're using and your OS version.
#5:: ; Win+5
ControlSend,, ^a, A
return
This might also be a game-specific issue. You could try increasing KeyDelay to see if that helps:
#1:: ; Win+1
SetKeyDelay, 20, 10 ; The 2nd number might be the most important for some games.
Gosub GetHealth
return |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Jan 06, 2005 1:20 pm Post subject: |
|
|
Hi
In the code example i had a line like SetKeyDelay 30,20 at the moment i even had to put this up to SetKeyDelay 200,80 which slows down writing in other apps pretty much.
But still autohotkey refuses to send CTRL, ALT or SHIFT key kombination to the app when a windows key is used as a shortcut for the macro. I also tried the RWIN thing.
If i use SHIFT+Key as a shortcut for my macro everything works fine. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Thu Jan 06, 2005 7:34 pm Post subject: |
|
|
This sounds like a game-specific issue since hotkeys very similar to the one you described seem to work in other apps. One such hotkey, which works in Notepad and other editors, is:
#5:: ; Win+5
ControlSend,, ^a, A
return |
|
| Back to top |
|
 |
|