Changed my keyboard layout in hardware to colemak!

@ DHowett Thanks for the quick response.

Yeah I think my head was spinning when I 1st attempted to write the script. I really appreciate you making sense of it.

I didn’t realize my layout was so strange. Now that I think about it though it probably is because I used parallels on mac to run linux VMs for years which mapped keys oddly. cmd as ctrl and alt as meta.

The FN on the right was an idea I got from another post which made sense to me.

having ctrl under shift also makes sense for a lot of shortcuts.

But I guess it is pretty odd now that I tried to justify it.

Thanks Again!

3 Likes

for mapping itself - yes, but the whole “cmd” button in macOS puts much less strain on you left hand. i used windows then linux for 9 years before trying macOS for the first time. it took me 4 days to get used to cmd+c/v/x/etc combinations and now I can’t go back to ctrl+stuff the reason is simple: your left thumb in resting position will be approximately between space and “cmd” (alt on windows standard keyboards) and your pinky will be in area of caps lock and tab. your thumb so called “strong” finger, while your pinky is “weak” finger. because of that generally cmd-based combinations put muuuch lest strain on your hand. i strongly recommend trying that yourself :slight_smile: the only inconvenience outside macOS is the fact that apps and OS are not unified and in 99% use ctrl-based shortcuts exclusively. this gets annoying with copy/paste conflicting with terminal shortcuts

1 Like

I also prefer Mac keyboard layout and I configure my laptop to have the following order of bottom keys: ctrl, fn, alt, logo, space, logo, alt. Logo key is then used for ctrl shortcuts in X11 (so logo key is mapped to ctrl, while ctrl key is mapped to super key). While I patch Ubuntu/Gnome Terminal to use super key as ctrl key, so that visually you press ctrl-c and it sends super-c to Terminal which then interprets it as ctrl-c (and you send and interrupt). If you press logo-c, that sends ctrl-c to Terminal and window program copies selection to a clipboard.

I would love if Framework could support a custom keyboard layout like this, including making a keyboard cover which would match those keys.

3 Likes

Will this run before LUKS so that my LUKS password will be typed using the remapped keys?

Cc @DHowett

Here’s Dvorak with the Caps mapped to Escape

#!/bin/env bash
# Framework en-us dvorak

ectool raw 0x3E0C d1,d1,b3,b2,w0d # Tab > Tab
ectool raw 0x3E0C d1,d1,b0,b2,w52 # q > '
ectool raw 0x3E0C d1,d1,b6,b5,w41 # w > ,
ectool raw 0x3E0C d1,d1,b2,b4,w49 # e > .
ectool raw 0x3E0C d1,d1,b6,b6,w4d # r > p
ectool raw 0x3E0C d1,d1,b3,b6,w35 # t > y
ectool raw 0x3E0C d1,d1,b3,b7,w2b # y > f
ectool raw 0x3E0C d1,d1,b6,b7,w34 # u > g
ectool raw 0x3E0C d1,d1,b6,ba,w21 # i > c
ectool raw 0x3E0C d1,d1,b3,b8,w2d # o > r
ectool raw 0x3E0C d1,d1,b5,bd,w4b # p > l
ectool raw 0x3E0C d1,d1,b6,bd,w4a # [ > /
ectool raw 0x3E0C d1,d1,b6,be,w55 # ] > =
ectool raw 0x3E0C d1,d1,b2,b8,w5d # \ > \

ectool raw 0x3E0C d1,d1,b4,b4,w76 # Caps > Escape
ectool raw 0x3E0C d1,d1,b7,b2,w1c # a > a
ectool raw 0x3E0C d1,d1,b4,b5,w44 # s > o
ectool raw 0x3E0C d1,d1,b7,be,w24 # d > e
ectool raw 0x3E0C d1,d1,b7,b6,w3c # f > u
ectool raw 0x3E0C d1,d1,b2,b6,w43 # g > i
ectool raw 0x3E0C d1,d1,b2,b7,w23 # h > d
ectool raw 0x3E0C d1,d1,b7,b7,w33 # j > h
ectool raw 0x3E0C d1,d1,b7,ba,w2c # k > t
ectool raw 0x3E0C d1,d1,b7,b8,w31 # l > n
ectool raw 0x3E0C d1,d1,b7,bd,w1b # ; > s
ectool raw 0x3E0C d1,d1,b0,be,w4e # ' > -

