I have been building this prototype, and recently set it up to support both mouse+keyboard play as well as gamepad. I additionally have HUD glyphs set up to auto-update to the respective images whenever a new input method is detected at runtime, so you can seamlessly switch to gamepad or vice versa while the game is running.
What I need to happen is for the cursor to show when MnK is detected, or hide the cursor when gamepad input is detected. The part I have been stuck on is that the cursor won’t actually hide when I start pressing buttons on my gamepad, and I don’t know why or how to get it to hide as intended.
My architecture goes something like this:
-
I have the CommonUI plugin enabled, and inside my controller blueprint, I have it bind to a delegate called OnInputMethodChanged, which originates from CommonInput
-
When this delegate is broadcast, it returns a ECommonInputType enum which tells me whether MnK, gamepad, or another input type was the most recently detected one; so I simply check if it is MouseAndKeyboard to decide if ShowMouseCursor should be set to true or false (see picture)
I have tested this with a wired xbox gamepad connected, and even put print strings in all the right places to confirm the code is executing as it should, and I can confirm that:
- OnInputMethodChanged is firing when, I started playing in editor on MnK but then touched something on my gamepad, or vice versa
- The enum is returning ‘MouseAndKeyboard’ when the last input pressed was either from my mouse or from my keyboard
- The enum is returning ‘Gamepad’ when the last input pressed was on my xbox gamepad
- Print strings at runtime show that ShowMouseCursor is successfully being set to false as I have coded it to when the gamepad is detected, yet the cursor is not actually being hidden from the screen in these cases
Some things I have tried:
- As shown in the picture I have tried playing around with setting the input mode to Game Only in certain places because I had seen some other reports about that somehow being the fix, but in my case it has not changed anything no matter where I call it
- As a test I threw in a debug event on H wherein it simply toggles ShowMouseCursor back and forth, so I can just run the game and spam H on the keyboard, which seems to hide and show the cursor as it should. So it seems that cursor hiding somehow behaves differently when gamepad input is involved?
Other than that I am not sure what the proper fix is here. The Xbox gamepad I have been using is also kinda bad quality and has suffered some wear and tear but it is still functional enough to test something as simple as this; not sure if somehow the quality of the gamepad has anything to do with this though.
I do have some widgets that are in persistent use while the game is running but also don’t know how those might play into this. None of them are focusable as far as I know, and despite how much code is in some of the widgets, I never give them any authority over showing the mouse cursor or let them talk directly to my controller class (it’s usually the controller talking to them instead)
What am I doing wrong, and how can I allow use of gamepad input while still dynamically hiding/showing the cursor when needed?

