Author Topic: Customizing the keyboard layout  (Read 1334 times)

movq

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
    • blog and code
Customizing the keyboard layout
« on: November 17, 2024, 06:56:53 pm »
Hello. :)

I'm trying to customize my german keyboard layout. One of the main goals is to turn CapsLock into an AltGr key, but let's start with a simpler example: Just swap the keys "a" and "b". There is no need to add a new layout, modifying the "GR" layout in-place is fine by me.

The target system is the original german version of OS/2 Warp 4.0 from 1996, no fixpaks. It would be nice if it also worked on the original Warp 3.0 and 2.1. (Win-OS/2 is not important for now.)

My CONFIG.SYS says:

Code: [Select]
CODEPAGE=850,437
DEVINFO=KBD,GR,C:\OS2\KEYBOARD.DCP

So far, I found this description of the KEYBOARD.DCP file format:

http://www.edm2.com/0303/keyboard.html

As a first step, I tried all of this on OS/2 2.1, because I hope that this is the simplest system of the three (fewer chances for anything to go wrong). I took the KEYBOARD.DCP file, found the index entries for the "GR" layouts, found the corresponding keyboard layout table entries, and finally the KeyDef entries. In those KeyDef entries, I swapped "aA" and "bB".

The edited KEYBOARD.DCP file does work at an OS/2 command prompt. Problem is, it doesn't seem to have any effect in GUI applications. In EPM, for example, "a" is still "a". I just tried again on 2.1 and Warp 4, same behavior.

This thread mentions that PM and command prompts have different keyboard layout implementations, but it doesn't go into detail:

https://www.os2world.com/forum/index.php/topic,1656.0.html

So, does anybody know where keyboard layouts for GUI applications are defined? :)  Which file(s) do I have to edit (and how)?

If KEYBOARD.DCP is the correct place after all, I can go into more detail on how I modified this file. Maybe I did make a mistake.

Any help is appreciated!
-movq

ivan

  • Hero Member
  • *****
  • Posts: 1615
  • Karma: +20/-0
    • View Profile
Re: Customizing the keyboard layout
« Reply #1 on: November 17, 2024, 08:03:15 pm »
Maybe you should try WIN95KEY available from hobbes.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5080
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Customizing the keyboard layout
« Reply #2 on: November 17, 2024, 09:20:07 pm »
Hello Movq, and welcome to the forum.

Just in case, here I have some general information about Win95Key: https://www.os2world.com/wiki/index.php?title=Win95Key

But I have no idea how to swap the keys "a" and "b" with that software.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

movq

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
    • blog and code
Re: Customizing the keyboard layout
« Reply #3 on: November 18, 2024, 06:24:22 pm »
Hi,

thanks for the suggestion, I will give it a try. :)  I'm glad to see that this is free software and that the source code is available, maybe I'll find something of interest there.

-movq