|
Wheel scroll not recognized for high resolution mouse |
kovarex
Member #14,203
April 2012
|
It seems, that the library smaller movements of the scroll wheel, more details and info in the bug thread: http://www.factorioforums.com/forum/viewtopic.php?f=7&t=7336 www.factorio.com - a factory building game. |
Thomas Fjellstrom
Member #476
June 2000
|
Wait, you're involved with factorio? Dude! does it use allegro? Interesting problem, we might have to fix some mouse code. I wasn't aware windows would ever give you sub 120 values (I always thought that was an odd number...) -- |
SiegeLord
Member #7,827
October 2006
|
Yeah, the poster in that thread probably nailed the issue. Currently Allegro ignores values that are less than that magical 120 constant. What I think should be done is that we accumulate to a certain constant, and have that constant be configurable via allegro5.cfg: [mouse] # Changes the mouse resolution. Lower values mean higher sensitivity. win_mouse_wheel_resolution = 120 How does that sound? "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Thomas Fjellstrom
Member #476
June 2000
|
Sounds good to me. though maybe it shouldn't be limited to windows. I seem to recall a similar thing in other apis (120 "ticks"). Might be nice to make an api to set/get it as well. That sounds like something a game would put in its input settings menu. -- |
SiegeLord
Member #7,827
October 2006
|
That requires thought and work . Quick glance suggests that X11 just receives discrete button presses for the mouse wheel rotation (my mouse wheel is definitely not high precision, so I don't know what it does for the super-precise ones). OSX appears to be using floating point for its delta-Z values, so that might be a place for such a precision parameter as well. Another obvious solution would be a floating point dz variable, but that's not something easily changed. EDIT: I should say that obviously we can add a precision API that effectively encodes the denominator of the dz value... but would we ever choose to go that route if we had an option of a floating point dz? "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Chris Katko
Member #1,881
January 2002
|
SiegeLord said: floating point dz? What the hell is a float supposed to mean? What's 13.95E-15? Degrees? Kilometers? [edit] Assuming this is the right page: Quote: Rotation (NSEventTypeRotate)—The rotation accessor method returns a floating-point value representing the degrees of rotation, counterclockwise. Is that even possible to ensure? If I plug in two different mice showing up as "generic USB mouse", are they really going to report that the same way? Is the mouse equivalent of DPI in the USB specification? I don't know, I'm making a big deal out of nothing. It just strikes me as strange to turn a mechanical counting device (with a discrete integer number output) into a floating point number. -----sig: |
Thomas Fjellstrom
Member #476
June 2000
|
Chris Katko said: It just strikes me as strange to turn a mechanical counting device (with a discrete integer number output) into a floating point number. In many cases (which mechanical wheels), the wheel is actually three discreet buttons. Probably why X decides to just pass them through. Optical wheels probably just emulate buttons. Quote: What the hell is a float supposed to mean? What's 13.95E-15? Degrees? Kilometers? I presume you'd not likely get more than -1 - 1 out of it. -- |
SiegeLord
Member #7,827
October 2006
|
It's no more arbitrary than +1 and -1 . The floating point value would be the fraction of 1. Anyway, I'm implementing an integer based API, something along the lines of al_set_mouse_wheel_precision(ALLEGRO_DISPLAY *d, int precision). EDIT: And here it is: https://github.com/SiegeLord/allegro5/commit/2f79ba33e01b9b953b8a08c8b08fe4d9c204a514 I'll look it over again tomorrow, and then probably commit it. This fixes both the aforementioned bug, and adds the API to take advantage of those high resolution mice if you want to. EDIT2: I decided I don't like it... might need to rewrite some/all of it... no ETA. EDIT3: Committed the fix as http://sourceforge.net/p/alleg/allegro/ci/d567a7fb30eb511189886cd7d21fc44215dbab44/. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|