{"id":5757,"date":"2014-10-15T11:12:11","date_gmt":"2014-10-15T18:12:11","guid":{"rendered":"http:\/\/www.podfeet.com\/blog\/?p=5757"},"modified":"2020-07-19T10:27:49","modified_gmt":"2020-07-19T17:27:49","slug":"movemouse","status":"publish","type":"post","link":"https:\/\/www.podfeet.com\/blog\/2014\/10\/movemouse\/","title":{"rendered":"How Can You Move the Mouse on a Mac a Precise Distance?"},"content":{"rendered":"<p>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&#8217;s Slau&#8217;s original question:<\/p>\n<blockquote><p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/podfeet.com\/NosillaCast\/MoveMouse\/MoveMouseIconSmall.png\" alt=\"MoveMouseIcon that I spent 2 hours creating for people who can't see.\" height=\"200\" width=\"200\" style=\"float: right; margin: 5px;\"\/>Hi Dave and John,<\/p>\n<p>I have an issue that I&#8217;ve been trying to solve for quite some time. In fact, it would help a great deal of blind Mac users such as me.<\/p>\n<p>I&#8217;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&#8217;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&#8217;t exactly repeatable or translatable from user to user.<\/p>\n<p>With VoiceOver, it&#8217;s possible to read the mouse coordinates in inches relative to screen or window but it&#8217;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&#8217;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?\n<\/p><\/blockquote>\n<p><!--more--><br \/>\nOne of my great joys in life is keeping Dorothy, you know her as <a href=\"http:\/\/twitter.com\/maclurker\" target=\"_blank\" rel=\"noopener noreferrer\">@MacLurker<\/a> in the chat room, out of the bars by giving her scripting problems to solve. She&#8217;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.<\/p>\n<p>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 &#8211;  let&#8217;s say I have a super low res monitor like 1024&#215;768, everything is WAY bigger on screen than if you have a modern Retina MacBook Pro at 1440&#215;900.  So if I tell you it&#8217;s a half-inch to the right, wouldn&#8217;t that be way farther than on your Mac?<\/p>\n<p>I contributed very little to this project, but I did find a <a href=\"http:\/\/jacobsalmela.com\/os-x-scripting-how-to-script-a-mouse-click-at-x-y-coordinate\/\" target=\"_blank\" rel=\"noopener noreferrer\">script written by Jacob Salmela back in 2013 that was designed to send the mouse to a specific location<\/a>. Some of the commands he was using have since been deprecated, but his work gave her the seeds of how this could be done.<\/p>\n<p>I&#8217;m going to fast forward to the end of the story.  Dorothy figured out how to query the Mac you&#8217;re using to return the screen resolution of the primary display you&#8217;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.<\/p>\n<p>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&#8217;d have a double click installer that would do all of this but it&#8217;s one of those things that sounds more complicated when it&#8217;s described than it is when you actually do it yourself.<\/p>\n<p>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&#8217;s blue. Yeah, I spent 2 hours creating an icon for an application for the blind.  I feel good about it though!<\/p>\n<p>The Application Dorothy wrote is called MoveMouse. If you&#8217;re a blind Mac user and this sounds fun to you, I&#8217;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&#8217;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.<\/p>\n<p><a href=\"https:\/\/podfeet.com\/NosillaCast\/MoveMouse\/MoveMouse_Installation_and_License.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">MoveMouse Installation Instructions &amp; License<\/a><\/p>\n<p><a href=\"https:\/\/podfeet.com\/NosillaCast\/MoveMouse\/MoveMouseDistribution_1.1.zip\" target=\"_blank\" rel=\"noopener noreferrer\">MoveMouse Zip Distribution File<\/a><\/p>\n<p>Slau says that MoveMouse does exactly what he&#8217;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!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;s Slau&#8217;s original question: Hi Dave and John, I have an issue that I&#8217;ve been trying [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[14,147],"tags":[],"class_list":["post-5757","post","type-post","status-publish","format-standard","hentry","category-accessibility","category-blog-posts"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts\/5757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/comments?post=5757"}],"version-history":[{"count":14,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts\/5757\/revisions"}],"predecessor-version":[{"id":21471,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts\/5757\/revisions\/21471"}],"wp:attachment":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/media?parent=5757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/categories?post=5757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/tags?post=5757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}