Switching "show mouse cursor" from on to off loses focus in PIE window

I have very similar issue, I need to use hardware cursor because my game is RTS and software cursor is too laggy. So I enabled “show mouse cursor” and these are my issues:

1.) Game windows has focus only when I click, immediately on release game windows lost focus. This means I can use free look only when holding button.

2.) Cursor is not locked in game viewport. It can go out of game windows easily and that is not good for me because I need to pan map when cursor is near edge of window.

Set Input Mode node seems to do nothing. Tried all nodes and all settings.

Btw. Feature request: It would be good to give better options and change variable naming. I belive it should not be named “show mouse cursor”, maybe it should be something like “enable hardware cursor”

1 Like

Hello ,

Have you tried using the Set input nodes (Set input UI only, Set Input Game Only, Set Input UI and Game)? These nodes will allow you to lock the mouse to the screen as well as manage the focus on the viewport.

Hely, thank you for quick answer Rudy :slight_smile:
I found the reason why Set Input nodes do nothing for me. Using them on Begin Play is probably too soon, I added delay and now I can see effect.

However, there is another issue. Everything is great until I click mouse button (It does not matter which one). After clicking mouse button, cursor is not locked anymore and I can leave window.

I tried workaround that I called Set Input after Left Mouse Button Pressed but It have not worked. I found even more ugly workaround but this one works: settings Set Input Game Only in tick.

Do you have any idea why viewport lock is reseted after mouse click ?

Hello ,

This issue about the mouse not locking to the screen properly is a known issue (UE-7293), I will be sure to bump up the community interest for this issue. I am happy to hear that you have a workaround. Thank you for your information and time.

Make it a great day

Thank you for the reply. Just wanted to chime in and say that I’m very interested in getting this fixed as well, especially since it’s been hanging around for 10 months or so. I haven’t been able to use the workaround reliably for whatever reason, and this is the kind of issue that could delay shipping our game if we can’t find a way to resolve it.

Hello ,

I understand you interest in this issue. I will be sure to update the community interest numbers to reflect the interest for this issue. Thank you for your time and information.

Make it a great day

Hello. I’ve been getting symptoms of this problem still. I’m wondering has this been fixed , I’m asking since this is a problem already reported a year ago. If this has been fixed , perhaps my isuse is different.

The workaround doesn’t seems to work on my case. I’m using a combination of C++ / Blueprint in a game mode where it’s possible to switch between FPS and RTS. For my specific case , after switching to RTS view , the first click on the ground would cause the game window to lose focus. But switching back to FPS (hide mouse ) and clicking once would lock the window back.

Hello ,

This issue has been resolved. Could you start a new thread with answers to the following questions?

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed set of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints that may be involved with this issue?
  4. What version of the engine are you using?

Answer the questions in a new thread and then provide a link to the new thread in a reply and I will be happy to assist you further with this issue.

Thanks! That worked perfectly for fixing this issue.