Sunday, May 22, 2011

International Keyboard Layout in Windows 7 DOS Mode

If you use old DOS programs under Windows 7, you may encounter the problem, that the keyboard layout is by default international, independent of Windows settings.

DOSBox could be a solution, but some programs are too slow in DOSBox, for example database applications.

Here is a solution for a Hungarian keyboard layout, but you may adapt it for other international layouts:

Solution 1: custom keyboard driver

Searchin in the Internet I found a German keyboard driver from 1990 and successfully converted it to a Hungarian one.

1. Download keyb2hu
2. Add keyb2hu.com to autoexec.nt

Solution 2: Use Windows kb16.com in autoexec.nt (simple, but not perfect)

Add this line to %SystemRoot%\system32\autoexec.nt (c:\windows\system32\autoexec.nt on most systems)
%SystemRoot%\system32\KB16 HU,852, %SystemRoot%\system32\KEYBOARD.SYS

The problem with this solution is, that somehow AltGr combinations do not work. If someone knows why this is, please share with the rest of the world.

Solution 3: building a custom keyboard driver (hardcore)

Hungarian layout is hardcoded into keyb2hu.com. You may use the original version for German layout. If you want another layout, you can modify the driver. You will need the MASM assemler to do that.
  1. Download MASM32
  2. Unpack to dir, for example c:\masm32
  3. Download the source code of the driver
  4. Use this command to compile the driver: ml /Zm /Bl link16.exe /AT keyb2hu.asm
  5. Use may use setenv.bat and make.bat for convenience
  6. You can change the layout inside the asm source. Use this chart to figure out the code for each key.
References:

No comments:

Post a Comment