npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

com.phantomsxr.xrmodinput

v1.4.9

Published

The XRMOD Universal input module.

Readme

XRMODInput Module

The XRMODInput module is a core component of the XRMOD Engine, designed to provide a unified, platform-agnostic API for handling user input across various XR devices. It abstracts the complexities of different input modalities—such as hand tracking, specialized XR controllers, gaze, and traditional peripherals—into a consistent and easy-to-use interface.

🚀 Key Features

  • Unified API: Access hand tracking and controller data through a single entry point (UniversalXRInput).
  • Platform Agnostic: Supports Unity XR Interaction Toolkit (XRI), OpenXR, and vendor-specific SDKs (Meta Quest, PICO, Rokid, etc.).
  • Modality Switching: Seamlessly switch between hand tracking and controller input at runtime.
  • Haptic Feedback: Robust cross-platform vibration system for iOS and Android.
  • Gaze Interaction: Built-in eye-tracking and head-tracking fallback logic.
  • Locomotion Mediation: Advanced management of locomotion states (teleport vs. smooth movement) to prevent input conflicts.

📦 Module Structure

  • Common: Contains the core UniversalXRInput class and logic for hand/controller data retrieval.
  • Vibration: Cross-platform haptic feedback utilities.
  • XRI: Integration with Unity's XR Interaction Toolkit, including gaze management and controller orchestration.
  • Enums: Shared definitions for input types, interactor modes, and controller keys.

🛠 Getting Started

Accessing Input

The main entry point for the module is the UniversalXRInput singleton.

using Phantom.XRMOD.XRMODInput.Runtime;

// Get the current input modality
InputType currentType = UniversalXRInput.GetInstance.GetCurrentInputType();

if (currentType == InputType.NatureHands) {
    // Handle hand tracking logic
}

Hand Tracking

Retrieve joint poses or pinch status easily:

if (UniversalXRInput.GetInstance.TryGetPinch(Handedness.Right)) {
    Debug.Log("Right hand pinching!");
}

// Get the pose of the palm in world space
if (UniversalXRInput.GetInstance.TryGetJointPose(XRHandJointID.Palm, XRNode.LeftHand, out Pose palmPose, true)) {
    Debug.Log($"Palm position: {palmPose.position}");
}

Haptic Feedback

Trigger vibrations on mobile devices:

using Phantom.XRMOD.XRMODInput.Runtime;

// Trigger a soft impact haptic on iOS
Vibration.VibrateIOS(ImpactFeedbackStyle.Soft);

// Trigger a short vibration on Android
Vibration.VibrateAndroid(50);

Gaze Interaction

The GazeInputManager automatically handles fallback when eye tracking is unavailable:

// Enable or disable head-tracking fallback
gazeManager.FallbackIfEyeTrackingUnavailable = true;

💡 Best Practices

  1. Use UniversalXRInput: Avoid using legacy UniversalInput or platform-specific APIs directly.
  2. Check Modality: Always verify the current InputType before performing modality-specific operations.
  3. Handle Shared Space: Be aware that certain features (like detailed pinch progress) may only be supported in FullSpace modes.
  4. Locomotion Safety: Use ActionBasedControllerManager to mediate between teleportation and smooth movement to avoid confusing the user.

⚠️ Common Pitfalls

  • Missing XRI: Ensure USE_XRI is defined in your project settings if you are using the XRI-based features.
  • Handedness Mismatch: Double-check XRNode.LeftHand vs XRNode.RightHand when querying joint data.
  • Android Vibrations: Remember that Android vibrations require the VIBRATE permission in the Manifest.
  • Obsolete APIs: Do not use UniversalInput; it is kept for backward compatibility but marked as obsolete.

Developed by PhantomsXR Ltd.