• You are not logged in.

    Use QMK instead of XKB?

    • Started by mklcp
    • 5 Replies:
    • Reputation: 0
    • Registered: 07-Apr-2021
    • Posts: 2

    Hey there.
    This is not really related to Colemak, but to keymap systems.
    But there is a lot of tinkerers here who could be interested.

    I'm too a keyboard DIYer. I've spent years tinkering with XKB.

    XKB works for simple things, but for more complicated ones, it is old, buggy, full of crufts.

    I'm myself using a lot of tricks for my keyboards. I'm fed up with them.
    I've wasted countless hours debugging this horrible piece of software.

    And for anything complex, XKB is just horrible.
    e.g. yesterday, I was trying to put an Altgr layer on the level2 of left alt, and somehow it interacted with my NumLock level, making it unusable..
    I've encountered many many of such weird bugs.

    Moving forward, I have quite specific needs when it comes to keymaps, and QMK allows for way more customization that are simply impossible or horribly complex with XKB (e.g. Tap Modifiers).

    I will not continue to argue how QMK is way superior to XKB. It is pretty obvious to me.
    But if you don't agree, I open to discuss that point in more depth.


    So my first question is: is it possible to totally ditch XKB and use QMK instead?
    That is, inside X or Wayland, totally remove XKB and use QMK?


    I know QMK is a microcontroller for hardware keyboards, so this seems complicated.
    But it is is so much more convenient to use its capabilities for specifying keymaps than XKB.

    I'm not knowledgeable in X or Wayland (beyond XKB).
    For X, I doubt it's possible to ditch XKB.
    But Wayland is sold as being more modular.



    So, second question: would it be possible to make Wayland use QMK in lieu of XKB? Wouldn't that be awesome if we could write a keymap in QMK's way not for a programmable hardware, but for a software keymap.

    Last edited by mklcp (07-Apr-2021 11:54:25)
    Offline
    • 0
    • Reputation: 157
    • From: Oslo, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,058

    It's entirely possible to use QMK instead of XKB for your remapping purposes. But to do that, you need a programmable board or a QUICKIE device. See the BigBag. You cannot impement QMK as a OS component, unless you're a C programmer with a hell of too much time and skill on your hands.

    Whether QMK is in fact all that superior to XKB is still debatable. They do different things, basically. For making multilevel mappings they have different tacks. QMK can only send keyboard key presses, not the symbols resulting from them. Therefore, you'll need both the OS keyboard mapping system and the power of QMK if you want both symbol-rich layers and fancy key stuff like Tap-or-Mod keys. On Windows, I can make the EPKL program do most of the things QMK does while also providing a plethora of symbols and strings, but it's hard to code in and I don't know of anything like that for Linux. It'd be possible to make but I'm not sure what tools exist for it.

    Last edited by DreymaR (07-Apr-2021 12:55:08)

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 1
    • Reputation: 103
    • From: UK
    • Registered: 14-Apr-2014
    • Posts: 873

    The essence of what you are asking for does already exist: kmonad

    QMK is hardware dependent so only exists on programmable mechanical keyboards that support it. But it sounds to me like what are asking for is something that does the same kind of stuff as QMK, but is configurable in software, and usable as a possible replacement for XKB mapping files.  Kmonad is that thing.

    Because it basically replaces incoming keycodes, it's not a full replacement for XKB. In particular, support for a full range of unicode characters is not as complete, although partial support exists via compose sequences. But kmonad does offer some things that XKB doesn't, such as arbitrary numbers of layers, tap mods, dual-mode keys, and similar fine-grained control of key press events that QMK gives.

    I am going through a phase currently of trialling kmonad as a complete replacement for all my XKB remapping needs. I expect to be posting more about that soon.

    Last edited by stevep99 (07-Apr-2021 14:02:11)

    Using Colemak Mod-DH with some additional ergonomic keyboard mods.

    Offline
    • 2
    • Reputation: 157
    • From: Oslo, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,058

    I actually forgot about KMonad. Silly me. Yes, that's indeed the closest you'll likely come to the comfort of QMK on your Linux (or Mac or even Windows – although on Windows there's some decent competition as mentioned) system.

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 1
    • Reputation: 0
    • Registered: 07-Apr-2021
    • Posts: 2

    @DreymaR

    Thank you! However I'm only using Linux and MacOS, not windows, so EPKL is a thing

    By the way, I'm also grateful for your Bag of Tricks, it helped me tame XKB, even if it's not perfect

    @stevep99

    Yes this is totally what I want! KMonad looks great!

    I look forward reading more about your trial with KMonad.
    Has it any big limitations? How incomplete is unicode support?


    As a funny sidenote, I've already written a keymap build system (a transpiler to XKB if you will) for managing all my keymaps and experimenting with new keyboards

    Offline
    • 0
    • Reputation: 103
    • From: UK
    • Registered: 14-Apr-2014
    • Posts: 873

    In XKB of course, it's easy to add all sorts of symbols, or even put in Uxxxx values for unicode symbols that don't have XKB names. But because kmonad (and QMK) only send keycodes, you can't send arbitrary unicode characters directly. 

    Kmonad can use the linux compose character system to send characters though. For example,  the sequence of keys "compose 1 2" produces ½. So such characters can be typed using kmonad, but what's actually happening under the surface is Kmonad is sending three keycodes in quick succession which is converted into a single character by the OS.

    Last edited by stevep99 (08-Apr-2021 16:35:04)

    Using Colemak Mod-DH with some additional ergonomic keyboard mods.

    Offline
    • 0