-
Notifications
You must be signed in to change notification settings - Fork 328
FIX: Fixed wrong Display Index value for touchscreen events (ISXB-1101)
#2021
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
FIX: Fixed wrong Display Index value for touchscreen events (ISXB-1101)
#2021
Conversation
Display Index value for touchscreen events (ISXB-1101)Display Index value for touchscreen events (ISXB-1101)
| [InputControl(name = "pressure", useStateFrom = "primaryTouch/pressure")] | ||
| [InputControl(name = "radius", useStateFrom = "primaryTouch/radius")] | ||
| [InputControl(name = "press", useStateFrom = "primaryTouch/phase", layout = "TouchPress", synthetic = true, usages = new string[0])] | ||
| [InputControl(name = "displayIndex", useStateFrom = "primaryTouch/displayIndex", format = "BYTE")] // added format to override the Pointer's USHT value |
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.
Looks like a good fix. Thanks for adding the comment to say why format is added to make sure its not removed in future refactorings.
| base.FinishSetup(); | ||
|
|
||
| primaryTouch = GetChildControl<TouchControl>("primaryTouch"); | ||
| displayIndex = primaryTouch.displayIndex; |
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.
Why is this line removed ?
I'd suggest Hakan review this PR since he added this code:
#1623
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.
It's not needed any more since I added the other attributes which override display index and use the state from the primary touch.
Like other overridden values like pressure Wich are already mapped in the base Pointer class.
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.
-works with two displays (1 a touch) showing correct displayIndex
-touch works as per expectations from the user now
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.
LGTM, thanks for fixing this
Description
When reading the
Display Indexof touch event is add 2048 to the value.https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1101
It uses the inherited pointer's
ushortdefinition but for touchscreen it's abyte.Changes made
Fixed the mapping of the
Display Indexfield that doesn't match for touch event.Testing
local testing on multiple screen
Risk
Please describe the potential risks of your changes for the reviewers.
Checklist
Before review:
Changed,Fixed,Addedsections.Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.After merge: