- Home /
Input System: How To Prevent Mouse From Auto-Switching Control Scheme?
I am making a game where the mouse is only used as a secondary pointer device for menu navigation. Use of mouse is 0% necessary and is completely optional, but provided for UI convenience.
I am using the InputSystem package.
Whenever the mouse is moved, the current control scheme automatically changes from whatever is current to "Keyboard&Mouse". I want to keep automatic control scheme switching based on keyboard/gamepad/joystick input, and I want the player to be able to use the mouse for UI input, but I want to remove the mouse from the automatic control scheme switching equation entirely.
How can I accomplish this?
Answer by SmilingCatEntertainment · May 06 at 04:05 PM
Figures that five minutes after I post this question I figured it out.
The key is not to remove the Mouse device from the Keyboard&Mouse scheme, but to ADD the Mouse device to all other schemes (i.e. Gamepad and Joystick schemes).
Editing the schemes themselves is not entirely straightforward:
Open the Input Action Asset
In the upper left uncaptioned dropdown, choose the control scheme you want to edit.
Open the same dropdown again, and this time choose "Edit Control Scheme..."
From there you can add the Mouse device to the Control Scheme. In my case I made it optional.
Once I did this, moving the mouse did not cause my Control Scheme to change. Oh Happy Day!
Thank you everyone for helping me "rubber duck" this one.
Your answer
![](https://koobas.hobune.stream/wayback/20220613060240im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
OnTriggerEnterinputLight 1 Answer
Not Getting actual touch position ,Getting (0.0, 1.0, 0.0) on every touch 0 Answers
Lazy initialization of a MonoBehaviour derived class without singleton 3 Answers
What is the input manager for? 1 Answer
Need help converting this script to work with the new input system 0 Answers