1

Is there any software that will generate Macintosh, Windows and Linux(xkb) keyboard layouts simultaneously?

Edit: From what I understand Microsoft Keyboard Layout Creator doesn't support changing of modifier keys (I have read that maybe autohotkey can get around this issue)

1

2 Answers 2

4

Unfortunately, there is no software tool or package which is capable of generating or transcoding (porting) the native keyboard layout files of the major desktop OSes (at least not one which is available to the public). Such a tool would be very useful to all those who must regularly use multiple OSes whether on the same machine and keyboard or not; which is increasingly becoming more common. But nothing like this has been developed—and released—so far; and that is not without reason. There are various complications involved with "porting" keyboards between OSes or trying to maintain precisely synchronized keyboard layouts across different platforms. One of the significant barriers is the difference between 'modifiers'/command keys which are used and/or recognized by the various operating systems. Additionally, Macs have unique physical keyboards with some keys that don't directly correspond or translate to other OSes, creating a second "layer" of problems and inconsistencies to be sorted out and overcome. Essentially, it is actually technically impossible to have identically functioning keyboard layouts across the platforms you specified.

However, Keyman Developer is a powerful 3rd party software tool for keyboard layout and text input development which comes as close to meeting your requirements as I think you can hope to feasibly find. It is the only tool of its type that I am aware of which is available to the public. While third party software is not ideal, I assert that, considering all that it has to offer, Keyman is worth considering—depending on what exactly your goals are (and how complex/unique your keyboard layouts are).

Keyman's Developer package is a robust tool capable of generating various types of output files including all-in-one installers including fonts of input methods/keyboard layouts for not only any vaguely recent version of Microsoft and Apple desktop OSes but also for their respective mobile platforms/devices, as well as *nix-based platforms including for Android. Which means that it also facilitates development of on-screen virtual keyboards—ALL using one integrated tool, editing a single unified project file! PLUS, it's recently become open-sourced and free! I don't think you can hope to beat that... In order to support the flexible, advanced functions & features required by many complex scripts Keyman uses its own engine instead of the OS-native files/technology (.klc/.dll or .keylayout) which do not support the advanced context-sensitive features offered by Keyman, which are required by so-called "complex" languages/writing systems (mainly this includes the scripts of South Asia like India & Tibet which must often re-order characters or select characters dynamically based on surrounding text and still allow editing after the sequence is completed without having to retype the entire sequence). KMFL must be installed and used on *nix-based systems to compile the keyboard from the Keyman source file. (KMFL is a port/rewrite of the Keyman engine).
The Keyman engine (or equivalent) seems quite efficient and requires few resources and it is also quite mature and seems very stable, running smoothly & reliably without causing problems.

Although most of the various supported platforms and formats supported by Keyman have some kind of inherent or technical limitations (which I touched on earlier like unique modifier keys), or their development is still in progress which may restrict certain features from working/being (fully) implemented. Keyman allows for customization and optimization of functions unique to each platform to be included/encoded to help mitigate these issues/differences.

As I mentioned, all of the Keyman products have recently been migrated from commercial to open-source as a result of SIL acquiring the Keyman project from its original owner: Tavultesoft. SIL has access to the resources to support its continued development by the original developer with the addition of some support staff and a user forum.

Depending on the complexity of the language/writing system which the keyboard is being designed to support, it may be possible to complete the project using the only the features supported by Keyman's graphic UI. However, the more complex features like dead keys, contextual reordering and substitution require the use of Keyman's keyboard description language (a coding/scripting language) which has a fairly steep learning curve for the typical end-user.

This description language is very flexible and extensible allowing for complex text handling and processing, including Unicode normalization, context based glyph reordering and substitution. It also offers features which are more along the lines of a proper "input method" (meaning it includes some basic graphical overlaying elements/windows) such as either automatic or press-and-hold pop-up lists of possible outputs. It also offers a unique and convenient feature of using repeated keystrokes/tapping of a key to cycle through a looping list of outputs. I especially like this feature! While you could store a long list of characters in one key, I find it more practical and useful to have 2-5 at most. I use it on the bracket keys to provide access to some uncommon brackets used by a scripting language I use, as well as on other symbol keys to access not often used symbols. It's great because I don't have to remember a specific modifier combination, I just tap the key until the character I want is printed, if I accidentally pass it I just keep tapping till it comes back around. It can also be set up to make automatic substitutions similar to how the "Compose Key" works; substituting +- for ±, and -+ for ∓ and similar sequences for characters like ≤ ≰ ⪇ ≦ ≨ ≮ ≲ ≠ and so on.

