AutoHotkey Community

It is currently May 26th, 2012, 1:43 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: March 28th, 2006, 6:36 am 
Offline

Joined: March 28th, 2006, 6:29 am
Posts: 1
The other iTunes controls out there weren't really doing it for me, so I tossed this together. Requires Scripts for Itunes from http://www.maximized.com/freeware/scriptsforitunes/. Looking around a little, shouldn't be too hard if someone wants to adapt it for Winamp or whatever.

Code:
;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         Michael Griffin <not.public@example.com>
;
; Script to control iTunes with media keys
; Hold down prev/next for rewind/fastforward
; Tap to jump to prev/next track
;
; Requires the very handy Scripts for iTunes
; http://www.maximized.com/freeware/ScriptsForiTunes/
;

#SingleInstance force

; Time in ms before we consider this holding down the button
?hysttime := 333

; Path to iTunes scripts, this is the default - not used, Run doesn't like variables
?scriptPath = %A_ProgramFiles%\iTunes\Scripts

; Initialize the hold flag
?hyst := 0

; Next/Fast-Foward

Media_Next::
; Start fastforwarding now
Run C:\Program Files\iTunes\Scripts\FastForward.vbs
; Start the countdown
SetTimer, hyst, %?hysttime%
return

Media_Next Up::
; They let go of the key right away
if ?hyst < 1
{
    Run C:\Program Files\iTunes\Scripts\Next.vbs
}
; Key has been down for > ?hysttime
Else
{
    Run C:\Program Files\iTunes\Scripts\Play.vbs
}
; Reset our timer and flag for the next run
SetTimer, hyst, Off
?hyst := 0
return


; Prev/Rewind

Media_Prev::
Run C:\Program Files\iTunes\Scripts\Rewind.vbs
SetTimer, hyst, %?hysttime%
return

Media_Prev Up::
if ?hyst < 1
{
    Run C:\Program Files\iTunes\Scripts\BackTrack.vbs
}
Else
{
    Run C:\Program Files\iTunes\Scripts\Play.vbs
}
SetTimer, hyst, Off
?hyst := 0
return

Media_Play_Pause::
Run C:\Program Files\iTunes\Scripts\PlayPause.vbs  ; play/pause toggle
?hyst := 0
return

Media_Stop::
Run C:\Program Files\iTunes\Scripts\Stop.vbs  ; stop
?hyst := 0
return

; We only get here if he button has been down for ?hysttime ms or more

hyst:
    ?hyst := 1
    SetTimer, hyst, Off
return


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 30th, 2006, 11:59 am 
Adding this to your HoeKey script file also does the job:


=Rem| -Fast Forward-
^@39=Msg|iTunes|793|0|3211264 ; Ctrl+Alt+Right
=Msg|iTunes|793|0|3211265 ;(Hack: Send some msg quickly after previous to stop forwarding 2 or 3 units)

=Rem| -Rewind-
^@37=Msg|iTunes|793|0|3276800 ; Ctrl+Alt+Left
=Msg|iTunes|793|0|3276801 ;(Hack: Send some msg quickly after previous to stop rewinding 2 or 3 units)


Report this post
Top
  
Reply with quote  
 Post subject: complete iTunes settings
PostPosted: December 26th, 2007, 1:45 pm 
Here my complete list of Hoekey settings for iTunes, for your convenience:

=Rem|-- iTunes --
~T=Run|"C:\Program Files\iTunes\iTunes.exe" ; Launch iTunes
^@36=Msg|iTunes|793|0|917504 ; Ctrl+Alt+Home : play/pause
^@45=Msg|iTunes|793|0|917504 ; Ctrl+Alt+Insert: play/pause
^@35=Msg|iTunes|793|0|851968 ; Ctrl+Alt+End : stop
^@33=Msg|iTunes|793|0|786432 ; Ctrl+Alt+PageUp : previous song
^@34=Msg|iTunes|793|0|720896 ; Ctrl+Alt+PageDown: next song
^@39=Msg|iTunes|793|0|3211264 ; Ctrl+Alt+Right: Forward 5 sec
=Msg|iTunes|793|0|3211265 ; (Hack: Send some msg quickly after previous one, to prevent fast-forwarding more than one unit)
^@37=Msg|iTunes|793|0|3276800 ; Ctrl+Alt+Left : Rewind 5 sec
=Msg|iTunes|793|0|3276801 ; (Same Hack)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 26th, 2007, 3:52 pm 
I forgot to add the volume-up/down keys in the previous post:

^@38=Msg|iTunes|793|0|655360 ; Ctrl+Alt+Up : Volume up
^@40=Msg|iTunes|793|0|589824 ; Ctrl+Alt+Down: Volume down

Also very useful to have Volumouse installed if you click as much as you type :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2008, 6:58 pm 
Offline

Joined: December 10th, 2007, 1:06 am
Posts: 13
I love this script, but Im having a hard time finding where you define what the short cut keys will be.

I dont see anywhere you specify Ctrl+Alt+____ for the trigger.

Anyone know where you edit that?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2008, 7:48 pm 
Offline

Joined: December 10th, 2007, 1:06 am
Posts: 13
Ok I knocked out something that works. Someone might have a better way to do this.. but it does serve it's purpose.

Hopefully it's useful to someone else with similiar needs.

I like to get books from audible.com where the author reads it to you. Its easier for me, but I like to be able to take notes. so I took what was done with this script and made some changes that make it perfect for that. I close all other hot keys while Im working on this.

with only itunes and word open I can now perform some nice functions with my hands in the neutral position. I hate having to take my hands off and reach for the mouse, etc.:

Flip between docs with Caps

Rewind indefinately with k

Fast Forward Indefinately with l

One 5 second rewind with it starting the playback again with f



Code:

CapsLock::
SendPlay, {Alt Down}{Tab Down}{Tab UP}{Alt UP}
return

#IfWinActive, iTunes
k:: ; FastForward
Run C:\Program Files (x86)\iTunes\Scripts\Rewind.vbs
return

#IfWinActive, iTunes
l:: ; FastForward
Run C:\Program Files (x86)\iTunes\Scripts\FastForward.vbs
return


#IfWinActive, iTunes
f:: ; Rewind
Run C:\Program Files (x86)\iTunes\Scripts\Rewind.vbs
sleep 100
SendPlay, {Space}
SendPlay, {Space}
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 22nd, 2009, 12:44 am 
Offline

Joined: October 9th, 2006, 9:27 am
Posts: 21
yeeha wrote:
I forgot to add the volume-up/down keys in the previous post:

^@38=Msg|iTunes|793|0|655360 ; Ctrl+Alt+Up : Volume up
^@40=Msg|iTunes|793|0|589824 ; Ctrl+Alt+Down: Volume down

Also very useful to have Volumouse installed if you click as much as you type :)

Thanks yeeha, your keys helped me ultimately.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 15 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