Search Unity

Keyboard/Controller/Mouse driven UI

Discussion in 'UGUI & TextMesh Pro' started by drHogan, Jul 9, 2018.

  1. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    201
    Hello guys,

    I have a bit of a problem that I know has already been approached multiple times through the years, but I couldn't find a solution yet.

    I have a fairly simple UI, mostly buttons for a game menu. With mouse controls it works like a charm, but I am now integrating a controller into the game. I would like the UI to work therefore with both mouse and keyboard/controller (stick and buttons).

    It's mostly about moving around, selecting actions, clicking, going on, etc for the profile selection, checking the leaderboards, etc etc.

    It sounds trivial but it's not. For example, when an element is selected through keyboard, even if I move my mouse pointer over another element, therefore highlightning the new one, when I click the left button of the mouse, the one selected (even though selected and highlighted look the same) from the keyboard system reacts.

    I've been reading of this issue showing up for the last few years, is it still so? Is there a fix or a clean workaround that doesn't imply hours of creepy coding only to get this basic feature working?

    Thanks in advance for your time!
    Cheers,
    H