- Joined
- Jun 28, 2010
- Messages
- 72
- Motherboard
- Gigabyte Z68XP-UD3
- CPU
- i7 > Need full CPU name > See Forum Rules!
- Graphics
- GTX 970
- Mac
- Mobile Phone
*Update: Well someone just told me about bytecontroller, http://bytetastic.com/, which is a basically a free and easier way to set up iTunes controls on your keyboard. I still recommend using ControllerMate in conjunction for the native volume controls as bytecontroller only controls the iTunes volume and ControllerMate you can assign the native osx volume controls.*
In this tutorial I'll be showing you how to turn your ordinary keyboard into one that has the ability to change volume and control iTunes using the 'F' keys or any other keys you decide.
Shortly after building my first hackintosh I wanted to retain my old Dell Quietkey keyboard but take advantage of the volume and iTunes controls, one of my favorite features of OSX.
After googling around for a bit I discovered you could do this by using the application ControllerMate (http://www.orderedbytes.com/controllermate/). You'll need to purchase the full version in order to utilize all the buttons I'm going to document. You have a minimum amount of buttons you can set up in the shareware version.
I've gone and set my keys as:
F6: Previous iTunes track
F7: Play/Pause
F8: Next iTunes track
Print Screen: Toggle Mute On/Off
Scroll Lock: Volume down
Pause/Break: Volume up
You can of course set these to any keys you wish to use, I selected these because they are my least used keys.
The first step is to open controllermate.
Hit the programming tab on the main window.
Add a new page. Screen Shot 2012-06-18 at 7.45.58 AM.png
Select the new page.
Open up the palette.
Select controllers and select your keyboard.
From here you can drag the keys you intend to use onto the gridded field of the new page you just created. It should look something like this: Screen Shot 2012-06-18 at 7.51.25 AM.png
*Note: For some reason with my latest hackintosh with Lion installed I wasn't able to get all 6 keys working. One would always not work when I closed ControllerMate. To remedy this I just added a new page and put my 6th control onto that page and then all 6 worked like a charm. This is why you don't see my F6 in my screenshot.
Now that you have your keys dropped in we can add our commands.
For volume and mute toggling you will navigate to the 'Keystrokes Palette'. Screen Shot 2012-06-18 at 7.55.18 AM.png
Once this comes up you can drag the volume and mute keys into the grid and literally attach it to your key you already have in there: Screen Shot 2012-06-18 at 7.56.35 AM.png
Once you have those arranged you can test it and they should work properly.
Now that you have your volume keys set up let's move onto the iTunes controls.
Go to the main palette and navigate to 'Apple Script'. You can drag a regular script onto the grid. Go ahead and attach this to the button you selected for 'previous track'.
Now you need to bring up the inspector.
When you have your empty script selected it should look like this in the inspector: Screen Shot 2012-06-18 at 8.01.10 AM.png
Now all you need to do is make sure 'Store script in building block' is selected and paste in the following script:
'tell application "iTunes"
play (previous track)
end tell'
Then hit 'Update status'.
Your previous track button should now be set up and you can go ahead and use the following scripts for play/pause and next track.
Play/Pause:
'tell application "iTunes"
if player state = playing then
pause
else
play
end if
end tell
'
Next Track:
'tell application "iTunes"
play (next track)
end tell'
And that's about it. All your buttons should be working properly and you can even close the application and not have to worry about it again.
Hopefully someone finds this useful. If you have any questions or if I made any mistakes go ahead and let me know.
In this tutorial I'll be showing you how to turn your ordinary keyboard into one that has the ability to change volume and control iTunes using the 'F' keys or any other keys you decide.
Shortly after building my first hackintosh I wanted to retain my old Dell Quietkey keyboard but take advantage of the volume and iTunes controls, one of my favorite features of OSX.
After googling around for a bit I discovered you could do this by using the application ControllerMate (http://www.orderedbytes.com/controllermate/). You'll need to purchase the full version in order to utilize all the buttons I'm going to document. You have a minimum amount of buttons you can set up in the shareware version.
I've gone and set my keys as:
F6: Previous iTunes track
F7: Play/Pause
F8: Next iTunes track
Print Screen: Toggle Mute On/Off
Scroll Lock: Volume down
Pause/Break: Volume up
You can of course set these to any keys you wish to use, I selected these because they are my least used keys.
The first step is to open controllermate.
Hit the programming tab on the main window.
Add a new page. Screen Shot 2012-06-18 at 7.45.58 AM.png
Select the new page.
Open up the palette.
Select controllers and select your keyboard.
From here you can drag the keys you intend to use onto the gridded field of the new page you just created. It should look something like this: Screen Shot 2012-06-18 at 7.51.25 AM.png
*Note: For some reason with my latest hackintosh with Lion installed I wasn't able to get all 6 keys working. One would always not work when I closed ControllerMate. To remedy this I just added a new page and put my 6th control onto that page and then all 6 worked like a charm. This is why you don't see my F6 in my screenshot.
Now that you have your keys dropped in we can add our commands.
For volume and mute toggling you will navigate to the 'Keystrokes Palette'. Screen Shot 2012-06-18 at 7.55.18 AM.png
Once this comes up you can drag the volume and mute keys into the grid and literally attach it to your key you already have in there: Screen Shot 2012-06-18 at 7.56.35 AM.png
Once you have those arranged you can test it and they should work properly.
Now that you have your volume keys set up let's move onto the iTunes controls.
Go to the main palette and navigate to 'Apple Script'. You can drag a regular script onto the grid. Go ahead and attach this to the button you selected for 'previous track'.
Now you need to bring up the inspector.
When you have your empty script selected it should look like this in the inspector: Screen Shot 2012-06-18 at 8.01.10 AM.png
Now all you need to do is make sure 'Store script in building block' is selected and paste in the following script:
'tell application "iTunes"
play (previous track)
end tell'
Then hit 'Update status'.
Your previous track button should now be set up and you can go ahead and use the following scripts for play/pause and next track.
Play/Pause:
'tell application "iTunes"
if player state = playing then
pause
else
play
end if
end tell
'
Next Track:
'tell application "iTunes"
play (next track)
end tell'
And that's about it. All your buttons should be working properly and you can even close the application and not have to worry about it again.
Hopefully someone finds this useful. If you have any questions or if I made any mistakes go ahead and let me know.
Attachments
-
Screen Shot 2012-06-18 at 7.45.58 AM.png1.4 KB · Views: 376
-
Screen Shot 2012-06-18 at 7.51.25 AM.png437.1 KB · Views: 446
-
Screen Shot 2012-06-18 at 7.55.18 AM.png48.2 KB · Views: 377
-
Screen Shot 2012-06-18 at 7.56.35 AM.png12.4 KB · Views: 381
-
Screen Shot 2012-06-18 at 8.01.10 AM.png25.7 KB · Views: 371