What happens when you move your mouse

A computer mouse works by tracking its own movement across a surface and sending that position data to your computer many times per second. Inside the mouse, a light source and a camera work together to photograph the surface beneath it, then compare each new photo to the one before it. When the photos differ, the mouse calculates how far it moved and in which direction, then sends those numbers to your computer. Your computer uses those numbers to move the cursor on your screen to match.

This happens so fast—typically 125 to 8,000 times per second depending on the mouse—that the cursor movement feels when ready to you. The speed at which a mouse sends updates is called its polling rate, measured in hertz (Hz). A mouse with a 1,000 Hz polling rate sends position data 1,000 times each second.

Key Takeaways

  • Modern mice use an LED light and a small camera to photograph the surface below them thousands of times per second and detect movement by comparing those images.
  • The mouse sends X and Y coordinate changes to your computer, which moves the cursor on screen to match the mouse's physical position.
  • Clicking the mouse button sends a separate signal to your computer that tells it a click happened at the current cursor location.
  • Wireless mice use radio signals (usually 2.4 GHz) or Bluetooth to send movement and click data instead of a physical cable.
  • Mouse sensitivity, measured in DPI (dots per inch), controls how far the cursor moves for a given physical movement of the mouse.

How the optical sensor detects movement

The optical sensor in a mouse is a small camera paired with an LED light, usually red or infrared. The LED shines down onto the surface your mouse sits on—a desk, mousepad, or any flat surface. The camera takes a photograph of that surface roughly every millisecond (or faster, depending on the polling rate). Each new photo captures tiny details of the surface texture: dust, scratches, weave patterns in fabric, or grain in wood.

The mouse's processor compares each new photo to the previous one and looks for patterns that have shifted. If the texture pattern has moved 5 pixels to the right in the new photo, the mouse knows it moved 5 pixels to the right. It calculates the distance and direction, then sends those numbers to your computer as X and Y coordinates. This process is called optical tracking, and it works on almost any surface except glass or mirrors, which are too smooth and reflective for the camera to find texture details.

Older mice used a mechanical ball and rollers instead of a camera. The ball rolled across the surface and spun two rollers inside the mouse—one for horizontal movement and one for vertical. The rollers had notches that interrupted a light beam, and the mouse counted the interruptions to measure distance. These mice were slower, less accurate, and required regular cleaning because dust clogged the rollers. Optical mice replaced them almost entirely by the early 2000s.

How clicks and button presses reach your computer

When you press the left, right, or middle button on your mouse, you press down a plastic lever that sits on top of a switch. The switch is an electrical component that closes a circuit when pressed. Closing the circuit sends a signal to the mouse's processor that says "left button pressed now." The processor adds a timestamp and sends that signal to your computer along with the current cursor position.

Your computer receives the click signal and the cursor location together, so it knows exactly where on the screen you clicked. If you clicked on a button in a web browser, the browser reads that the click happened at those coordinates and performs the action linked to that button. When you release the mouse button, the switch opens again, and another signal tells your computer "left button released now."

Most mice use mechanical switches under the buttons, which are reliable and cheap. Gaming mice sometimes use optical switches instead—these use a light beam that breaks when you press the button, rather than metal contacts touching. Optical switches respond slightly faster (by a few milliseconds) and last longer before wearing out, but they cost more.

Wired versus wireless: how the signal reaches your computer

