7

Is it possible to customize the keyboard layout in DOS? I use a custom keyboard layout on modern computers and I am wondering if I can do the same on old.

  • No reason why not - just that what sort of keyboard connector do you have? If it is USB, there may or may not be a driver for it. – cup Dec 16 '17 at 5:23
  • The keyboard itself is a standard QWERTY keyboard; it's the operating system (Linux/Mac/Windows in my case) that does the translation to my custom layout. How would I configure that in DOS? – Sydius Dec 16 '17 at 5:24
  • So in current Windows, if you pop up a cmd prompt and use your custom keyboard and press some letters you get different keys or do you have special function keys for email and games etc? Why not just plug it into an old machine and find out. It won't damage the OS. – cup Dec 16 '17 at 5:30
7

FreeDOS includes a keyboard driver which has the ability to use individual keymap files, without needing any re-assembly or re-compilation (of programs at least). If you download the full USB installer from the linked page, and extract its contents, you’ll find:

  • Base/Keyb which contains the keyboard driver itself
  • Base/Kpdos which contains sample keyboard layouts
  • Base/KC which contains the keyboard layout compiler, with lots of documentation

You should be able to write a .KEY keyboard layout description for your custom layout, then compile it to a .KL file using KC, and finally load that with the KEYB keyboard driver. The keyboard driver isn’t just for FreeDOS, it can be used with other DOS versions too.

(You can also download the driver and layouts separately, but I haven’t found a separate download for the compiler.)

  • I didn't find KC in FreeDOS 1.2, so I had to find a copy of 1.1. It works great! Thanks. – Sydius Dec 30 '17 at 7:17
8

There is a utility called KEYMAP.SYS which will do this. It allows keys to be replaced at the scan-code level. From the documentation:

        KEYMAP.SYS v0.0 - A Keyboard Key Mapper

KEYMAP.SYS allows you to change the layout of your keyboard.  Your changes
may be as simple as the swapping of the Ctrl and Caps Lock keys, or you can
set up a completely new layout (like the Dvorak layout).  You may create up
to ten layouts, and switch among them at will.

As provided, the software defines two layouts.  The default is the Sholes
layout, also known as the QWERTY layout.  This is a standard layout, with
no keys moved.  The second provided layout is the Dvorak layout.

         SHOLES              DVORAK

    1 2 3 4 5 6 7 8 9 0 - =     1 2 3 4 5 6 7 8 9 0 = [
     Q W E R T Y U I O P [ ]     ' , . P Y F G C R L / ]
      A S D F G H J K L ; '       A O E U I D H T N S -
       Z X C V B N M , . /         ; Q J K X B M W V Z

To switch between layouts, hold down the Control, Alt, and Left Shift keys,
then press a function key.  F1 selects the default layout (Sholes).  As
provided, F2 selects the Dvorak layout.  You can install up to ten different
layouts, enabled by F1 through F10.  

To install a new layout, you will need a text editor and an assembler.  The
software is written for use with Borland's Turbo Assembler.  To assemble it
with a different assembler, you will probably have to edit the source code.

This software works by hooking INT 15h, function 4Fh.  This function is
provided to allow keys to be remapped, but may not be present on machines
with very old BIOS ROMs.  Some software packages (notably games) take over
the keyboard interrupt, disabling KEYMAP.SYS.  While using such software,
the keyboard will return to its standard layout.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.