Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

iTunes controls with fast-forward/rewind


  • Please log in to reply
6 replies to this topic
ludditemike
  • Members
  • 1 posts
  • Last active: Apr 03 2006 01:03 AM
  • Joined: 28 Mar 2006
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...riptsforitunes/. Looking around a little, shouldn't be too hard if someone wants to adapt it for Winamp or whatever.

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         Michael Griffin <[email protected]>
;
; 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


yeeha
  • Guests
  • Last active:
  • Joined: --
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)

yeeha
  • Guests
  • Last active:
  • Joined: --
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)

yeeha
  • Guests
  • Last active:
  • Joined: --
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 :)

SimplifyLife
  • Members
  • 13 posts
  • Last active: Mar 23 2011 01:57 PM
  • Joined: 10 Dec 2007
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?

SimplifyLife
  • Members
  • 13 posts
  • Last active: Mar 23 2011 01:57 PM
  • Joined: 10 Dec 2007
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




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


sashabe
  • Members
  • 24 posts
  • Last active: Aug 05 2013 11:34 AM
  • Joined: 09 Oct 2006

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.