Dosbox reading keys wrong after 8.10 upgrade

Bug #287894 reported by Chuck Finley
92
This bug affects 14 people
Affects Status Importance Assigned to Milestone
dosbox (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Jaunty by Ilmari Vacklin

Bug Description

Binary package hint: dosbox

Ubuntu 8.10

Yup I have the same thing going on. Just upgraded to ibex beta a few days ago. It's really pissing me off that I can't finish my game of crystal caves.

Every other key seems fine except the dedicated arrow keys.

In an outside? terminal (ctrl+ alt+ f2) use the command showkey to show the keycodes for your keyboard. I get the following:

key_up "key 103"
key_left "key 105"
key_down "key 108"
key_right "key 106"
---------------------------------
Using the dosbox keyboard mapper (ctrl + f1) (in dosbox) and deleting the initial binds and defining new binds results in:

Event:key_up
Bind: Key print screen

Event:key_left
Bind: Key right alt

Event:key_down
Bind: Key unknown key

Event:key_right
Bind: Key unknown key
---------------------------
So I need to get at the dosbox keymapper file. I found:
http://www.dosbox.com/wiki/Dosbox.conf

That basically says to use this command in dosbox:
[CODE]CONFIG -writeconf dosbox.conf[/CODE]

That results in a dosbox.conf file which resides in your home directory. After restarting dosbox it makes a file called mapper.txt in your home directory. From the mapper.txt file you find the keycodes:

key_up "key 316"
key_left "key 307"
key_down "key 0"
key_right "key 0"

Neither the key_up or the key_left codes match the showkey codes.

Showkey for right alt (which is bound to the left arrow in dosbox) is actually key 100. For key up the code is key 99.

So, maybe this will be worked out in the final release, otherwise it would be nice to have this worked on.

Revision history for this message
Chuck Finley (greeneggs7) wrote :
Revision history for this message
Peter Veenstra (spiru) wrote :
Revision history for this message
Chuck Finley (greeneggs7) wrote :

Yes, the bug is a duplicate. The solution works. Just make sure to remove the mapper.txt file beforehand, if you have it.

Johnny Levai (digistyl3)
Changed in dosbox:
status: New → Confirmed
Revision history for this message
Lukáš Lalinský (luks) wrote :

This affects more than just dosbox, e.g. VMware Player has the same problem. Any idea how to fix the root of the problem?

Revision history for this message
Peter Veenstra (spiru) wrote :

http://www.ubuntu.com/getubuntu/releasenotes/810
> The X keycodes generated with the new evdev input driver in X.Org
> 1.5 are not compatible with those generated in Ubuntu 8.04 LTS and
> before. If you have configured keybindings for your user with a
> ~/.Xmodmap file, you will need to convert or disable it by hand on upgrade.

this is what is happening. Who thought that it was smart to change the scancodes ?

Revision history for this message
Miguel Diago (mdm) wrote :

The solution brings back arrow keys, but if you use a non-US keyboard some keys stop working. For instance, if you set "keyb es" to use a Spanish keyboard, the "ñ" key doesn't work anymore and "-" is shown as '.

Revision history for this message
ashmew2 (money-man-91) wrote :

Thanks a Lot for the solution on the VOGONS site..Ive been really pissed off and not able to use Borland Turbo C++.

Thanks!

Revision history for this message
Lieven (lieven-debels) wrote :

I've got the same problem on Xubuntu 8.10, but the solution on the VOGONS site is not working very well.
I have a Belgian keyboard.
To use that in dosbox, I first type keyb be, which is supposed to switch keyboard layout to Belgium. (azerty)
After the fix on the VOGONS site, my keyboard stays in 'some sort' of qwerty.
'Some sort' means that it's almost qwerty, but some keys are acting weird.
For example, on a normal qwerty the n and the m are next to each other above the spacebar.
In my case, that's not true: There's one key between them, which produces a comma or something.

So I'm not clear why this has changed from 8.04 to 8.10, from my point of view, it should have been left like it was.
And with a fix that doesn't seem to work in all cases, I hope this will be fixed (a real fix) for the next release.

Revision history for this message
Lubomir Rintel (lkundrak) wrote :

Sooo upstream had fixes for this, I cherry-picked them for Fedora, you may be interested in it as well. Get it from the address below (or switch to Fedora ;)

http://cvs.fedoraproject.org/viewvc/rpms/dosbox/devel/dosbox-0.72-evdev.patch?revision=1.1&view=markup

Revision history for this message
Lieven (lieven-debels) wrote :

Sorry, but can this patch be applied to the upcoming 9.04 Jaunty release?
I' ve tested Alpha 6 just now, and it seems to have the same problem.
Thanks for your help.

Revision history for this message
Lieven (lieven-debels) wrote :

Can you please also explain what steps must be taken to apply the patch successfully?
I' ve tried pasting the text in a script, and executing it afterwards.
I' ve also tried pasting it directly into terminal.
Yet nothing seems to work. Any detailed explanation would be greatly appreciated.
Thanks

Revision history for this message
Lubomir Rintel (lkundrak) wrote :

Lieven: In general, the executable has to be rebuilt with the changes that the patch describes applied. In this case, the package maintainer has to rebuild the dosbox package.

Alternatively, you can rebuild the package yourself. I'm not able to advise you about how to do that, since I don't use Ubuntu and am not familiar with the packaging system, but I'm sure you'd be able to find a good piece of documentation somewhere around the net, or maybe someone to do the build for you.

Revision history for this message
mnemonic (johnny.mnemonic) wrote :

_How to apply the patch and recompile dosbox_

Packages that are needed (install via synaptic, adept or apt-get):
build-essential devscripts fakeroot

Open up a terminal. Create a directory somewhere and change to the newly created directory.
Execute the following commands (don't type the Dollar sign!):
$ sudo apt-get build-dep dosbox
$ apt-get source dosbox

Get the patch from the link above or use the prepared one that is attached to this post. I assume that the file is named "dosbox-0.72-evdev.patch".
Execute:
$ patch -p0 < dosbox-0.72-evdev.patch

You just patched dosbox. Now on to the build.

Change to the subdirectory "dosbox-0.72".
Execute:
$ debchange --nmu
A command line editor should open up. You don't need to type something. Just save and exit (if the editor is vim, type ":wq" followed by return).

Execute:
$ sudo dpkg-buildpackage

The build process should now start. If it finished successfully, you will find the generated packed in the directory above (name should be "dosbox_0.72-1.1build1.1_amd64.deb" or something like that, depending on your architecture).

Install the package via
$ sudo dpkg -i dosbox_0.72-1.1build1.1_amd64.deb
Change the name of the .deb file in the command above to meet the name of the one you just built.

Hope that helps.

Regards

Revision history for this message
Lieven (lieven-debels) wrote :

Thanks mnemonic. I will try this when ubuntu 9.04 is released (at the end of april).

Revision history for this message
Lubomir Rintel (lkundrak) wrote :

Haha, I like this. Isn't Ubuntu package maintainer going to fix this until then. With the patch available? Wow!

Revision history for this message
Peter Veenstra (spiru) wrote :

There is no real ubuntu package maintainer.
It lists me as maintainer but this wrong. I am the debian maintainer, not ubuntu maintainer
I can't do anything special in regards to ubuntu.

The patch you created is build from partly my work. (As I am the author of DOSBox). I am glad to hear that
the code works for you. When creating it we had a only a limited set of machines and distros to test it on.

Revision history for this message
Toni Ruottu (toni-ruottu) wrote :

I got it working by creating file ~/.dosboxrc with:

[sdl]
usescancodes=false

Revision history for this message
Motin (motin) wrote :

Me too. Worked right away after that.

Revision history for this message
rCX (rcx) wrote :

The latest release of DOSBox, version 0.73, fixes this bug but 0.72 is still in the repositories. Here are instructions for building the new version: http://ubuntuforums.org/showthread.php?t=1171794

Revision history for this message
rCX (rcx) wrote :

The DOSBox package has been updated to 0.73 Karmic: http://packages.ubuntu.com/karmic/dosbox

Changed in dosbox (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.