VOGONS


First post, by dstar

User metadata
Rank Newbie
Rank
Newbie

I'm having trouble with Master of Orion (the original) not recognizing that I've got an alt key held down. I posted about this last year, but I decided to try again, with a bit more research. I compiled dosbox from cvs, enabling debug and uncommenting line 500 in sdl_mapper.cpp, which logs what key it's seeing.

Based on that, I don't think it's a problem of dosbox not getting the right key -- for left and right alt, respectively, I see the following lines:

key type 2 is 38 [134 40]
key type 2 is 64 [139 6c]

(and the corresponding up events, of course). These are properly mapped to SDLK_LALT and SDLK_RALT, so it should be recognizing the keys. With usescancodes=false, the only difference is that the keycodes are 134 and 139 respectively.

This isn't a problem with the game itself, because it works fine with dosbox on a windows box.

It looks to me like the problem is somewhere after GetKeyCode, but as I don't know C++ and don't really know C, that's as far as I can trace things.

Any ideas?

Reply 1 of 5, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

This isn't a problem with the game itself, because it works fine with dosbox on a windows box.

Maybe you should have posted in your old message but on what OS do you see the problem, might be important since it's not Windows from your description.

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 5, by dstar

User metadata
Rank Newbie
Rank
Newbie

*sigh* That's the problem with posting with a headache. You forget things after reminding yourself about them repeatedly.

I'm running Ubuntu 9.04, and this is with 0.73 (obviously, since it's from CVS, I guess).

Reply 3 of 5, by dstar

User metadata
Rank Newbie
Rank
Newbie

I did a bit more debugging, and added LOG_MSG() statements in various places. Putting one in bios_keyboard.cpp reveals that the alt key being pressed is propogated down to that point - it's hitting the branch for the alt key being down, and alt+m results in 0x3200 being looked up, which is correct (at least according to the table at the top of the file). The flags look correct as well.

I'd think it was a problem with the game if it didn't work in dosbox under windows....

Reply 4 of 5, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Maybe you have a stray mapperfile in there?

1+1=10

Reply 5 of 5, by dstar

User metadata
Rank Newbie
Rank
Newbie

Nope -- the version I compiled with the debug statements is in a completely different location, to avoid just such problems, and like I say, it looks like everything is right at least as far down as bios_keyboard.cpp.

Hmm. It just occurred to me that I don't recall what core I'm using on the windows installation; maybe I should see if that's different... it shouldn't matter, but it's at least something to look at.