A wired mouse connects to your computer through a USB cable. The cable carries both power (so the mouse doesn't need batteries) and data (the movement coordinates and click signals). The data travels as electrical pulses down the cable at high speed, arriving almost when ready.

A wireless mouse has no cable and instead sends data through the air using radio waves. Most wireless mice use a USB receiver—a small dongle that plugs into your computer's USB port. The mouse transmits its movement and click data to this receiver on a frequency of 2.4 GHz (the same frequency used by Wi-Fi and Bluetooth). The receiver picks up the signal and passes it to your computer. Some newer mice use Bluetooth instead, which means they can connect directly to your computer without a separate receiver.

Wireless mice need batteries because they have no cable to draw power from. The radio transmission uses very little power, so a pair of AA or AAA batteries typically lasts several months. The tradeoff is that wireless mice have a tiny delay (usually 1 to 5 milliseconds) between when you move the mouse and when the cursor moves on screen, because the signal has to travel through the air. For most everyday tasks this delay is unnoticeable, but competitive gamers often prefer wired mice to eliminate it entirely.

What DPI means and why it matters

DPI stands for "dots per inch" and controls how sensitive your mouse is. A mouse with a DPI of 800 will move the cursor 800 pixels on your screen for every inch you physically move the mouse. A mouse with a DPI of 3,200 will move the cursor 3,200 pixels for the same inch of movement—four times as far.

Higher DPI means you need less physical movement to reach distant parts of your screen, which is useful on large monitors or if you have limited desk space. Lower DPI means you have finer control over the cursor, which helps with precise tasks like photo editing or drawing. Most mice let you change the DPI through software, and some gaming mice have a button on the side to switch between preset DPI levels on the fly.

DPI is different from polling rate. DPI controls the sensitivity of the movement, while polling rate controls how often the mouse reports its position. A mouse with high DPI and low polling rate will move far but jerkily; a mouse with low DPI and high polling rate will move slowly but smoothly.

Why your mouse sometimes loses tracking

An optical mouse loses tracking when the surface is too reflective or too smooth for the camera to see texture details. Glass, mirrors, and glossy surfaces reflect the LED light back into the camera instead of scattering it, so the camera cannot see a clear image. Transparent surfaces like glass are especially problematic because the light passes through them instead of bouncing back.

Wireless mice can lose connection if the USB receiver is too far away (usually beyond 10 feet), if there are obstacles between the mouse and receiver, or if the batteries are dead. Interference from other 2.4 GHz devices like Wi-Fi routers or microwaves can also cause temporary dropouts, though modern mice use frequency-hopping to avoid this.

If your mouse cursor jumps around erratically or stops responding, try cleaning the bottom of the mouse with a dry cloth to remove dust from the optical sensor. If you are using a wireless mouse, try moving the receiver closer or replacing the batteries. If the problem persists, the optical sensor or the switch may be damaged.

How your computer interprets mouse data

Your computer's operating system (Windows, macOS, or Linux) has a driver—a piece of software that knows how to read the data coming from your mouse. The driver receives the X and Y coordinate changes and the click signals, then translates them into actions. If the coordinates say the mouse moved 10 pixels right and 5 pixels down, the driver moves the cursor 10 pixels right and 5 pixels down on your screen.

The operating system also applies any settings you have configured, like pointer speed or acceleration. Pointer acceleration makes the cursor move faster if you move the mouse quickly, which helps you reach distant parts of the screen without lifting your hand. You can usually turn acceleration off in your mouse settings if you prefer a 1:1 relationship between physical movement and cursor movement.

When you click, the driver sends the click event to whatever process is currently in focus—your web browser, text editor, or game. That process then decides what to do with the click based on where the cursor was when you clicked.

Frequently Asked Questions

Why does my mouse cursor sometimes stutter or lag?

Stuttering usually means the polling rate is too low for your monitor's refresh rate, or your computer is busy processing other tasks. If your monitor refreshes 144 times per second but your mouse only reports its position 125 times per second, the cursor position will appear to jump. Increasing the mouse's polling rate (if it supports it) or closing background programs can help. Wireless mice may also stutter if the batteries are weak or the receiver is far away.

Can I use a mouse on any surface?

Optical mice work on most surfaces—wood, plastic, fabric, and paper all have enough texture for the camera to track. Glass, mirrors, and very glossy surfaces do not work because they are too reflective. A mousepad gives the mouse a consistent, textured surface to track on, which improves accuracy and reliability, but it is not required for most mice.

What is the difference between a gaming mouse and a regular mouse?

Gaming mice typically have higher polling rates (up to 8,000 Hz instead of 1,000 Hz), adjustable DPI settings, and faster response times. They often have extra buttons on the side that you can program for specific games. The higher polling rate reduces the delay between moving the mouse and seeing the cursor move, which matters in fast-paced games. Regular mice prioritize comfort and battery life over speed.

Do I need a mousepad?

A mousepad is not required, but it improves tracking consistency and protects your desk surface from wear. Mousepads give the optical sensor a uniform texture to track on, which is especially helpful if your desk is very smooth or has a shiny finish. A mousepad also reduces friction, so the mouse glides more smoothly.

Why do some mice have more buttons than others?

Extra buttons are programmable shortcuts. A mouse with side buttons lets you bind them to "back" and "forward" in your web browser, or to custom commands in games or design software. Standard mice have left, right, and middle buttons because those are the most common actions. Extra buttons are optional and useful only if you configure them for tasks you do frequently.