Mouse jumps around when using DOSBOX

I'm trying to play an old school DOS Game I got using the DOSBOX DOS emulator, but the problem I have is that the mouse jumps all over the screen and does not allow me to have a good control. The game is Cannon Fodder, which need to have mouse input. So I'm thinking it is problem of conversion from USB mouse to the serial driver which the emulator uses. I already tried to lower the sensitivity using the emulator and to lower it using windows settings.

Anyone have any suggestions on how to resolve this?


Solution 1:

Not 100% sure this is the problem, but autolock often causes mouse issues in DOSBox. So try setting it to the opposite of whatever it currently is:

  • In your dosbox.conf file, look for a line setting autolock=false and remove the line (or change the false to true).
  • Or, if no line with autolock exists, add one with autolock=false.

Solution 2:

If you are trying to run dosbox in a virtualbox Ubuntu host, I had the same issue and it was driving me crazy. The mouse would just get stuck in a corner and wouldn't move except to the other corners. Here's the solution I found:

Make a text file and put this in it:

#!/bin/bash
export SDL_VIDEO_X11_DGAMOUSE=0
dosbox

Save it on your desktop or somewhere else, right click on it and put a check where it say "allow to execute as application". Run the file and the mouse issue will be fixed.