AutoHotkey Community

It is currently May 27th, 2012, 10:34 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: November 25th, 2007, 7:36 pm 
Offline

Joined: November 25th, 2007, 7:33 pm
Posts: 3
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2007, 9:40 pm 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
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.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2007, 11:13 pm 
Offline

Joined: November 25th, 2007, 7:33 pm
Posts: 3
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!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, chaosad, Google [Bot], robotkoer, specter333, Yahoo [Bot] and 75 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group