ectool raw 0x3E0C d1,d1,b1,b5,w4c # z > ;
ectool raw 0x3E0C d1,d1,b0,b5,w15 # x > q
ectool raw 0x3E0C d1,d1,b0,b0,w3b # c > j
ectool raw 0x3E0C d1,d1,b0,b6,w42 # v > k
ectool raw 0x3E0C d1,d1,b1,b6,w22 # b > x
ectool raw 0x3E0C d1,d1,b1,b7,w32 # n > b
ectool raw 0x3E0C d1,d1,b0,b7,w3a # m > m
ectool raw 0x3E0C d1,d1,b0,ba,w1d # , > w
ectool raw 0x3E0C d1,d1,b0,b8,w2a # . > v
ectool raw 0x3E0C d1,d1,b0,bd,w1a # / > z
3 Likes

For all my colemak-dh lovers out there. (ANSI variant). With caps lock replaced with backspace.

#!/bin/bash
# Framework en-us qwerty >>> colemak-dh (caps lock changed to backspace) 

ectool raw 0x3E0C d1,d1,b3,b2,w0d # Tab > Tab
ectool raw 0x3E0C d1,d1,b0,b2,w15 # q > q
ectool raw 0x3E0C d1,d1,b6,b5,w1d # w > w
ectool raw 0x3E0C d1,d1,b2,b4,w2b # e > f
ectool raw 0x3E0C d1,d1,b6,b6,w4d # r > p
ectool raw 0x3E0C d1,d1,b3,b6,w32 # t > b
ectool raw 0x3E0C d1,d1,b3,b7,w3b # y > j
ectool raw 0x3E0C d1,d1,b6,b7,w4b # u > l
ectool raw 0x3E0C d1,d1,b6,ba,w3c # i > u
ectool raw 0x3E0C d1,d1,b3,b8,w35 # o > y
ectool raw 0x3E0C d1,d1,b5,bd,w4c # p > ;
ectool raw 0x3E0C d1,d1,b6,bd,w54 # [ > [
ectool raw 0x3E0C d1,d1,b6,be,w5b # ] > ]
ectool raw 0x3E0C d1,d1,b2,b8,w5d # \ > \

ectool raw 0x3E0C d1,d1,b4,b4,w66 # Caps > Bkspc
ectool raw 0x3E0C d1,d1,b7,b2,w1c # a > a
ectool raw 0x3E0C d1,d1,b4,b5,w2d # s > r
ectool raw 0x3E0C d1,d1,b7,be,w1b # d > s
ectool raw 0x3E0C d1,d1,b7,b6,w2c # f > t
ectool raw 0x3E0C d1,d1,b2,b6,w34 # g > g
ectool raw 0x3E0C d1,d1,b2,b7,w3a # h > m
ectool raw 0x3E0C d1,d1,b7,b7,w31 # j > n
ectool raw 0x3E0C d1,d1,b7,ba,w24 # k > e
ectool raw 0x3E0C d1,d1,b7,b8,w43 # l > i
ectool raw 0x3E0C d1,d1,b7,bd,w44 # ; > o
ectool raw 0x3E0C d1,d1,b0,be,w52 # ' > '

ectool raw 0x3E0C d1,d1,b1,b5,w22 # z > x
ectool raw 0x3E0C d1,d1,b0,b5,w21 # x > c
ectool raw 0x3E0C d1,d1,b0,b0,w23 # c > d
ectool raw 0x3E0C d1,d1,b0,b6,w2a # v > v
ectool raw 0x3E0C d1,d1,b1,b6,w1a # b > z
ectool raw 0x3E0C d1,d1,b1,b7,w42 # n > k
ectool raw 0x3E0C d1,d1,b0,b7,w33 # m > h
ectool raw 0x3E0C d1,d1,b0,ba,w41 # , > ,
ectool raw 0x3E0C d1,d1,b0,b8,w49 # . > .
ectool raw 0x3E0C d1,d1,b0,bd,w4a # / > /

So does this approach work to remap the airplane mode key on F10, which seems to be the only function key that you can’t change from the OS? (Disabling Flight Mode / Airplane Mode Function Key F10 - is it possible?).
I’m a bit confused by some of the complex ins and outs of this low level system-dependent stuff.
I concur with the poster there that the Airplane key is obsolete, and my goal would be:

