norandomtechie / ece270-simulator

Source code for Web-Based Verilog Simulation Platform in ECE 27000 at Purdue University
25 stars 5 forks source link

Push buttons do not register a onmouseup event #3

Closed hadiahmed098 closed 4 years ago

hadiahmed098 commented 4 years ago

When a push button is depressed, the <rect> tag surrounding it decreases in size. If the user's mouse cursor is outside the boundary of the new rectangle, the button does not register a onmouseup event. The button remains depressed as if the user held 'shift'.

It might be possible to wrap the button in a <rect> or <div> tag that is unchanging in size. This way the button will be released even if the user is outside the boundary of the smaller, depressed rectangle.

hadiahmed098 commented 4 years ago

Conversely, this could lead to the button registering a onmouseup even if the cursor is outside the graphical button rectangle.

norandomtechie commented 4 years ago

This phenomenon is actually discussed in the Help page on the Verilog simulator - it was originally a bug that we just decided to treat as a feature. Navigate to md/tipsandtricks.md, or on the course simulator, go to the Help page (via the Help icon at the top), click Tips and Tricks in the page that opens, and go to the fourth point of "Holding down buttons on the simulator".

It's just a handy trick to avoid having to hold down Shift while clicking if you want to only use the mouse to hold down multiple buttons.

I'm very impressed with these findings. Thanks for letting us know.