What really happens when you click?

King Crete

Prominent
Apr 3, 2017
4
0
510
I'm doing a school project, building a computer, and i'm trying to learn in depth how computers really work. So far, i've been successful and have a pretty good understanding of how all the things in it work. What I cant seem to figure out by searching the web, is what really happens when I click? For example, I put my cursor over google chrome and click. How does the press of my mouse button result in a window opening? Whats going on to make that happen?
 
Solution
Actually you skipped a lot of details there.
When you click on a mouse button, micro switch under the button registers this. (as electric signal) which is then passed to the processor in the mice. (yes, they have one too) which then sends it to computer through cable or bluetooth or whatever. (depends on the type of mice)
If it's usb (most common at this day) then USB controller gets the click event from mouse and forwards it to the OS (we can assume windows)
Edit: Mouse actually records it as separate events like button down, button released and OS decides what it does with them.

Computer then sees that mouseclick happened, checks the coordinates where the mouse was at and acts accordingly. (coordinates of the cursor are NOT stored on...

Aditya657

Distinguished
Apr 11, 2015
69
0
18,660
Far as I think, It works like this. As soon as you click on something then the signal is received into the computer that it is clicking here and here. When you open .Exe files such as Google Chrome in this case, there are certain scripts which fire up as soon as you open that .exe file.

That's why, most applications, games etc. have .exe files with them as the .exe files contain in them the scripts which are responsible for opening all the specific files which are required for the program to run. All the scripts are just run by the PC to make all this happen.
In the cases of links in websites, they are also accompanied by scripts so that as soon as you click them those scripts kick in and redirect you to that specific website for which the link is.
Hope this helps mate and all the very best for your project.
 
Actually you skipped a lot of details there.
When you click on a mouse button, micro switch under the button registers this. (as electric signal) which is then passed to the processor in the mice. (yes, they have one too) which then sends it to computer through cable or bluetooth or whatever. (depends on the type of mice)
If it's usb (most common at this day) then USB controller gets the click event from mouse and forwards it to the OS (we can assume windows)
Edit: Mouse actually records it as separate events like button down, button released and OS decides what it does with them.

Computer then sees that mouseclick happened, checks the coordinates where the mouse was at and acts accordingly. (coordinates of the cursor are NOT stored on the mouse)

since most still have it as default, needing double click to open it, you only selected the icon by single click.
thus you would need to do two clicks in certain time (set in mouse settings) to count as double click which equals "run"
Since target of chrome's shortcut (if we assume 32 bit version) is "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" it does just that, runs said exe.

Said exe contains a lot of coding, which I wont go into
 
Solution

Aditya657

Distinguished
Apr 11, 2015
69
0
18,660

Sorry Senpai for skipping the details XD!
 
I have sense you may know a little hardware and have zero understanding of software. Do a little script programming, that will open up how humans talks to computer and computer responds. Better yet, assembly programming, you get to think what the CPU does.
 

King Crete

Prominent
Apr 3, 2017
4
0
510

Totally right. I do want to get into coding and programming probably over the summer when I have time but you're 100% right.
 

King Crete

Prominent
Apr 3, 2017
4
0
510




Thanks man. (Or girl?)