Search Unity

Gamepad Mouse Issue

Discussion in 'Input System' started by redsandsentertainment, Jul 7, 2020.

  1. redsandsentertainment

    redsandsentertainment

    Joined:
    Jul 7, 2020
    Posts:
    2
    Hello,

    I am trying to implement a gamepad cursor for my game and noticed an issue with the gamepad mouse cursor demo.
    If I set the canvas to scale with screen size and set my resolution high enough (e.g 1920x1080) while using a software cursor, the on-screen position of the cursor doesn't exactly match the placement of UI elements.

    I.E If I hover over one of the buttons nothing happens, but if I hover over random space the buttons hover is triggered.

    The hardware cursor doesn't have this issue.
    The screen bounds for the hardware cursor are equal to the game window size.
    The screen bounds for the software cursor are equal to the canvas size.

    Is this a known bug, or am I doing something wrong in being able to interact with UI elements with a software cursor?

    Repro Steps:
    • Install input system 1.0 version on unity 2019.4 or 2020.1b
    • Download gamepad mouse cursor.
    • Set canvas scalar to "Scale with screen size"
    • Set canvas reference resolution to 1920x1080
    • Make sure the virtual mouse is set to the hardware cursor
    • Hit play
    • Hover mouse over a button
    • Observe *normal* behavior of the onHover being triggered
    • Stop play mode
    • Set virtual mouse to software cursor
    • Hit play
    • Hover mouse over a button
    • Observe how the button *does not* trigger its onHover behavior
     
    Last edited: Jul 7, 2020
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    There's a pending fix which didn't make it yet as it was causing some other regressions. Still hoping this will make it into 1.1.
     
  3. redsandsentertainment

    redsandsentertainment

    Joined:
    Jul 7, 2020
    Posts:
    2
    Thanks for the quick response Rene! Hopefully, this makes it into 1.1.
     
  4. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    yeah ...
    i have this problem too on 1.1.0-preview .1 + unity 2020.1.4f1 :(

    and howto clamp this inside screen borders??