Search Unity

Question Need help! Unity Input System Mouse totally not detected, clicks not happening

Discussion in 'Editor & General Support' started by bearkin333, Dec 3, 2022.

  1. bearkin333

    bearkin333

    Joined:
    Jan 22, 2020
    Posts:
    6
    I am working on a fresh project using Unity's Input System 1.4.4. (Unity Engine Version 2021.3.9f1), Windows system.

    For whatever reason, I'm not getting any input from my mouse whatsoever. I've gone through and idiot-checked everything several times, I'm pretty sure, and it all is supposedly working fine.
    I have an Input Action Asset named Controls, and my Action Map has a binding for "Click". I bound Mouse -> {Left Button} to the Click action, and set up a controller that has a hook for OnClick (I'm using the SendMessages behavior.) When I set Click to be triggered by the Space bar, I confirmed that the entire system was functioning correctly.

    In the Input Debugger, I've noted that my connected mouse does not seem to be showing up under Supported Devices, which may account for the fact that I'm not getting any mouse events whatsoever. I tried plugging in three different mice, but all showed up as Unsupported.

    Is there something big that I'm missing? Any help would be greatly appreciated.

    https://i.imgur.com/i975PkZ.png

     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,907
    Pardon me but the device listed under "Unsupported" seems to be a Razer Anansi, which is a keyboard right? There is indeed a mouse listed under devices which should work just fine.

    Maybe share your code, screenshots of the input actions asset setup (especially the Click action), and screenshots of your console window when you try clicking your mouse.
     
  3. bearkin333

    bearkin333

    Joined:
    Jan 22, 2020
    Posts:
    6
    The code is pretty straightforward, and I've already confirmed that it works successfully with the keyboard. Here's a link just so you can see for yourself:

    https://i.imgur.com/EljC4lm.png

    When the game is running, and I press the space bar, Input Debugger shows events going on the keyboard as normal, and "Click detected" displays in the log. I suppose you're right about the unsupported keyboard thing, but that just mystifies me more. The mouse under supported devices doesn't register any events, as you can see in the following screenshot:

    https://i.imgur.com/Eypafsf.png

    This is the result of me clicking around the playing area, moving the mouse, and just trying to get some sort of reaction.

    Thank you again for your help.
     
    Last edited: Dec 3, 2022
  4. bearkin333

    bearkin333

    Joined:
    Jan 22, 2020
    Posts:
    6
    In case it would help you to note the difference, here's what the properly displaying events from the Keyboard look like:

    https://i.imgur.com/V6lmOb1.png
     
  5. bearkin333

    bearkin333

    Joined:
    Jan 22, 2020
    Posts:
    6
    ISSUE RESOLVED

    And of course, it was something silly. I found out that the option to "Simulate Touch Input From Mouse or Pen" was checked on in the input debugger, somehow, which suppresses mouse events. For anyone else who follows my foolish path, you can turn it off under "Input Debugger -> Options".
     
    lcyyyyyyyy and JayEngel like this.
  6. JayEngel

    JayEngel

    Joined:
    Mar 21, 2021
    Posts:
    6
    OH MY GOD THANK YOU !
     
  7. ringleaderwilliam

    ringleaderwilliam

    Joined:
    Jan 11, 2023
    Posts:
    3
    Thank you very much. This issue has been bothering me for a long time
     
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,662
    I wrote my own MicroTouch class to combine-collect all touches and mouse and present them as a single array of MicroTouches, very analogous to the sealed Unity Touch struct.

    It's a small simple class, give it a whirl if you like:

    https://github.com/kurtdekker/proxi...buttons/Assets/ProximityButtons/MicroTouch.cs

    It's glorious to never again write custom mouse handling code: one code path, mobile and desktop and webGL
     
  9. lcyyyyyyyy

    lcyyyyyyyy

    Joined:
    Nov 24, 2022
    Posts:
    4
    awesome
     
  10. sreekarsai

    sreekarsai

    Joined:
    May 18, 2021
    Posts:
    2
    For me i i was in simulator mode. Mouse clicks only happen in game mode.