Disable the mouse input via AppleScript

Discussion in 'Mac Programming' started by Bassir, Aug 1, 2009.

  1. Bassir macrumors member

    Joined:
    Aug 27, 2008
    #1
    Is there any way to disable the mouse input completely via AppleScript?

    I'm interested in creating a script that disable the mouse when the computer is put to sleep—effectively making it so that the mouse cannot disturb the computer's screensaver. Upon return, the mouse input will be enabled again and computer will function normally.

    Is there a command to disable and enable the mouse?
     
  2. mysterytramp macrumors 65816

    mysterytramp

    Joined:
    Jul 17, 2008
    Location:
    Maryland
    #2
    Theoretically, if OS X has the ability to turn off the mouse input, you could create an AppleScript in Xcode and use "call method" to invoke it.

    My question, though, is how are you going to sure that when the Mac wakes up, it's going to call the script that's going to re-enable mouse input? If it misses, for some reason, you might be left a nice doorstop.

    (Well, not really. Mouse input would return after a restart I assume.)

    Might be easier to just shut down or unplug the mouse.

    mt
     
  3. Bassir thread starter macrumors member

    Joined:
    Aug 27, 2008
    #3
    Another script launches at the end of the screensaver.
     

Share This Page