Conversion from Microsoft KLC

From LSDevLinux
Jump to: navigation, search

Here is some help for massaging an MSKLC keyboard into an XKB keyboard...

Except for the basics (A-Z and 0-9), it's easiest to use the Unicode values in Linux, as the names they use can be pretty abstract. As for the Regexes to get you started, the order of characters is the same, but there are columns from MSKLC that you don't need in XKB. You probably want to grab columns 0, 1, 6, and 7.

My MSKLC lines look like this:

     03	2		0	0032	0040	-1	00bd	-1		// DIGIT TWO, COMMERCIAL AT, <none>, VULGAR FRACTION ONE HALF, <none>

and the corresponding row in XKB looks like this:

       key <AE02> { [ U0032, U0040, U00BD, NoSymbol ] };	//2, AT SYMBOL, ONE HALF
  • Notice the U was added to each Unicode character.

Draft Line

To create a draft line from XKB, try a regex similar to this one:


  ^\w\w\t+(\w*)\t+\w*\t+([\w@]+)\t+([\w-@]+)\t+[\w-@]+\t+([\w-@]+)\t+([\w-@]+)\t+(// .*)


  \tkey <A\1> { [ \2, \3, \4, \5 ] }; \6

Adding U to Unicode Values

Now add the U, and if you really want to get fancy with Regex, you can uppercase the output (using the syntax of your editor). Make sure this doesn't get overzealous and replace things in your comments.


 ( [A-F0-9]{4},)



Unassigned Keys

The -1's of MSKLC need to be replaced with NoSymbol if you have an unassigned combination.






Then you need to match up the Linux position keycodes from the chart on the site with the VK or scancodes. (sorry, this is manual) Each key is called something like <AE01> by XKB. You will probably want to print out this image to use as a reference.