remap the Airplane mode key on my Framework to “Home” (so “Home” is airplane key and “End” is the Framework cog, since I have no use for physical buttons for those features)

In particular, does anyone have an example that would do that, on a Framework 13, that I can run on Linux (Ubuntu 22.04).

I think not, as I understand it: You would need to have these remaps run in your initrd image as I believe that is what is providing the environment for you to type your LUKS password. Your normal systemd system services wouldn’t be run until after your LUKS partition has been decrypted.

(Same sort of thing as having an ssh server setup in your initrd so you can type your LUKS password remotely after a reboot - I may give doing remaps in initrd a try in my NixOS config at some point as nix should make automating this pretty easy). Presumably with this arrangement you could drop running these remaps during the system start and just run them on resume from sleep as they should persist in the EC’s memory after having been set by the initrd image which would always happen when booting.

This is the code here: EmbeddedController/board/hx20/keyboard_customization.c at 553827caae7134d45a0617af9c201e333eab9a26 · FrameworkComputer/EmbeddedController · GitHub

It works by checking if Fn is pressed and then calling a different function for HID stuff. I think all you have to do is move the F10 and the rfkill/airplane mode would move with it but I could be wrong. There is only the hid enum and no scancode listed so I am pretty sure.

I see that it is possible to change the key map/matrix temporarily until the EC reboots with commands. Why not just modify the EC code directly and flash the modified version so that it lasts until next update? This way a systemd job is not needed on every reboot.
Is modifying the keymap in EC firmware source code possible?

Havent tried it, but absolutely should be possible.

Drawbacks; will be wiped during BIOS update

could mess up your EC during flashing process - if you do, everything like e.g. the power button won’t work and the laptop can’t boot anymore. Would have to use clip-on programmer maybe to restore it.

Current method in this post is much safer.

1 Like

Minor addition, with at least on one FWL13 version (if not all) it’s a WSON 6x5mm chip. Less convenient than using a clip-on. You need to hold a pogo pin jig down on the chip during the process.

1 Like

Thank you for the information. I found the pogo pin jig for a few dollars from China and I already have the programmer itself, so I guess I might prefer flashing the EC chip since I don’t have to deal with scheduling tools in the OS and/or the remapping key won’t happen in pre-OS states like in the UEFI if shutdown for more than 30 seconds.

Please advise on where the matrix is stored in the EC GitHub repository as I cannot seems to find the key matrix in the source code.

1 Like

Might be here: EmbeddedController/board/hx20/keyboard_customization.c at 553827caae7134d45a0617af9c201e333eab9a26 · FrameworkComputer/EmbeddedController · GitHub

1 Like

It depends on which laptop you have.

Thank you for replying.
I actually haven’t bought a framework yet, but planning to. However I have not decided on if I should get the AMD or Intel(ArchLinux user, may switch to NixOS).
Let’s say I have the Framework 13 with Ryzen 7840U and JIS input cover, which file would that be?

The only big problem why I can’t use Colemak is mostly for gaming. And I’m just too used to QWERTY of course. WASD has become the big standard, almost to a fault. And any game that can’t reconfigure those keys makes life pretty difficult. Hahaha.

Also, the keys used for “HJKL” or “JKL;” for Vim and Vim-related tasks would need to be remapped as well, but that’s less of a big deal than most things with hard-coded WASD.

I mean technically, “R” and “T” are between two of them so… just spread your fingers out like you’re playing the piano. :laughing:

This thread exists to discuss an individual maker who has switched their hardware keyboard layout to Colemak. It is not likely to be the correct audience with which to air your grievances regarding Colemak.

If you do not have anything positive to say about this modification or about Colemak, you may want to find a different thread! :slightly_smiling_face:

1 Like

I have hotkeys setup that trigger the scripts to switch the layouts specifically for gaming. On my PC, i have a QMK keyboard that has a switch on the side i programmed to switch layouts in the keyboard firmware.

Apologies to anyone offended,

I was trying to remain constructive and neutral and point out some criticisms about Colemak that maybe someone else reading should be aware about first before trying something like this!

Of course, I know QWERTY has its own downsides, too. Namely more inefficient to type on than Colemak.