Hacking AirClick USB (for Mac)
If you’re interested in adding additional functionality to your AirClick without all the mucking about in property lists and what not, you may want to look at this, otherwise, read on.
Quite a while back I wrote a little blurb suggesting that people interested in customizing their AirClick USB software contact me for an explanation. What I should have really done was taken the time to write up as nice little HOWTO instead of setting myself up to write several individual HOWTOs. That is something we shall have to remedy.
A few notes before we get started. Though I work for Griffin (we’ll see for how much longer after this post) this article is by no means endorsed or supported by Griffin Technology. In other words if you go mucking around inside AirClick package and break something, don’t expect much sympathy from the guys in support. Me either for that matter. If you accidently rm -rfv / please don’t come crying to me (by the way, I did that once, it made me sad). Please make a backup copy of the application, your hard drive, make sure the batteries are good in your smoke alarm, etc., etc. That being said, if you’re still interested, read on.
In order to make this easy on yourself, you should probably have installed Apple’s developer tools. You don’t need to compile anything, but you’ll find that Property List Editor, found in /Developer/Applications/Utilities will make life much easier. You should also be familiar with AppleScript.
functions.plist
First let’s take a look inside the AirClick package and see how things are put together. Control-click the AirClick application and select Show Package Contents from the contextual menu. Notice the various scripts in Contents/Resources. You’ll also see a file called functions.plist. Open this file with Property List Editor or your favorite text editor and follow along by navigating through the items in the as they are explained.
The top level is an array of dictionaries. Each of these dictionaries represents a group of functions that can be selected in the AirClick menu. Within each group are two entries: an array named “Functions” and a string named “Name”. The “Name” appears in the AirClick menu which is used to select the active group of functions. “Functions” is an array of dictionaries that describes each of the functions in this group and the rules required to execute each script.
A function dictionary contains the following:
- Button (Number): A code indicating which button will trigger this function. The button codes are:
- Play: 1
- Volume Up: 2
- Volume Down: 4
- Next: 8
- Previous: 16
- Modifiers (Number): A mask indicating which additional buttons need to be pressed to trigger this function. Uses the same codes as described above. Use 0 to indicate no required modifiers.
- Name (String): The human readable name of this function. Not currently used, but you never know.
- OnRelease (Boolean): YES if this function executes when “Button”
is released. Otherwise executed when pressed. - Repeats (Boolean): YES if this function repeats until the state of
“Button” changes. - Scriptname (String): The file name of the AppleScript to be executed.
- SetLogic [optional] (Dictionary): Contains optional parameters used to set internal variables. Defined as:
- Value (Number): The value to set the variable to.
- VarName (String): The name of the variable to set.
- TestLogic [optional] (Dictionary): Contains optional parameters used to query internal variables. The function will only execute if the test
evaluates true. Defined as:- Value (Number): The value to compare the variable to.
- VarName (String): The name of the variable to compare.
- Time (Number): Time in seconds the state must remain true before the function executes. 0.0 indicates that the function should execute immediately.
So now you know what all of the various property describe, let’s take a look at a few examples. First look in the first (or zero-ith if you like) function group (Name: DVD Player) in the first function. The properties are:
- Button: 1
- Modifiers: 0
- Name: Play / Pause
- OnRelease: Yes
- Repeats: No
- Scriptname: dvd_playpause.scpt
- Time: 0
Translated that means when the Play button is released (and no other buttons are pressed) immediately execute the script named dvd_playpause.scpt once. That’s a fairly straightforward example.
A slightly more complicated example is emulating an iPod’s next and previous buttons. These buttons when pressed and released quickly go to the next or previous track. If held the track will fast-forward or rewind respectively. However when the button is released, it should not trigger the next / previous track function. The DVD Player remote works the same way. Consider these two functions:
- Button: 8
- Modifiers: 0
- Name: Fast Forward
- OnRelease: NO
- Repeats: No
- Scriptname: dvd_fforward.scpt
- SetLogic:
- Value: 1
- VarName: DidFF
- Time: 0.5
and
- Button: 8
- Modifiers: 0
- Name: Next Chapter
- OnRelease: Yes
- Repeats: No
- Scriptname: dvd_nextchapter.scpt
- TestLogic:
- Value: 0
- VarName: DidFF
- Time: 0
The first function will execute the dvd_fforward.scpt script once the Next button has been held for 0.5 seconds. Furthermore it will set a variable named DidFF equal to 1. This variable is key because the next function says execute when the Next button is released if the variable DidFF evaluates to 0. A third function is actually required to reset this variable when the button is released if necessary. But you get the idea. You can create some pretty non-trivial functions if needed.
AppleScripts
This is pretty straightforward. Create your AppleScript and test it in Script Editor, or AppleScript Studio etc, and save it into the Contents/Resources folder along with all the others. There is one tiny wrinkle however. You must make sure your script is saved as a text file and not a script. The software expects, at this point in time, to find a text file at the location specified in the function definition.
Additionally, the AirClick AppleScript suite provides several commands for such things as an on screen display which can include a message, assorted icons and a level meter. Also the ability to simulate a user key press and a means of adjusting the system volume. This commands are all documented in the AirClick dictionary and there are plenty of examples in the scripts provided in the AirClick package so there really isn’t a need to dive into them here.
Where to go from here
I would encourage you to examine the built-in functions and scripts until you feel comfortable enough to construct your own group of functions. It’s really pretty straightforward I think. And so I think that pretty much covers things. Hopefully someone finds this useulf and if there’s something that’s unclear or something I’ve forgotten just leave a comment.
That’s great! But I usually use my Airclick with my Windows computer, actually for my carputer (Since there aren’t any good enough front ends for macs at the moment) so I hope there’s a way to hack the airclickUSB to support other frontend applications such as centrafuse. Is there any way to do so?
Thankyou, this is so cool 🙂
Here’s an AirclickUSB hack to control Front Row: http://www.mp3car.com/vbulletin/showthread.php?t=62733
Is there a hack to control eyetv available for download? thanks.
EyeTV is in my ever growing Todo list.
Is there a hack for iTele to download? would nice to post…
Anyone experience the Airclick on being able to use the Previous Button after you esc out of Front Row and went back in?
I’m having a problem with the Air Click hack. I can only navigate using the “Next†button only. Eveytime I use the “previous†button, I’m forced out of Front Row. I thought to exit out of Front Row the “Previous†button had to be pressed for 2 seconds. Also it would be nice to see this hack worked on the latest Air Click update (v1.0.4 ) which controls many more apps. Can anyone help? I’m not a programmer ☹ Thank you folks.
So I’m wondering how you do that third function to reset the variable in the example of emulating the iPod’s next/prev buttons. I can’t seem to figure it out.
Re: 3rd function – The first function (executes on release) checks to see if the button was held by looking at some variable that the held would have set. If it’s not set, it executes. The second function (on press after a certain amount of time) sets the held variable and executes. The third function (on release) checks the was held variable and if set will execute and also clear the variable.
Im having the same problem as Joseph… cant really use previous button, it always seems to take me back in the menu. Agree that a hack of the new sofware version would be nice, but also it would be cool if the up and down buttons could be held down so the menu would scroll faster… like the keys in the keyboard.
All that fixed… who needs the apple remote?
EyeTV would also be really nice.
A another good hack :
http://cyberquebec.ca/tera/Patch_AirClickUSB1.0.4_FR.zip
Any ideas about EyeTV? I know I’m not the first to mention it; but where might I start?
I’m working on an app to suppliment the current AirClick software that will hopefully make it pretty simple to add support for those applications that have not been included with the existing software… all very top secret and all… shh! 😉
Anyone know how the patch doesn’t work with my g5? In Frontrow works, but the start of Frontrow doesn’t work.
Thanku.. bye
Anyone got the AirClick working with OSX under 10.3? I’d like to give it a try using a beige G3. Would smudging the install work? Reach me at thomaswatts AT fewpb DOT net
It works fine on my G3 iBook with 10.3.9.
I had problems with Airclick and Keynote going to the first or last slide if keys were held down too long; soon rectified by making ‘Last’ and “First’ work like ‘next’ and ‘previous’.
Hi, sorry. I know this isn’t an official tech support page!
I have a problem with airclick on os x 10.4.x : the computer (mac mini) won’t sleep when the usb dongle is attached, it wakes as soon as it enters sleep.
Anyone else experienced this? It was mentioned that it might be an issue with early firmware versions; is there any way to update it?
Cheers, Dave
Hi,
is there any way I can get Airclick to work on os x 10.2.8?? Just bought the thing- asked the shop assistant if I had the right requirements and now I find it doesn’t work- they wont let me take it back!!! Any help would be gratefully recieved!
Griffin Tech Support are awesome. Got my replacement through today, works fine! Very impressed, considering Tennessee is a long ways away!
On to the hacking – that front row patch posted posted by Mr Frontrow works well, though it doesn’t appear to be able to actually launch front row. Works fine from within it. Something to do with the key codes used perhaps? A couple forums are mentioning this problem may be due to the 10.4.4 update.
I’ve worked up a dictionary item for EyeTV. The scripts execute by themselves. EyeTV appears in the AirClick menu, but when I press a button, even though I see it register in Airclick (radio waves on menu bar turn red), it doesn’t execute the script.
I’ve made sure that the scripts are text (even though the VLC ones don’t look like scripts) and are placed in the right folder.
Any ideas to try
After reading your second page on this topic today I realised I had included the scipt files in the resources folder but not the scripts folder. I was misled by the other scripts sitting in the resources folder.
EyeTV now responding well to AirClick so I can close the doors to the computer cabinet, lie back on the sofa and click away.
Thanks for your guide – wouldn’t have known where to start otherwise.
Your welcome James. Sorry I didn’t get a chance to post earlier.
If your interested in an easier approach, take a look at this post. Just let me know if you’re interested:
http://www.somegeekintn.com/2006/01/sneak_preview.html
James,
Why don’t you share your EyeTV scripts, so that we can take some benefit as well of your work.
Thanks (and thanks to Casey for this lovely little guide)…
Window version of the Customizable Airclick wrapper. Read the readme.txt inside and make sure you have the WinAmp Airclick plug-in installed.
Enjoy.
The File:
http://www.yourfilelink.com/get.php?fid=28634
Fourm Thread:
http://www.mp3car.com/vbulletin/showthread.php?p=749654#post749654
I have uploaded a copy of Airclick1.0.4 modified to control EyeTV to my Yahoo Group.
No support, no promises and back up your original AirClick application and other important files first.
http://au.groups.yahoo.com/group/fishfighter/
Time (and Dave) contact griffin support. You may have a faulty AirClick in which case they will replace it for you.
I have the same issue as Dave and noticed knoone has responded to his post. My MAC won’t sleap with Airclick USB plugged in! How can this be fixed?
I just want to say nice job with all this, I just got my AirClick working with Front Row. One thing I haven’t been able to find anywhere are different menubar icons, maybe something that fits in more with the simple icons for volume and Adium. But again, nice work.
For those who have a Mac that won’t go to sleep. It’s the USB receiver for sure. Contact Griffin, they will replace it for you without a problem. Their tech is great. They replaced mine with a new one and shipped it all the way here in Korea. Now, that’s good service!
Stuart:
Can you tell me how to make the changes to AirClick for Keynote? I have the same problem, and I would like to change the fast forward/fast rewind to next/previous. Thanks.
Can the modifier fuction actually be used? I’m using the hack hosted my mp3car.com to use Front Row, but am annoyed with the 2 second delay with the previous menu key fuction. I would like to use the modifier variable so that when I press key 1 and key 16 together it triggers the Escape function. Advice?
Yes, the modifier keys should work just fine. If you’re only using the AirClick software for Front Row, I would suggest getting in on the Proxi beta. There is a AirClick / Front Row configuration (blueprint) for Proxi that I believe works very well.
Folling the instructions here to sign up: http://griffin.somegeekintn.com/
Just wondering what I do if I have an AirClick USB, but do not have Front Row. I do have Equinux MediaCentral. Can someone tell me how to control that? thanks
hey jay. i was wondering the same thing myself. i’m not really comfortable with most scripting, but i am trying griffin’s new beta software called proxi. it’s free. i think we may be able to use it to program the airclick. actually i’m in a little better shape than you because i have an intel mini that came with apple’s remote, which works fine with mediacentral. i think i’m just going to program the airclick the launch mediacentral and then switch the apple remote after it’s launched. i know that sounds tedious, but until i see a way to either launch mc with apple’s remote or find an airclick hack that programs the airclick, it’s the best i think i can come up with. but search for proxi by griffin.
i need a airclick hack for windows.
plz help me
Casey,
I finally got around to installing Tiger and have recently being playing around with Proxi to get more Airclick functionality out of EyeTV. I’m having problems configuring a Key Press task. After pressing ‘Set’ I can enter apple-p, for example, but cannot enter apple-w. If I enter apple-w, even after pressing ‘set’, the editor window closes. Any ideas?
@f1shf1ghter
Sadly this is a known problem with the key press task (and trigger). Certain elements of the system are able to grab the keystroke before Proxi can get to it, making it tricky to emulate Command-W and a few others. I’m trying to come up with a solution however.
@Florian
Maybe you can configure Proxi using AirClick triggers and Key Presses?
See http://proxi.griffintechnology.com for more details.
Hello,
I am searching a AirClick Script to control iVideo (http://www.waterfallsw.com/ivideo)
If needed I would also pay or pray something for this job 🙂
I hope for some brave helping me 🙂
My AirclickUSB works fine WINDOWSXP but fails to control iTunes on XP Media Center edition.
Is there some patch available to allow it to work on Media Center Edition
Great site!
I also have interest in using AirClick USB to control Windows Media Center Edition. Cant find much information about creating a windows ACP plugin for MCE.
Can any of you guys send me a photo (or diagram) of the conections on the USB connector of the AirClick USB? My over enthusisatic children have broken the coneections on 4 of the 5 wires!
Griffin Tech Support refuse to provide the information…
Thanks
Paul
Sorry, forgot my eMail address;
fishboyo@mac.com
Cheers
Paul
For anyone wanting to hack Sean Wilson’s latest Windows/PC version of AirClick I personally had sucess with hacking the existing Winamp plugin to meet my requirements.
Full story: http://www.teknohippy.net/2006/11/02/hacking-airclick-windows/
Have just bought an AirClick USB. There are shortcots to switch current app, but none (that I have found) to turn the “Control active app” on or off. Would be great if it were implemented in 1.0.7
Is it possible to improve the radius of function of AirClick? I would like to use it on stage but it could be very useful to have a higher radius.