Closed qindapao closed 10 months ago
At the same time, I also fixed another problem, which is what you mentioned before. The mouse wheel event on your computer is GDK_SCROOL_SMOOTH.
In GTK3, the behavior of mouse wheel events may vary depending on the operating system. On Windows systems, wheel events are usually mapped to GDK_SCROLL_UP
and GDK_SCROLL_DOWN
. However, on Linux systems, many modern mouse devices and touchpads support pixel-level smooth scrolling, so wheel events may be mapped to GDK_SCROLL_SMOOTH
.
The GDK_SCROLL_SMOOTH
event provides a continuous amount of scrolling, which is useful for achieving smooth scrolling effects. However, if Our application needs to handle traditional scroll wheel events (such as GDK_SCROLL_UP
and GDK_SCROLL_DOWN
), we may need to do some extra work when handling GDK_SCROLL_SMOOTH
events.
In general, this difference is mainly due to differences in how different operating systems handle mouse wheel events, as well as differences in mouse hardware and drivers
Handle the GDK_SCROLL_SMOOTH
event to identify the scrolling direction of the mouse wheel. We can use the gdk_event_get_scroll_deltas()
function to get the scroll delta. This function will return two values, delta_x
and delta_y
, which represent the scroll increment of the mouse wheel on the x-axis and y-axis respectively.
In most cases, we only care about the y-axis scroll increment, since the mouse wheel usually only scrolls in the vertical direction. A positive value of delta_y
means the mouse wheel scrolls down, and a negative value means the mouse wheel scrolls up.
Now on your computer you can use ctrl+mouse wheel to zoom in and out.
@qindapao good work, I added a comment on the code, if you change it today I'll merge it and try to make a cpan release today.
@nkh I'm outside now, and I'll deal with it as soon as I get home.
@nkh Hello, this is the repaired branch, I compressed it into one commit
https://github.com/qindapao/P5-App-Asciio/tree/fix_for_code_review
merged in 43103aa
@nkh I wrote a document for the installation in the WSL environment, and I put the link in our mdbook.
https://github.com/qindapao/P5-App-Asciio/tree/doc_for_wsl
In addition, remote desktop is still not that smooth to use, but it is basically usable.