Right-Shift / Backslash Keyboard Problems (SOLVED!)

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby leep » 2008-4-28 @ 22:38

I just intalled DOSBox 0.72 with the intention of installing older DOS games. When I start it up and get to the DOS Prompt, the keyboard doesn't work properly. The right Shift key does nothing. Even in the keymapper (ctrl-F1 from inside DOSBox), if I click the area for the right SHIFT key, click [Del], then click [Add], when I press the right-Shift key nothing happens. It doesn't even recognize a key is down.

Other keys are also not working correctly, the \ key gives me ] instead, the ] gives me [, and the [ key doesn't work at all, nor does the +/= key or the `/~ key or the '/" key.

I am running Vista Ultimate 32-bit, and before anyone jumps in to blame or flame Vista, you're probably right. But that doesn't help me solve my problem. :happy:

I've ready other posts here from people having the same problem. Has any solution or workaround been discovered? I've tried running USESCANCODES FALSE from the DOS Prompt inside of DOSBox and that didn't make any difference. I also set keyboardlayout=en-us in the dosbox.conf file, also to no avail.

I tried installing FreeDOS in a VMWare virtual machine, but the audio in a game I installed was stuttery and I'm hoping it will work correctly in DOS Box. But I need the keyboard to work correctly first.

If a workaround is that I have to install XP in a VMWare box and run DOSBox in that and my Intel Core-2 Quad processor can run it smoothly with no stuttering audio, then that's an acceptable workaround. If I have to format my harddrive and install XP, then that's not an acceptable workaround. :lol:

Thanks for the responses!

=====
leep
Last edited by leep on 2008-5-03 @ 16:18, edited 1 time in total.
User avatar
leep
Newbie
 
Posts: 4
Joined: 2008-4-28 @ 22:21

Re: Keyboard problems

Postby wd » 2008-4-29 @ 11:42

As you post in the dev section, can you compile dosbox from sources?
Then check out the scancode/key stuff in sdl_mapper.cpp
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Keyboard problems

Postby leep » 2008-4-29 @ 12:47

I am a developer, but I am just working with the binaries in this case, no source code. My appologies if this wasn't the correct forum for this topic. The description of this forum said it was for the "discussion of bugs" as well as code and developmental matters. If there is a more appropriate forum for this please let me know and I will take it there. I just figured that since multiple people had reported this problem and I had tried all the fixes suggested to them with no resolution, that this may fit under the category of bug. :happy:

As a developer, I certainly wouldn't mind the oportunity to try and help debug (if this is a bug) this, but it might take some time for me to get up to speed with the code and time is fairly rare now-a-days. :wink: At this point, I don't even know what language it's developed in. And I realy do want to get DOSBox up and running as quick as I can so I can get some of my old DOS based games running on this system I'm setting up to be a gaming/entertainment system.
User avatar
leep
Newbie
 
Posts: 4
Joined: 2008-4-28 @ 22:21

Re: Keyboard problems

Postby wd » 2008-4-29 @ 13:03

Well it works just fine on the vista/vista64 setups tested, but it surely
depends on a lot of things like graphics drivers/directx (sdl backend)
and the likes.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Keyboard problems

Postby pokey » 2008-5-02 @ 22:54

I have had this problem in another SDL program I develop. I just installed DOSBox, and it is the same issue. The problem is that the right shift key doesn't work and other keys like ] are in the wrong place.

Try using SDL_VIDEODRIVER=windib

I got this idea from here (SDL QEMU port):
http://www.h7.dion.ne.jp/~qemu-win/PortingTips-en.html
It says: "When the keyboard doesn't work well, set it before you start the program like this.
[DOS prompt] set SDL_VIDEODRIVER=windib"

Now that is just a work-around, but it seems that using windib changes the keyboard handling so that it works. It fixed DOSBox and my program.

The problem is not due to SDL alone however. I found the same problem when using Directx alone without SDL.

If you go here:
http://msdn.microsoft.com/en-us/library/bb219687(VS.85).aspx
There is info about "DirectInput and Japanese Keyboards"
Now, what I found through testing is that this problem is exactly as if I had a Japanese keyboard. Note that DIK_RSHIFT is listed as missing. As well, some of the keys that don't work generate special Japanese keycodes.

(I wonder if Japanese users of DOSBox have this same problem?)

This problem is not caused by the keyboard itself because when I plug in my old PS/2 keyboard it has the same problem.

I have a HP Pavilion with Vista Home Premium 32-bit.

Here is someone with the same problem:

http://forums.techguy.org/hardware/6427 ... pears.html

Note that he also had an HP. Is your computer an HP?

HP listed a keyboard update on their site that said: "HP Enhanced Multimedia PS/2 and USB Keyboard driver update resolves issue with Shift key on the right side of the keyboard not working in certain WildTangent games."

I installed it and it did not fix things.

I would like to know if this is an HP issue or not.

Edit:
I noticed that mightythor40k from the techguy forums had listed his computer as "Acer Aspire 7520G Notebook". This makes doubt it is an HP issue.
pokey
Newbie
 
Posts: 3
Joined: 2008-5-02 @ 22:06

Re: Keyboard problems

Postby leep » 2008-5-03 @ 00:12

pokey, thanks for all that info! The computer is indeed an HP, but since it looks like someone with a non-HP also has the problem I admit that throws some doubt on it being an HP issue.

I'm not home right now, but figured I'd remote into the computer in question (which is at home) and play with the SDL_VIDEODRIVER fix you suggested. Actualy, I remoted (Remote Desktop Control) into another computer at home, and then remoted from that computer to the gaming system in question. I fired up DOSBox, and guess what? The keys worked just fine! So they work when the input is via RDC, but not from the physical keyboard on the machine.

I also tried another keyboard when I first discovered this problem. First keyboard was a wireless keyboard using a USB receiver, second keyboard was a USB keyboard (not wireless). I didn't try a PS/2 keyboard, but both keyboards I tried had the problem.

When I get home (some time this weekend I hope) I'll play with what you suggested. Is that supposed to be an environment variable set inside DOSBox, or something you set in the config file before starting DOSBox?
User avatar
leep
Newbie
 
Posts: 4
Joined: 2008-4-28 @ 22:21

Re: Keyboard problems

Postby pokey » 2008-5-03 @ 08:37

OK this is definitely a keyboard driver problem.

Go to the control panel and click on keyboard, then click on hardware/properties/driver for each keyboard.

Then list all the drivers for each keyboard device:

This is the driver for my PS/2 keyboard, not made by HP. This driver got installed automatically when I installed it:
Enhanced Multimedia PS/2 Keyboard
Manufacturer: HP
C:\Windows\system32\drivers\i8042prt.sys
Provider: Microsoft
6.0.6000.16386(vista_rtm061101-2205)
C:\Windows\system32\drivers\kbdclass.sys
Provider: Microsoft
6.0.6000.16386(vista_rtm061101-2205)
C:\Windows\system32\drivers\PS2.sys
Provider: Hewlett-Packard Company
1.0.2.0
C:\Windows\system32\drivers\kbd106.dll
Provider: Microsoft
6.0.6000.16386(vista_rtm061101-2205)

This is the HP USB keyboard:
HID Keyboard Device
Manufactuer: (Standard keyboards)
C:\Windows\system32\drivers\kbdclass.sys (as above)
C:\Windows\system32\drivers\kbdhid.sys
Provider: Microsoft
6.0.6000.16386(vista_rtm061101-2205)

There are also 3 other keyboard devices that get installed when I plug in my infrared remote control receiver for the remote control my computer came with:
Microsoft eHome Remote Control Keyboard keys
drivers: kbdclass.sys and kbdhid.sys as above
Microsoft eHome MCIR Keyboard
drivers: kbdclass.sys and kbdhid.sys
Microsoft eHome MCIR 109 Keyboard
drivers: kbdclass.sys, kbdhid.sys and kbd106.dll

Now, a 106 or 109 keyboard, means a Japanese keyboard. kbd106.dll is for a Japanese keyboard. And why do I have 3 keyboards for the IR remote? I suppose this is just in case I had a compatible IR keyboard which might or might not be a 109 keyboard.

Test:
Unplug the IR receiver and PS/2 keyboard, reboot
Result:
DOSBox works correctly
Theory: No kbd106.dll loaded implies no Japanese keyboard issue.

Test:
Plug in PS/2 keyboard, reboot
Result:
DosBox does not work correctly

Test:
Remove PS/2 keyboard. reboot. DOSBox works as before. Plug in IR receiver, don't reboot.
Result:
Existing DOSBox session which worked, continues to work correctly.
New DOSBox session keyboard fails to work correctly.

Test:
Uninstall MCIR 109 Keyboard driver while plugged in:
Result:
New DOSBox session now works. IR Remote continues to work.
After reboot, the old driver is back and DOSBox fails to work correctly again.

Test:
Change the MCIR 109 Keyboard's driver to HID-Keyboard device.
Result:
DOSBox fails to work correctly, even after reboot.
Conclusion:
Since this resulted in no kbd106.dll being listed, the mere presence of a 109 keyboard causes the problem.

Test:
change to MCIR non-109 keyboard driver
Result:
Fails before and after reboot

Test: Change the MCIR 109 Keyboard's driver to "HID-Compliant device."
Result: works, and the MCIR 109 Keyboard device is now missing, both before and after reboot. I don't know why it went away or how to get it back.

Test:
Reboot with the PS/2 Keyboard attached.
Result:
Fails
Hypothesis:
The kbd106.dll is causing this problem.

Test:
Change the PS/2 Keyboard driver from HP's "Enhanced Multimedia PS/2 Keyboard" to PC/AT Enhanced PS/2 Keyboard(101/102-Key) and reboot.
Result:
Fails
Conclusion:
There is no kbd106.dll anymore, and no MCIR 109. Why does this fail?

Test:
Change to "standard PS/2 101/102 Keyboard"
Result:
After reboot, works (including the "web keys" my PS/2 keyboard has)
Also, the IR remote works and the USB keyboard works.

So it seems that changing the MCIR 109 keyboard to "HID-Compliant device" got rid of it, and the PS/2 keyboard to "standard PS/2 101/102 Keyboard" fixed that problem as well.

I still don't fully understand this problem.

I would suggest anyone having this problem look for any keyboard device that seems Japanese in nature, such as having a "106" or "109" in the drivers or device name. Then, change the driver to that device until the problem goes away. Use the "HID-Compliant device" for MCIR 109. Use "standard PS/2 101/102 device" for a PS/2 keyboard.

The presence of one such device causes this problem.

Change the keyboard driver with Keyboard, Hardware, (pick the keyboard), Properites, Change Settings, Driver, Update Driver, Browse my computer, Let me pick, and possibly uncheck Show compatible hardware.

BTW To use use set SDL_VIDEODRIVER=windib you need to put that in a batch file that loads DOSBox. Or you can test it from a cmd shell by hand. I think it might still be useful in case this new method fails.

I found 3 more people with this problem:
viewtopic.php?t=17057
http://forums.uesp.net/viewtopic.php?p= ... 96fc50edcd
http://www.gamersquarter.com/forums/vie ... 061d#69317

There is also this note:
http://support.microsoft.com/kb/927824
Windows Vista may not use the correct keyboard layout when you connect a USB keyboard to the computer

I tried that before but the registry fix didn't work for the USB keyboard. But the driver change for the PS/2 keyboard mentioned at the bottom is the technique I used to fix things.

edit:
This guy got it, exact same answer as me: http://forums.logitech.com/logitech/boa ... ge.id=6123

But it still doesn't explain the PS/2 problems. Sounds like the MCIR 109 is the primary cause of this mess, however.

edit2:
Another guy who found MCIR 109 was the problem, but he didn't get a full solution (change to hid-compliant device):
http://www.digitpress.com/forum/archive ... 02166.html
pokey
Newbie
 
Posts: 3
Joined: 2008-5-02 @ 22:06

Re: Keyboard problems

Postby leep » 2008-5-03 @ 16:16

pokey, you got, perfect! One of the keyboards listed was "MCIR 109 Keyboard". I changed it's driver to "HID Compliant device", at which point the MCIR 109 Keyboard vanished from the list, and DOSBox works fine now! This was the wireless keyboard w/USB receiver. I haven't tried this with the USB wired keyboard yet, but I have high hopes now. :) Again, thank you SO much!

-----
leep
User avatar
leep
Newbie
 
Posts: 4
Joined: 2008-4-28 @ 22:21

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby wd » 2008-5-07 @ 21:26

Thanks for figuring this out. The keyboard layout should not matter as
dosbox uses the scancodes directly by default.
Maybe you can create a reduced testcase (by using some basic SDL example
or so) to check if/which of the symkeys are off, and if there's some pattern.
Then you could point the SDL guys to this.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby pokey » 2008-5-13 @ 15:27

Well here is what I found:
It's as the Microsoft note said about the Japanese keyboards under DirectX:
http://msdn.microsoft.com/en-us/library/bb219687(VS.85).aspx
It seems to agree with:
http://www.win.tue.nl/~aeb/linux/kbd/sc ... html#ss8.1
but I don't undestand why there's no right shift.

Tilde and capslock become toggles. Only presses generate events and not releases, and they toggle.

tilde -> 0x94 (toggle)
#define DIK_KANJI 0x94 /* (Japanese keyboard) */

+/= -> 0x90
#define DIK_CIRCUMFLEX 0x90 /* (Japanese keyboard) */

left square bracket -> 0x91
#define DIK_AT 0x91 /* (NEC PC98) */

right square bracket -> 0x1a=left square bracket

back slash -> 0x1b=right square bracket

caps lock -> caps lock (toggle)

quote -> 0x92
#define DIK_COLON 0x92 /* (NEC PC98) */

right shift -> does not work (no code)

You could remap some of them, but there's no way to fix right shift or the toggle on caps lock and tilde.

I found that I messed something up in my registry that made this worse with the ps/2 keyboard.
I'm pretty sure it caused an additional problem.
So I think now that I can explain all of this as due to the MCIR 109.
I have the PS/2 keyboard working with the HP driver now.
pokey
Newbie
 
Posts: 3
Joined: 2008-5-02 @ 22:06

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby mlvandy » 2008-7-03 @ 21:36

Hi

Im new to this whole thing and am not good with computer hardware or programs at all. I really need help though!

I just got a new Dell computer with wireless keyboard and an old game of mine woulndt play so I downloaded the DOSBox, great right? No, the keys I need to use in order to play my game in DOSBox wont work. This \ key comes up something entirely different. The other keys I can handle not working right, but this is the ONE I desperately need to get my old game set up. Hope someone can help me!!!!

Thank you
mlvandy
Newbie
 
Posts: 1
Joined: 2008-7-03 @ 21:31

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby MiniMax » 2008-7-03 @ 22:42

And you have Spanish keyboard?
DOSBox 0.73 ReadMe | DOSBox Wiki | DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Win 10 Pro
User avatar
MiniMax
Moderator
 
Posts: 5128
Joined: 2004-1-18 @ 04:15
Location: Stockholm, Sweden, Europe, Earth Interests: Old games & young women

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby rolloLG » 2009-2-01 @ 08:10

I've recently had a similar problem with a brand new HP Pavilion dv5-1110el and DosBox and other emulators like WinUAE!
I solved the same way forcing 'Microsoft eHome MCIR 109 Keyboard' to use HID Compatible device driver instead. And it worked! All emulators and in general all DirectInput apps now detect the keys correctly!

Here is the complete discussion where I solved the prob. by myself: http://eab.abime.net/showthread.php?t=41626

EDIT:
Read also here viewtopic.php?p=218090#p218090
Last edited by rolloLG on 2016-1-20 @ 11:34, edited 1 time in total.
rolloLG
Newbie
 
Posts: 5
Joined: 2008-6-24 @ 17:21

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby wd » 2009-2-01 @ 23:31

Right, that's pretty much the only solution. We're using SDL thus only
indirectly the directinput interface, and those special keyboard drivers
screw up the scancodes for unknown reason.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby Ikrit » 2009-5-25 @ 16:21

Okay, so I tried pokey's original solution (SDL_VIDEODRIVER=windib), but the problem is that I can't find the "=" key in addition to my backslash! While I would be interested in checking out the other solutions, they appear way over my head (I'm not too advanced in computers). Anything else simple enough that it is more or less copy and paste a couple of lines?

I'm currently running Vista 32x on an HP. I have gotten around this by copying whichever file I want to access to the c drive (not in any folders) and using the foreslash to mount it, which works just as well, but anything more specific and I am hosed.
Ikrit
Newbie
 
Posts: 3
Joined: 2009-5-25 @ 16:09

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby wd » 2009-5-25 @ 16:36

Read rolloLG's replies.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby BiGBaDJoHN » 2009-7-21 @ 12:28

checked! rolloLG's reply solved my problem too!
BiGBaDJoHN
Newbie
 
Posts: 1
Joined: 2009-7-21 @ 12:27

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby rolloLG » 2009-11-23 @ 18:07

Just for curiosity.... even the game Oblivion suffered this problem and the console key didn't work before the manual modify! :wink:
rolloLG
Newbie
 
Posts: 5
Joined: 2008-6-24 @ 17:21

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby apsumusician » 2010-1-30 @ 06:11

After a long time of trying to comprehend all of that... Simply uninstalling the 109 driver did the trick.
apsumusician
Newbie
 
Posts: 1
Joined: 2010-1-30 @ 05:19

Re: Right-Shift / Backslash Keyboard Problems (SOLVED!)

Postby yhe1 » 2010-2-13 @ 08:01

I encountered this same from in Windows 7 Ultimate on a Dell XPS Studio 16.

However, I can't seem to find the keyboard drivers in Windows 7.

Can somebody guide me thorugh this issue? Thanks in advance.
yhe1
Newbie
 
Posts: 13
Joined: 2008-2-25 @ 02:17

Next

Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 0 guests