How To Click The Mouse Button From The Keyboard

(for Windows systems)

If you use a paint program or 3D program, for instance, you are sometimes required to place the mouse-pointer over a specific pixel on the screen and then click the mouse button. The problem is that merely touching the mouse can easily make the pointer move one or two pixels off the mark; that also means that you'll have to undo and repeat the operation several times until you can make the click exactly on the right spot, especially if you have your pointer speed to fast. You can click from the keyboard so the mouse pointer can't move out of position during a click.

First, make sure that your "Mouse Keys" are enabled. To test this, press and hold one of the directional keys (arrows) on the numeric keypad -- if the mouse pointer begins to move across the screen, then the mousekeys are enabled. If the pointer doesn't move, then toggle the "Numeric Lock" to it's alternate status (either locked or unlocked) and try again to see if the pointer moves when you hold down an arrow key. If it still doesn't move, go to My Computer/Accessibility Options and click the "Mouse" tab which opens the requester below (left). Put a check mark in "Use Mousekeys." Click the "Settings" button which opens the requester on the right. The first item, "Keyboard Shortcut" -- you don't need to have this checked; it's just another way to toggle Mousekeys on & off, while you can already do this with the Numeric Lock button. You can adjust the Pointer Speed if you want to. The next item lets you decide the on/off status by toggling the Numeric Lock and, lastly, the "MouseKey Status" -- you want to have this item checked.

Having this checked means that you will always have a "mouse icon" in your Task Bar, which looks like this -- What's good about having this icon is that it allows you to quickly re-enable the mousekeys -- even though Windows is supposed to remember that you have "Use MouseKeys" checked, sometimes it doesn't remember this on startup. (Actually, it does remember that you have MouseKeys checked, but for some strange quirk of MS design it sometimes doesn't remember that those settings have been applied). When this happens, simply clicking the mouse icon and then clicking the OK button of the requester that pops up will restore the mousekey function and sves you from going through a bunch of dialog boxes to achieve the same thing. Pressing the Numeric Lock key disables Mousekeys and also causes an "X" to appear over the icon. Now that we know it's functioning, let's go on to a practice exercise in using it.

Keep in mind that every key referred to is on the numeric keypad;

Resize this browser screen so that you can see one of the icons on your desktop. Click an empty space on the desktop so that it is active. Place the mouse pointer over the icon and then click the "5" key. You've just performed a left mouse click, (the icon is now highlighted). If you were using a paint program and had an image "brush" attached to the mouse pointer you would have performed a "paste" of the brush onto the image. You can use the arrow keys to move the brush around pixel by pixel for precise positioning before stamping it in place with the 5 key.




A keyboard click is also handy for scrolling, especially for those not having a "scroll wheel" on their mouse. Instead of trying to keep the mouse pointer over that tiny arrow while successively clicking it to scroll through a very long page, you can place the pointer over the arrow and then leave the mouse alone -- press the "5" key to scroll down a few lines each time.

Now let's simulate the holding down of the mouse button.
Un-highlight the icon by clicking an empty space on the desktop. Place the mouse pointer over the icon again and press the "0" key (zero). You'll see that the icon is highlighted. Now hold down one of the arrow keys and the mouse pointer starts to slide across the screen taking the icon with it. If you were using a brush in a paint program, you would have smeared the brush across the picture. To simulate a release of the mouse button, click the decimal key (.).

To hold down the mouse button without touching the mouse is very nifty if you have to scroll through large pieces of computer code or log files. For instance, when I use my "link checker," it attempts to connect to every hypertext file and link image on my site and creates a text file with thousands of lines which I have to scan through manually -- broken links are highlighted in red, so I'm looking for just a few red lines among thousands. To scroll through the entire list of files could take ten minutes or more. So am I going to keep my finger holding down the mouse button for 10 minutes -- NO! Instead, I place the mouse pointer over the arrow and press the "0" key (zero), then I lean back in my chair with my arms folded and watch as the page scrolls continuously all by itself. When I see a red line start to come up I stop the scrolling by pressing the Space Bar.


How about a right mouse click?
For that we will change modes.
The slash key (/) sets the Left Mode; the minus key (-) sets the Right Mode:

Press the minus key. Place the mouse pointer over the icon and press the "5" key. You've just performed a right mouse click. As you can see, the properties requester for the icon pops up -- just as if you had right-clicked from the mouse. You will remain in Right Mode until you press the slash key (for Left Mode).

Back (to the home page)