-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add screen-related attributes to mouse input events #82800
Conversation
Does this PR address #30950? |
49eead0
to
266b8d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was discussed in an Input PR meeting, and was approved!
Thanks.
266b8d2
to
e01c68b
Compare
How should those fields be filled by platforms that can't query such data? Wayland is mostly window-centric and the mouse position can only be queried in window-space when it's on a surface. |
Poke @Sauermann @bruvzg |
This point was discussed on rocket chat. See https://chat.godotengine.org/channel/platforms?msg=777ZLDf26xiuswuou |
@akien-mga I suppose that they could be merged independently. The WDS doesn't support every feature yet and I'm purposely avoiding to touch it too much to help with reviewing (outside of the pending rebase obviously) Edit: to clarify, my plan is to make smaller PRs right away after merging. Hopefully this will be easier to handle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally (rebased on top of master
63d6bda), it works as expected on Linux in all stretch modes.
This seems to be exactly what I want with relative_unscaled
and velocity_unscaled
coordinates, albeit with a different name. (reduz also proposed global_relative
and global_velocity
terms for this feature, but I can't find the exact issue/PR.)
In terms of naming, I still prefer relative_unscaled
and velocity_unscaled
(as I think they're the most likely terms to be searched by users), even if they are less technically correct.
We should make sure to update documentation and demos to use these new properties if we merge this PR.
Testing project: test_unscaled_relative_input_2.zip
My reasoning for not following the "global"-naming scheme is based on godotengine/godot-proposals#3866. Please let me know, if a different naming-scheme is preferred. In that case I will make the necessary changes. The comment-additions look good at a first glance. Will include them later. |
If |
#78990 would allow adding a search alias 🙂 |
e01c68b
to
f2a538a
Compare
f2a538a
to
2235a1c
Compare
I have updated the PR:
|
I'm trying to review this to help with the Wayland part, but I'm having some troubles understanding some things. I see that you're just setting the same value both for the screen velocity and relative position, yet one is supposed to be scaled while the other not. Where is the scaling happening? |
In the displayserver-context both are identical. Scaling happens in Lines 3338 to 3343 in d335281
The code that actually scales the values is in |
@Sauermann I wonder then if we shouldn't eventually make some of those values "hidden" or anyways set up independently of each DS. There's also the whole issue with fetching the velocity from Anyways, this is probably stuff for another PR, just pointing that out. |
Thanks! |
Add screen velocity and screen relative position to
InputEventMouseMotion
andInputEventScreenDrag
.Based on discussion in RC.
2d
orviewport
stretch mode does not scale mouse coordinates #34805.