A little while ago, good friend of the show Slau wrote to the Mac Geek Gab boys, Dave Hamilton and John F Braun with a very interesting request. Dave included me on distribution thinking I might have some ideas. Here’s Slau’s original question:
Hi Dave and John,
I have an issue that I’ve been trying to solve for quite some time. In fact, it would help a great deal of blind Mac users such as me.
I’m trying to find a way to move the mouse pointer in fixed increments (pixels or inches, whatever) using only the keyboard or preferably the numeric keypad. While there’s a way to move the pointer using Mouse Keys (within the Accessibility pane of System Preferences), the result is based on factors like delay and speed and vary according to how long you hold down the key so results aren’t exactly repeatable or translatable from user to user.
With VoiceOver, it’s possible to read the mouse coordinates in inches relative to screen or window but it’s not possible to enter coordinates manually. An example of where moving the pointer manually would be helpful and even necessary is when there are invisible elements on screen that are not recognized by voiceOver but need to be clicked. One can navigate to the closest recognizable element and then manually move the pointer from there. I’m thinking there might be an AppleScript or something that could perform the mouse pointer movement and it could be triggered by a keyboard shortcut. What do you think?
One of my great joys in life is keeping Dorothy, you know her as @MacLurker in the chat room, out of the bars by giving her scripting problems to solve. She’s like a dog with a bone when she gets a fun project like this and will run it down until she solves it and could not be happier the whole time. She and I work out together so we use that 45 minutes or so on the elliptical to noodle ideas.
We started by noodling questions on how you would ever figure out distance on a screen since screen resolutions are different. If you think about the extreme example – let’s say I have a super low res monitor like 1024×768, everything is WAY bigger on screen than if you have a modern Retina MacBook Pro at 1440×900. So if I tell you it’s a half-inch to the right, wouldn’t that be way farther than on your Mac?
I contributed very little to this project, but I did find a script written by Jacob Salmela back in 2013 that was designed to send the mouse to a specific location. Some of the commands he was using have since been deprecated, but his work gave her the seeds of how this could be done.
I’m going to fast forward to the end of the story. Dorothy figured out how to query the Mac you’re using to return the screen resolution of the primary display you’re using AND physical size of that same display. She then programmed in how to translate pixel movement to physical distance. During our testing phase, I made her add a noise to the script using the command afplay that Bart just taught us a little while ago. It worked great but I have to admit when we shipped the finished product, Slau said the noises drove him nuts so we took them out.
She wrote all of this in Objective C, put it into Automator to create an Application she called MoveMouse. She also created a set of four services called by the application which need to live in your ~/Library/Services directory. Once these four services are in place, you can assign keystrokes to them using the built-in Keyboard shortcuts in System Preferences. Ideally we’d have a double click installer that would do all of this but it’s one of those things that sounds more complicated when it’s described than it is when you actually do it yourself.
I like to think I added value to this project, even though Dorothy is actually the one with the brains. One of the HUGE values I added though was to create a really pretty icon for the application that shows a mouse moving diagonally. It’s blue. Yeah, I spent 2 hours creating an icon for an application for the blind. I feel good about it though!
The Application Dorothy wrote is called MoveMouse. If you’re a blind Mac user and this sounds fun to you, I’ve put two things in the shownotes. The first is the Installer and License file for MoveMouse. This is not an optional ReadMe file, you absolutely will have no clue what to do with the files if you don’t read at least the installer part! The second is a zip file with the MoveMouse Application and the four services, all nicely bundled up.
Slau says that MoveMouse does exactly what he’s hoping for and works great. Please give us feedback on whether this works for you and whether it actually solves a real problem for you!