As I touched on above, the language used to create the advanced features seems less than ideal and intuitive to me. I also found some of the documentation for the syntax and 'vocabulary' of this keyboard description language to be somewhat vague, ambiguous or confusing and in need of augmentation, expansion or improvement. However, this seems to be improving and still being developed. The user forum does not appear to be very active (there's not much there!), although responses to questions do seem to be posted quickly.
Even more importantly IMO, the language itself feels cumbersome, overly/unnecessarily complex and a bit counter-intuitive to me as far as how certain usages/features must be notated/described in the code— but I am not a developer/coder so my assessment should be considered in that context and 'taken with a grain of salt'. I have found that the developers seem fairly open to consider and evaluate feature requests, suggestions and feedback about the software, scripting language, as well as the documentation.

Fortunately, Keyman already supports over 1,000 languages, and the source files/code for those may be observed, studied, modified and even copied to be inserted and recycled into your own projects.

A number of different types of files and packages can be generated, from various types of source files to fully automated installer packages containing the Keyman engine, icons, and even fonts and of course the keyboard layout and text handling files. You can even create customized, user toggle-able settings which activate different behaviors in your keyboard.

It's an unfortunate shame that Keyman does not have the ability to at least import the OS native keyboard layout formats. That would really be exceptionally helpful and amazingly fantastic! It is open-source though, so someone with the skills, motivation & time could begin to work on it. It may also be possible, with enough requests & comments to their forum, to convince their developers that they should work on this.
Such a project might also be a good candidate to farm out to an inexpensive freelance coder looking for work abroad to tackle. Unfortunately, many of Keyman's features are simply not supported by the keyboard layout/input APIs of Windows and MacOS so it simply isn't possible to try to have Keyman generate the native keyboard layout files.

~~~~~~ Changing the output/function of any keys which do not produce text (meaning: modifier/command keys, function keys, media keys, editing keys (up, down, backspace, etc.) and so on) is not considered part of a keyboard layout by most operating systems and it is not natively supported by Windows at all. MacOS provides a way to re-assign modifier keys in the Keyboard control panel, and there are various tools for the different flavors of *nix which allow similar often more extensive customizations.
There is a third party tool for Windows called KbdEdit which actually generates standard klc files and DLL installer packages for Windows. KbdEdit is pretty much like the way I imagine how MSKLC should be... Quite powerful and flexible enough to be able to do just about anything- including the creation of very complex keyboard layouts with chained deadkeys... It also has the ability to re-assign any key to numerous obscure v_keys which includes the modifier keys on Japanese/Asian keyboards. A creative, re-purposed use of these obscure modifier keys could potentially bridge the gap between the discrepancies between the OSes I mentioned previously; but there is no straight forward or obvious way to implement this. I believe that a Windows keyboard can actually technically have up to 15 separate shift/modifier key states/levels/layers! One of them (Kana key) can be locking/toggle-able- like caps lock. The keyboards work without any additional or third party software. But there is no tool to port them to Mac or Linux of course.

Karabiner is the closest MacOS analog, although it has a completely different premise and doesn't really have anything directly to do with keyboard layouts per se; although it has an xml-based native language which makes it possible to create custom modifier keys and key behavior (like having a modifier key output a character if tapped alone and not used as a modifier, and so on). Although for a custom modifier to be useful all possible desired outputs have to be programmed manually using a language not specifically designed for such purpose. But it is extremely versatile and powerful and it can do some pretty cool low-level tricks and functions. It's also free!

Ukelele is free tool to use for MacOS which generates the native keyboard layout files and bundles. It has a much more powerful and intuitive interface than MSKLC and a very helpful forum frequently visited by the developer. It is also owned by SIL, although not open-source. It would be nice to see some integration of Ukelele's GUI into the Keyman Developer package; for creating dead-keys for instance. And of course, it can not import or export layouts from other platforms.

2
  • I can relate to your aversion to 3rd party/additional software; however, that is exactly what you asked for in your original post "any software"—and I think it is fairly obvious that there will/would never be a "native" tool by Microsoft or Apple to translate/port or generate keyboard layouts for a foreign OS, so anything available would HAVE to be 3rd party software. It would have been helpful if you offered more details about your goals/purpose/objectives and restrictions/limitations. The current request is fairly vague and open-ended.
    – AuralArch
    May 9, 2018 at 3:18
  • I posted this because the only other response did not actually answer the original question (as I understand it) at all! Perhaps the original post has since been modified? But, none of the software listed is able to import or export keyboard layout formats of other operating systems; and this is not even acknowledged although being an apparently key component of the request. And the "similar" question for which a link was provided is entirely different, only related because it concerns keyboard layouts!
    – AuralArch
    May 9, 2018 at 3:29
0

Yeah, and it is pretty straight forward.

Mac OS On Mac OS everything is onboard, simple and step by step instructions can be found here

Windows Microsoft offers an own instruction list here: http://msdn.microsoft.com/en-us/goglobal/bb964665.aspx

Linux Creating a custom Linux keyboard layout with the help of xkb.

A similar question has once been asked on StackOverflow: https://stackoverflow.com/questions/826986/how-to-make-a-custom-keyboard-layout

3
  • 1
    I was looking for a way to generate all three at once, also windows doesn't native support changing of the modifier keys, so I believe you have to use autokey to get around that
    – William
    Jan 3, 2013 at 2:56
  • 1
    @Lime: Considering that Windows uses DLLs, OS X Jaguar and later uses XMLs and X11 uses some sort of (C based?) code, good luck finding an app that will generate all 3 at once. Might be time to code a custom app, if you can...
    – Karan
    Jan 3, 2013 at 17:20
  • @Karan Thanks for the Mac OSX link. Also hadn't been aware of the DDLs in windows currently I am using autohotkey to create the custom windows keyboard layouts. Seems to be working okay.. Maybe after I finish understand all 3 systems intricacies I can create a cross platform generator
    – William
    Jan 5, 2013 at 6:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .