4K Mouse as Touch Input not working correctly

I recently switched to using a 4k screen with Unreal Engine and have found an issue with using mouse for touch input. When playing in viewport or in new editor window, the location given by InputTouch is incorrect. It appears that some dpi scaling is getting applied as if I set the window to have a horizontal resolution of 1920, TouchInput reports 1269 as the right edge of the window.

Setting Windows 10 DPI scaling to 100% fixes this, however it then makes the Unreal Engine UI (and the general Windows UI) too small to effectively use on my 4k monitor.

Changing Application Scale through the widget reflector produces a similar issue, with TouchInput reporting incorrectly. If I reduce the scale, I can ‘unscale’ the window and get correct values but at that point the UI is again too small to use.

I have tried using ‘Get Mouse Position Scaled by DPI’ and “Get Mouse Position on Viewport’ which give an X value of 2074 and Y of 1116 when testing the edges of a supposedly 1920x1080 window.

‘Get Viewport Size’ gives and X of 1905 and a Y of 1029.

I am using Windows 10 with a scaling value of 150% on my 4k monitor.
I have tried setting the engine to ‘Override high DPI scaling behavior’ in Windows 10 Compatibility settings but this has no effect.

Playing as a Standalone Game does not have this issue, however it is a lot slower to start so would not be ideal.

Using UMG UI elements works fine in viewport and in editor window, the issue only seems to be with TouchInput.

+1. Have 1920*1080 res with scaled interface. Touch events not aligned with mouse clicks. For reproduce:

  • Enable “use mouse for touch”
  • Blueprint: Draw debug sphere in location, where location taken from “Get hit result under finger”. Use touch input event
  • Interface scaled to 125% in “Screen settings” on windows 10

I’ve had this problem for over a year. I’ve now upgraded my project to 4.20.1 and it seems this has been finally fixed. Do try it out.

…and thanks to the Epic employee that e-mailed me for clarification about this a while back.