VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

I just downloaded the latest Dosbox version (0.74) from dosbox.com, but I still notice the old RDP bug that's out there for as long as I use RDP with my PC: each time I move the mouse right/down/left/up, the mouse moves a ridiculous amount and is barely controllable using RDP on the current Windows 10(14393.693). To be exact, it's probably the same bug I noticed in UniPCemu, where the SDL driver is reporting ridiculous amounts of movement when moving the mouse during a RDP session, with the mouse mounted(when the mouse is grabbed using SDL). This bug is there in both SDL 1 and 2 versions of SDL. The ratios only change to other values when changing the display resolution of the RDP session(by (re)connecting with a different resolution setting in the Remote Desktop Connection program settings).

So when the mouse is moved, instead of reporting 1 or 2 pixels for moving the mouse a little notch to the right/down/left/up, the values reported are multiplied with(divide by these values to get the actual mouse movement in pixels):
horizontal movement x vertical movement at (output resolution of the RDP session)xres x yres
-----------------------------------------------------------------------
164 x 109 at 800x600
64 x 85 at 1024x768
51 x 64 at 1280x1024
34 x 60 at 1920x1080

Even more multiplication ratios when in other display modes. All of these are the minimal movement values, which are 1 when not controlling an SDL application through remote desktop and mounting the mouse.

So it even depends on the current display resolution somehow? So to fix that bug, you need to know the actual used screen display resolution(not the SDL surface Dosbox creates) to calculate a multiplication factor for horizontal and vertical movement to apply to every mouse movement event received from SDL.

See also the thread at viewtopic.php?f=9&t=51284

I also can't find any logic between the used display resolutions and reported movement(for 1 pixel mouse movement) during RDP, based on the RDP display resolution. The display resolution of the computer that's remote controlling is 1920x1080 in all cases.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 12, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Then don't remote control play 😉

You'd probably need the SDL2 ported DOSBox for that to work correctly.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 12, by superfury

User metadata
Rank l33t++
Rank
l33t++

SDL2 won't help: the behaviour is exactly the same(tested with Dosbox(and Dosbox-X) using SDL and UniPCemu using SDL and SDL2). All have the exact same problem. So it's a general problem still unfixed in SDL or Windows.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 3 of 12, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Sooo... take it to SDL.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 4 of 12, by superfury

User metadata
Rank l33t++
Rank
l33t++

Strange thing: posted a bug report some time ago about the bug, but nobody's done anything about it.

https://bugzilla.libsdl.org/show_bug.cgi?id=3518

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 5 of 12, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

well, that's not strange, it's just how important a bug in this special case is deemed...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 6 of 12, by superfury

User metadata
Rank l33t++
Rank
l33t++

It just breaks all SDL games using the mouse and mounting it(e.g. stuff like Doom mouse movement) when using RDP on all Windows 10 PCs? Thus making those games literally unplayable over RDP? Like one little 1mm notch to move the player 180° or more? No proper way to aim anywhere? Windows' under Dosbox (or any other SDL-based x86 emulator) literally unusable mouse(unless you WANT your mouse to always be in one of the four corners of the screen)? Also I don't know if this happens on older versions of Windows as well(XP Pro, Vista Pro, 7 Pro, 8 Pro)? Anyone knows if they have the same problems?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 7 of 12, by superfury

User metadata
Rank l33t++
Rank
l33t++

When I try to use mouse input with Dosbox when using Remote Desktop, the mouse movement (relative and absolute) movements are multiplied by a ridiculous amount(also affected by the monitor DPI setting. This makes the mouse movement ridiculous when using RDP(Using a 640x480 game moving the mouse a single mm(minimal mouse movement) moves the emulated mouse to the four corners of the screen(tested with Windows 95 as well as Megarace. Should also be the case with any other applications&games using the mouse, e.g. ms-dos edit.com etc..

UniPCemu uses a very simple fix for this, by dividing the input movement when receiving it when RDP is detected(either through command line parameter(RDP) or registry-based autodetection) when starting the emulator.

This is what UniPCemu uses to normalize it to become valid, non-mounted(mounted=SDL mouse locking(and hiding) in place(which Dosbox exits using ALT-F10 I believe):

	#ifdef IS_WINDOWS
if (RDP) //Needs adjustment?
{
mouse_xmove += floorf((float)event->motion.xrel*(1.0f/34.0f))*GPU_xDTM; //Move the mouse horizontally!
mouse_ymove += floorf((float)event->motion.yrel*(1.0f/60.0f))*GPU_yDTM; //Move the mouse vertically!
}
else //No adjustment?
#endif
{
mouse_xmove += (float)event->motion.xrel*GPU_xDTM; //Move the mouse horizontally!
mouse_ymove += (float)event->motion.yrel*GPU_yDTM; //Move the mouse vertically!
}

As you can see, UniPCemu also takes dots to mickeys in account(GPU_[x/y]DTM), since it emulates a mouse that reports in mickeys(mm) instead of pixels.

It would be nice to have something like this in Dosbox, as stuff like games or Windows(any version) without proper mouse movement can be a pain to navigate(especially when being unable to use alt-tab or other windows key combinations due to Windows intercepting them.

As you can see, mouse movement is multiplied by 34(horizontally) times or 60(vertically). This applies to direct input(mouse locked in place) only. Seems to be a SDL bug(any version), I've already reported it a long time ago, but no effect(no response from anyone on said bug)?

Anyone?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 9 of 12, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Mm, I never noticed the mouse being off in an extreme manner. I have used dosbox a few times over RDP, however that was not with a locked mouse.

What weird numbers.. 34 and 60... 32 and 64 would have made some more sense

Water flows down the stream
How to ask questions the smart way!

Reply 11 of 12, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Is the issue Ben describes in this thread it? https://social.technet.microsoft.com/Forums/w … winserverhyperv

Attaching the USB mouse to the RDP session seems to work here:

Erratic mouse movement in 3D games over RDP with RemoteFX
https://superuser.com/questions/849918/errati … =google_rich_qa

Looks like citrix supports relative:
https://docs.citrix.com/en-us/receiver/window … -5/improve.html

How To Ask Questions The Smart Way
Make your games work offline

Reply 12 of 12, by superfury

User metadata
Rank l33t++
Rank
l33t++

@DosFreak: Not entirely: The multiplier is a constant value. It doesn't change based on the location of the mouse, as is implied. 100,100=>101,101 reports 34,60. 0,0=>1,1 reports 34,60. 1000,1000=>1001,1001 reports 34,60. Reported movement is always x34 and x60 for the related movement. Of course, absolute location reported does the same(but increase/decrease by that amount).

Currently, the only way I can fix it is dividing x&y reported by 34&60 in relative mouse mode when RDP is detected.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io