Preventing Unwanted Drag Events #4261
Comments
NoQ commented Yay welcome. At a glance, (1) nowadays we try to avoid custom integer types like UDWORD and use just int whenever possible, (2) now mouseX() and mouseY() are getting evaluated twice (harmless, i guess). Also, i don't remember such problems with my mice. Are you setting some high sensitivity? I can still try to see how it feels. |
wuz21m commented Thanks for your comments. It seems that a weird bug has slipped under my testing. Give me a bit of time to track this down. I'll update the patch then. Sorry! |
wuz21m uploaded file |
wuz21m commented OK I fixed the issue, it had to do with type conversions. I also increased the delta to 50 pixels, it worked pretty well for the tests I made at 1280x720. It is gonna need more tweaking for extra solutions and trade-off between accurate selection and unwanted drag recognition. Basically, if you rapidly click to move (e.g. when panicking and running away from artillery), it repeatedly takes the mixture of quick clicking and minor mouse movement for drag. E.g. a 5x10 pixel drag recognized at some point where you actually wanted to click to get the unit to move. |
wuz21m commented Any updates on this patch? Did anyone test it? |
vexed changed blocking which not transferred by tractive |
vexed changed blockedby which not transferred by tractive |
vexed changed _comment0 which not transferred by tractive |
vexed commented Sorry, been busy with getting the 3.1.2 release ready. What resolution do you play at ? |
wuz21m commented I developed and tried it on 1280x720. I am gathering some usage stats of my own play so I could give good data. I will post them ASAP. |
stiv commented We may need different settings based on monitor resolution. A little data could help figure that out. A smart person could add that to the WZ config file. At the very least, this should work across 640 - 1400 (x resolution). Huge monitor support would be a bonus. |
Per commented We really should reconsider the minimum resolution. Even cheap phones nowadays support 720p (1024x720) at a minimum. |
Per commented So what we need to commmit this patch is a calculated version of the constant '50' that varies depending on the resolution, right? Anyone want to playtest to find a useful scale? |
vexed commented Isn't this kind of change player specific ? |
Cyp commented Does this do something different than changing DRAG_THRESHOLD to 50? Maybe DRAG_THRESHOLD could be made configurable instead? |
type_patch (an actual patch, not a request for one)
| by wuz21mHi, this is my first patch! (Thanks for all the efforts!)
Warzone 2100 has this annoying behavior that even the smallest drag counts as a selection events.
It has happened to me multiple times that when I am clicking furiously to get the units to move, it acts as selection and unselects my units (I wonder how many units I lost to that).
But worry not!
I have written this small patch against display.cpp. When a drag event is to be registered, it uses a simple Manhattan distance. If it is less than a hardcoded value (10 at the moment), it will not register as selection.
Based on my testing, it is taking away many issues!
Issue migrated from trac:4261 at 2022-04-16 11:47:44 -0700
The text was updated successfully, but these errors were encountered: