### Hold Time Retrieval Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Get the current duration a key has been held down using `LucidInput.GetKeyHoldTime`. This value updates continuously while the key is pressed. ```C# float time = LucidInput.GetKeyHoldTime(Key.Space); Debug.Log("Space key held for: " + time + " seconds"); ``` -------------------------------- ### Tap Count and Interval Configuration Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Retrieve the number of taps for a key using `LucidInput.GetKeyTapCount`. Configure the maximum duration for a tap with `LucidInput.tapTime` and the interval between taps with `LucidInput.tapInterval`. Both default to 0.2 seconds. ```C# int tapCount = LucidInput.GetKeyTapCount(Key.Space); // Adjust tap detection time to 0.25 seconds LucidInput.tapTime = 0.25f; // Adjust interval between multiple taps to 0.15 seconds LucidInput.tapInterval = 0.15f; ``` -------------------------------- ### Mouse Flick Configuration Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Customize the parameters for flick detection, including the minimum distance required for a flick (`flickMinDistance`) and the maximum time allowed for a flick (`flickTime`). ```C# // Set the minimum distance for a flick to 80 pixels LucidInput.flickMinDistance = 80; // Set the maximum time for a flick to 0.25 seconds LucidInput.flickTime = 0.25f; ``` -------------------------------- ### Namespace Declaration Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Include the LucidInput namespace at the beginning of your C# files to access its functionalities. This allows you to use the custom input classes and enums directly. ```C# using AnnulusGames.LucidTools.InputSystem; ``` -------------------------------- ### Key Enum Conversion Source: https://github.com/annulusgames/lucidinput/blob/main/README.md The custom `Key` enum can be converted to Unity's `KeyCode` or `UnityEngine.InputSystem.Key` for compatibility with existing Unity input methods or the Input System. ```C# Key spaceKey = Key.Space; // Convert Key to KeyCode if (Input.GetKeyDown(spaceKey.ToKeyCode())) { Debug.Log("space key was pressed"); } // Convert Key to UnityEngine.InputSystem.Key if (Keyboard.current[spaceKey.ToISKey()].wasPressedThisFrame) { Debug.Log("space key was pressed"); } ``` -------------------------------- ### Key Press and Release Detection Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Detect the exact moment a key is pressed down (`GetKeyDown`) or released (`GetKeyUp`), similar to Unity's standard Input class. ```C# if (LucidInput.GetKeyDown(Key.A)) { Debug.Log("A key was pressed"); } if (LucidInput.GetKeyUp(Key.B)) { Debug.Log("B key was released"); } ``` -------------------------------- ### Switching Input Handling Mode Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Lucid Input automatically detects and uses the Input System when available. You can manually switch between the legacy InputManager and the new Input System by setting the `activeInputHandling` property. ```C# // Use InputManager (UnityEngine.Input) LucidInput.activeInputHandling = InputHandlingMode.InputManager; // Use InputSystem LucidInput.activeInputHandling = InputHandlingMode.InputSystem; ``` -------------------------------- ### Simulating Mouse with Touches Source: https://github.com/annulusgames/lucidinput/blob/main/README.md By default, Lucid Input simulates mouse input using touch gestures. This allows mouse-based methods to work on touch screens. You can disable this behavior by setting `simulateMouseWithTouches` to `false`. ```C# // Disable simulating mouse input with touches LucidInput.simulateMouseWithTouches = false; ``` -------------------------------- ### Multiple Key Detection Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Check if any of a set of keys are pressed (`GetKeyAny`) or if all specified keys are pressed simultaneously (`GetKeyDownAll`). ```C# // Check if any of A, B, or C keys are held down if (LucidInput.GetKeyAny(Key.A, Key.B, Key.C)) { Debug.Log("A key or B key or C key is held down"); } // Check if A and B keys were pressed simultaneously if (LucidInput.GetKeyDownAll(Key.A, Key.B)) { Debug.Log("A key and B key was released"); } ``` -------------------------------- ### Mouse Button Detection Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Check the state of mouse buttons using `LucidInput.GetMouseButton`. Button indices are 0 for left, 1 for right, and 2 for middle click. ```C# if (LucidInput.GetMouseButton(0)) { Debug.Log("Pressed left click."); } if (LucidInput.GetMouseButton(1)) { Debug.Log("Pressed right click."); } if (LucidInput.GetMouseButton(2)) { Debug.Log("Pressed middle click."); } ``` -------------------------------- ### Mouse Flick Detection Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Detect flick gestures made with the mouse. `GetMouseFlick` can detect any flick or a flick in a specific direction (e.g., `Direction.Right`). ```C# // Detect any flick gesture if (LucidInput.GetMouseFlick(0)) { Debug.Log("flick"); } // Detect a flick specifically to the right if (LucidInput.GetMouseFlick(0, Direction.Right)) { Debug.Log("right flick"); } ``` -------------------------------- ### Mouse Button Tap and Hold Detection Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Similar to key inputs, mouse buttons can also be detected for double taps (`GetMouseButtonDoubleTap`) and hold events (`GetMouseButtonHoldEnded`). ```C# if (LucidInput.GetMouseButtonDoubleTap(0)) { Debug.Log("double click."); } if (LucidInput.GetMouseButtonHoldEnded(1)) { Debug.Log("right button hold ended"); } ``` -------------------------------- ### Simultaneous Press Interval Configuration Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Adjust the time window for detecting simultaneous key presses by modifying `LucidInput.simultaneousPressInterval`. The default value is 0.1 seconds. ```C# // Set the simultaneous press detection time to 0.15 seconds LucidInput.simultaneousPressInterval = 0.15f; ``` -------------------------------- ### Basic Key Press Detection Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Check if a specific key is currently held down using `LucidInput.GetKey`. The system uses a custom `Key` enum for identifying keys. ```C# if (LucidInput.GetKey(Key.Space)) { Debug.Log("space key is held down"); } ``` -------------------------------- ### Tap Detection Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Detect a key tap, which is a key pressed and released within a specific time frame, using `LucidInput.GetKeyTap`. This also supports double taps (`GetKeyDouleTap`) and multiple taps (`GetKeyMultiTap`). ```C# // Detect if the Space key was tapped if (LucidInput.GetKeyTap(Key.Space)) { Debug.Log("tap"); } // Detect a double tap on the Space key if (LucidInput.GetKeyDouleTap(Key.Space)) { Debug.Log("double tap"); } // Detect exactly 4 taps on the Space key if (LucidInput.GetKeyMultiTap(Key.Space, 4)) { Debug.Log("4 tap"); } ``` -------------------------------- ### Hold Detection Source: https://github.com/annulusgames/lucidinput/blob/main/README.md Detect keys being held down for a specified duration. `LucidInput.GetKeyHold` returns true while the key is held after the duration, and `LucidInput.GetKeyHoldEnded` returns true only at the moment the key is released after meeting the hold duration. ```C# // Returns true every frame after Space is held for 1.0 second if (LucidInput.GetKeyHold(Key.Space, 1.0f)) { Debug.Log("hold"); } // Returns true only when Space is released after being held for 1.0 second if (LucidInput.GetKeyHoldEnded(Key.Space, 1.0f)) { Debug.Log("hold ended"); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.