VOGONS


First post, by boomlinde

User metadata
Rank Newbie
Rank
Newbie

Hi,
I've been trying to get Wolfenstein 3D to run properly on both a Libretto 50CT and a 100CT. It does run quite perfectly, but I'm experiencing a strange issue, where holding down the cursor keys sometimes also triggers the shift key, This causes run mode to be enabled sporadically. I have tried this both with the internal keyboards and with a PS/2 keyboard connected to the Libretto 100CT port replicator.

In Doom I remember experiencing the same problem, so I rebound the run key. Now I can't rebind it in setup.exe because it doesn't even recognize the left shift key as input.

Other software and games have no such problem. In Duke Nukem 3D it works fine, for example. Are any of you guys familiar with this issue?

Reply 1 of 6, by K1n9_Duk3

User metadata
Rank Member
Rank
Member

This is caused by some design flaws in the game's custom keyboard handlers. The scan code for the left shift key (0x2A) can sometimes appear as a "prefix" for other keys like the cursor keys. The custom keyboard handler used in Wolf3D does not handle these 0x2A prefixes and instead treats them as if they were regular left shift key presses. Some programmers were aware of this issue and programmed their games so that they simply will not allow you to assign the left shift key to any player controls.

So the best/only way to avoid this issue is to assign the "run" button to the right shift key (or any other key). The right shift key has a different scan code (0x36), which is not used as a prefix for any other keys. If none of the game's controls are assigned to the left shift key, the game should just ignore the prefixes and you can use the arrow keys without triggering any other undesired behavior.

I'm not exactly sure why the scan code for the left shift key is also used as a prefix for other keys. Maybe it's because 0x2A is 42 as a decimal number. Or maybe this was supposed to simulate a SHIFT + (key) combination.

Reply 2 of 6, by boomlinde

User metadata
Rank Newbie
Rank
Newbie

Thanks, that's a great explanation and certainly sheds some light on what I'm experiencing in Wolfenstein 3D. However, I'm sure that I've had left shift bound in Doom before, and fake shifts then don't explain why I can't bind it in the Doom setup any more. I will write a program to log scan codes maybe, if that doesn't already exist.

Reply 3 of 6, by collector

User metadata
Rank l33t
Rank
l33t

As per the description of this forum: "Getting old DOS games working on modern hardware. (DOSBox topics belong in DOSBox areas below, not here)." Ask old hardware and driver/configuration questions in Marvin. Marvin, the Paranoid Android

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 5 of 6, by K1n9_Duk3

User metadata
Rank Member
Rank
Member

I learned something new today: In addition to turning Num-Lock on or off, you can also use the shift keys to temporarily switch between numbers and directional arrows for the keys on the numerical keypad. A weird side effect of this behavior is that the regular arrow keys are forced to use the scan code of the left shift key as a prefix when Num-Lock is on. I guess this has something to do with the fact that the regular arrow keys use the same scan codes as the arrow keys on the numerical block.

So turning Num-Lock off should get rid of the left shift prefix. Note that you need to turn Num-Lock on or off before you start the game, since games that use their own keyboard handler usually don't pass the key codes to the BIOS, so you can't toggle Num-Lock while that custom keyboard handler is active. (At least not in pure DOS.)

As for Doom, it seems that the setup program was coded to ignore the left shift key entirely. Without that feature, you would probably have trouble assigning the arrow keys to anything while Num-Lock is on. But you should still be able to assign the right shift key as the "run" key. With the right shift key assigned to "run", I can also use the left shift key to run in-game (tested in Doom v1.3 and v1.9).

Reply 6 of 6, by boomlinde

User metadata
Rank Newbie
Rank
Newbie

Thanks, that indeed works re Doom! Since I play that with WASD now that I have a real mouse, there is no issue with the shift prefixes either.

Num lock seems to have no effect on Wolfenstein 3D, though. Looking at keyboard events it seems that shifts end up in the stream anyway while more than one cursor key is held. For now, playing with the num pad on an external keyboard works fine.