 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
darkpaladin79
Joined: 25 Nov 2007 Posts: 3
|
Posted: Sun Nov 25, 2007 6:36 pm Post subject: Game grabbing keys that I want to send out? |
|
|
This has probably been asked somewhere else before, but after a lot of searching I can't seem to find the answer. I also saw the post in the faq, but that seems to only apply to sending keystrokes and such INTO the game. I want to be able to control iTunes from inside a game (supcom). It works fine in bf2142, but apparently supcom grabs the win key, and it doesn't get sent out to where I want it to go. I'm using this to control iTunes:
| Code: | ; ############## iTunes ##############
; win+right -> next song
; win+left -> previous song
; win+up -> volume up
; win+down -> volume down
; win+space -> play/pause
#right::
DetectHiddenWindows, On
;WinGet, active_id, ID, ahk_class iTunes
ControlSend, ahk_parent, ^{right}, iTunes ahk_class iTunes
;MsgBox, The active window's ID is "%active_id%".
DetectHiddenWindows, Off
return
#left::
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{left}, iTunes ahk_class iTunes
DetectHiddenWindows, Off
return
#down::
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{down}, iTunes ahk_class iTunes
DetectHiddenWindows, Off
return
#up::
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{up}, iTunes ahk_class iTunes
DetectHiddenWindows, Off
return
#space::
DetectHiddenWindows, On
ControlSend, ahk_parent, {space}, iTunes ahk_class iTunes
DetectHiddenWindows, Off
return |
Any ideas? |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1501
|
Posted: Sun Nov 25, 2007 8:40 pm Post subject: |
|
|
It is entirely possible that the SuCom game client implements a keyboard hook which supercedes AHK's keyboard hook.
(you are using the keyboard hook [#UseHook] right?)
Basically, the game doesn't want [win] keystrokes, so it doesn't let any other software use them.
You can try having the script reset the keyboard hook after the game is running (via the "reload" command) and see if the AHK keyboard hook works then.
Alternatively, if you have a multimedia keyboard, the special keys (i.e. browser home and mute) are often overlooked by game clients and are simply sent onwards to the rest of the OS's fauna. Then, you could bind those special keys to your itunes functions. _________________ My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags ! |
|
| Back to top |
|
 |
darkpaladin79
Joined: 25 Nov 2007 Posts: 3
|
Posted: Sun Nov 25, 2007 10:13 pm Post subject: |
|
|
Thanks for the reply, but nothing there applies to me. Using a hook doesn't change anything, and I don't have a multimedia keyboard. Also, I don't know if you understood or not, but the game does accept win keystrokes, I just don't care if they get there or not. They don't do anything useful.
I guess this brings me around to where all the other topics I read were talking about, with working fancy magic with dll's to supersede the game's hook.
Edit: Fixed the problem by mapping my G5's extra button (button 4, the back button) to F18, then using that as a basis for issuing commands since supcom doesn't grab F18. Thanks for the help, problem solved! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|