USB Panic Button - Working on Mac

Discussion in 'Mac Programming' started by nicksoper, Jul 28, 2010.

  1. nicksoper macrumors member

    nicksoper

    Joined:
    Mar 6, 2006
    Location:
    Cape Town
    #1
    Hey There,
    Last night I got given a USB Panic Button (Link to page here) but the software only works on PC.

    I am not expecting anyone to write me any code, but it would be really nice if someone could point me in the right direction to read up about how to record a USB event on a mac, then run a script, and what kind of script would be suitable to run (I have dabbled in a bit of light Applescript previously)

    If I get it working, I would then share it with fellow panic button mac users.

    Nick
     
  2. jared_kipe macrumors 68030

    jared_kipe

    Joined:
    Dec 8, 2003
    Location:
    Seattle
    #2
    First things first, in SystemPreferences-> Language&Text-> InputSources
    Check off the box for "Keyboard & Character Viewer".

    Then open the keyboard viewer from the small icon by the clock.

    This will allow you to see when "keys" are pressed/held down. Its possible this thing just acts as a keyboard and sends a key combo for their software to watch out for.
     
  3. larkost macrumors 6502a

    Joined:
    Oct 13, 2007
    #3
    If it does not simply present itself as a single-key keyboard, then you are probably out of luck. Writing drivers is not an AppleScript-esque exercise.
     
  4. nicksoper thread starter macrumors member

    nicksoper

    Joined:
    Mar 6, 2006
    Location:
    Cape Town
    #4
    Unfortunately the usb event does not present itself as a keyboard input.

    Anyone got any ideas as to where to start programming an app that could pick this up?

    It's a bit daunting, but I did do Java at uni, and I have been using PHP for the last couple of years. I could do with a new challenge.

    Thanks for the help so far.

    Installing X-Code, reading about Cocoa. Gonna see where that takes me.
     
  5. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #5
  6. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #6
    Well I got my hands on the device and figured I'd give it a shot. It was a little odd but I got it working, so I made an app that lets you run an AppleScript whenever the button is hit. Requires 10.6, you can download here. Source code available.

    Have fun :)
     
  7. nicksoper thread starter macrumors member

    nicksoper

    Joined:
    Mar 6, 2006
    Location:
    Cape Town
  8. metade macrumors newbie

    Joined:
    Aug 17, 2010
    #8
    Any chance of a 10.5 version?
     

Share This Page