F
FreezerburnVinny
Guest
This is a hybrid half ask for help half request. Basically, GML has (to me) a glaring flaw in its mouse input library functions: the only thing you can detect about the mouse wheel is whether or not it is up or down. There is no information about how much the mouse wheel has been moved. The reason this is important is because the mouse wheel is moved at different rates across different OSs, and even across different installs of an OS depending on the OS-level settings. (e.g.: in the Mouse settings on macOS which has a slider for scroll speed) And across different inputs: trackpad vs a mouse with a real scroll wheel. Considering that macOS is my main OS of choice, I very much care that if I were to make anything the scrolling of any GUI I might make when using the trackpad would look and behave as I'd expect any other program on my computer to behave. (I'm interested in text adventures and made one at one point, so being able to naturally scroll the log of messages was important. I "emulated" it by using a static number of pixels per step if the wheel was moved, but that's not great, especially since I tuned for a macOS touchpad so scrolling with a wheel would feel EXTREMELY slow in comparison due to the rate of wheel events being much higher from a trackpad than a mouse wheel without getting RSI)
As an example of what I'm talking about, SDL has a SDL_MouseWheelEvent. (I'd link to it directly if it wouldn't flag this post for moderator approval) It has x and y values that give you a value representing how much to scroll, not just if the scroll happened. IIRC this should give results similar to scrolling any window in any normal GUI application if you abide by the number given as if it were pixels. I think GUI libraries often give a number that you can use to multiply by in order to show the same scrolling effect you'd normally expect.
So basically it comes down to needing one of two things to make scrolling work "correctly" across OSs: either an extension that can provide the necessary functions for getting OS-specific scroll values, or updating mouse input libraries in GML to provide that information. Ideally YYG would update the mouse library as I feel like it would be relatively easy for them to support that as they already have code for giving mouse input information and it would guarantee it always works. (it definitely feels like a neglected corner of GMS when you compare it to touch event handling and the absolutely phenomenal amount of information given for those, including things like dragging/flicking so you can do some nice smooth scrolling UI elements) But if there's another way to get this I'm still happy to have it available. I wouldn't hesitate to purchase a working extension that does what I'm asking across desktop OSs.
As an example of what I'm talking about, SDL has a SDL_MouseWheelEvent. (I'd link to it directly if it wouldn't flag this post for moderator approval) It has x and y values that give you a value representing how much to scroll, not just if the scroll happened. IIRC this should give results similar to scrolling any window in any normal GUI application if you abide by the number given as if it were pixels. I think GUI libraries often give a number that you can use to multiply by in order to show the same scrolling effect you'd normally expect.
So basically it comes down to needing one of two things to make scrolling work "correctly" across OSs: either an extension that can provide the necessary functions for getting OS-specific scroll values, or updating mouse input libraries in GML to provide that information. Ideally YYG would update the mouse library as I feel like it would be relatively easy for them to support that as they already have code for giving mouse input information and it would guarantee it always works. (it definitely feels like a neglected corner of GMS when you compare it to touch event handling and the absolutely phenomenal amount of information given for those, including things like dragging/flicking so you can do some nice smooth scrolling UI elements) But if there's another way to get this I'm still happy to have it available. I wouldn't hesitate to purchase a working extension that does what I'm asking across desktop OSs.