Skip to content

Fixes for left-handed use (logitech)#776

Draft
andybak wants to merge 2 commits into
mainfrom
fix/logitech-handedness
Draft

Fixes for left-handed use (logitech)#776
andybak wants to merge 2 commits into
mainfrom
fix/logitech-handedness

Conversation

@andybak

@andybak andybak commented Oct 11, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@mikeage mikeage changed the title Fixes for left-handed use Fixes for left-handed use (logitech) Oct 14, 2024
@mikeage mikeage added the bugfix Something has been fixed label Oct 14, 2024

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve Logitech MX Ink stylus behavior for left-handed use by adjusting how the stylus’ active hand is detected, how controller roles are swapped, and how stylus input is routed in UnityXR.

Changes:

  • Update MX Ink hand assignment detection and add logic to swap Brush/Wand roles when the stylus and wand would otherwise be assigned to the same hand.
  • Change controller visibility behavior when the stylus is active/inactive.
  • Adjust UnityXR stylus-activity detection used to map trigger/grip/button inputs to stylus inputs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
Assets/ThirdParty/Logitech/Scripts/VrStylusHandler.cs Adds handedness tracking + controller-swap logic and changes how controller models are shown/hidden when the stylus is present.
Assets/Scripts/Input/UnityXRControllerInfo.cs Changes stylus-activity gating used to decide when to read stylus tip/cluster inputs instead of controller inputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

private float _hapticClickAmplitude = 0.9f;
private float _hapticClickMinThreshold = 0.2f;

private OVRPlugin.Hand prevHandSetting = OVRPlugin.Hand.None;

// Select the right/left hand stylus pose to be used
string MX_Ink_Pose = _stylus.isOnRightHand ? MX_Ink_Pose_Right : MX_Ink_Pose_Left;
// Not sure why but this works whether stylusIsAssignedRight or stylusIsAssignedLeft
Comment on lines +128 to +129
InputManager.Brush.ShowController(false);
InputManager.Wand.ShowController(true);
Comment on lines 134 to 137
private bool IsStylusActive()
{
return stylusState.isActive && isBrush;
return stylusState.isActive;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something has been fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants