How Does a Mouse Work?

if you're watching this video on a

computer then I would assume that you

used your mouse to do so by moving your

cursor and clicking on the thumbnail now

have you ever wondered what exactly it

is inside of your mouse that allows it

to replicate the movement of your hand

to the movement of a little cursor on

your screen if you have then you're in

the right place because that's what I'll

be going over for this video to start

with I'll be talking about optical mice

which are pretty much the only kind that

are still in use today if you hold the

mouse slightly above the surface it's on

you might notice a little red glow and

even if you don't see that you can still

see that your mouse has a little hole in

it like mine does right here inside that

hole there's an optical sensor that is

essentially just a tiny little camera

with an extremely fast frame rate that

is to say it takes a ton of pictures per


there's also a small illuminating light

usually an LED that illuminates the

surface beneath it which the mouse is

placed on this little camera in your

mouse constantly takes pictures of the

illuminated surface it's on and then

compares that picture to the previous

one by comparing these two images the

computer has all the information it

needs to figure out how far your mouse

has been pulled along the surface and in

what direction the resolution and frame

rate of the camera in your mouse

determine how accurate smooth and

reliable the cursor movement is if the

mouse took only 100 pictures per second

and you moved your mouse really fast it

might have a completely different image

than the one it had just before with no

overlap and as a result it'll have no

way of knowing where the mouse is in

relation to where it was beforehand as a

result it won't be able to properly

replicate that movement onto your screen

now likewise if it's resolution were too

low let's say only fifty dots per inch

it might have trouble comparing the

features that define the surface that

it's placed on and will get confused

you'll see here that the mouse has

actually moved further than the camera

realizes but because it has such a low

resolution it basically has to make

assumptions about how specific that

movement actually

it's for this reason that in most

optical mice the camera actually has a

frame rate of at least two thousand

pictures taken each second though some

can have as much as six thousand and

they have a resolution of about 1600

pixels per inch and can have as many as

four thousand while two thousand images

per second might seem mind-blowing keep

in mind that neither your mouse nor

computer have to store these images once

one frame is compared to the previous

frame the previous frame is immediately

discarded so no data storage is needed

it's worth noting that the technology

and optical mice was actually pioneered

by the military for tracking targets

from aircraft the calculations on how

much the mouse has moved and in which

direction are all done by very simple

processing chips in the mouse itself and

then it sends that information to your

CPU your computer does the rest of the

work from here with that data and

translates it into the actions you see

on your screen these calculations in

your CPU occur in what's known as the

kernel which is one of the lowest levels

of operating systems in your computer

this handles all the fundamentally

important instructions that keep your

computer functioning including being

able to receive control inputs such as

the mouse this is why sometimes when

your programs freeze up for a moment you

can still move the mouse just fine that

process is given priority over all else

because without it you couldn't even

interact with the computer to begin with

well optical mice are the norm today

there was a time when ball mice were the

norm now these mice instead of using a

small little camera and LED had a rubber

ball placed in the middle of them which

rolled around as you pulled the mouse

across a surface and as this ball rolled

it caused these two little adjoining

wheels to turn as well which gave your

mouse all the data it needed about how

it was moving on a two-dimensional x and

y plane you may also have seen some of

the mice that are controlled by actually

rolling a big ball around with your

fingers and these mice use the exact

same mechanical system but have the

advantage of being able to be used in

situations where you didn't have access

to a large flat surface and that

concludes this video if you're

interested in more videos on the topic

liking and sharing is a good way to let

me know that and feel free to leave a

comment with any

questions you may have