Discusion; Keyboard Layout for Linux

Hey, Sorry for the long post. I have a query regarding keyboard layouts on Linux as a whole or KDE specifically. I’m designing my own keyboard and I keep going around in circles about the changes and uses for (1) Modifier Keys, (2) Navigation Cluster, (3) Soft Functions. I’m interested in opinions of personal taste and experience.

Note that my keyboard is intended as a Linux dedicated keyboard designed for it. Reference to Windows and macOS are just for assessment purposes. This is intended to assist me in my own design, but might be of use to others wanting to come up with their own keyboards. I will be using the QMK firmware for easy reconfiguration. I’m working on creating my own key legends. I have most of what I need for that so I can start experimenting. Most of the board is laid out for manufacture. But it’s not ready since everything below would indicate changes to be made yet.

1) Modifier Keys

Background: I’m fairly new to the Linux community coming from the Apple ecosystem. To say that I am quite familiar with the uses of their modifier keys (Command, Option, Control). In MacOS I use all three of these modifies quite heavily.

  • Control: Seems to be universal across OS’. With the exception that for MacOS it isn’t the primary since they use Command / Alt as their primary. I’m happy enough using it as the primary even where I’m using both frequently now. Switching between the layouts doesn’t seem to get in my way much anymore.

  • Option / Win: I have some familiarity with it in Windows but was a long time ago I used it on any regularity. Not used it too much in Linux yet. That’s all been in Fedora KDE. I hadn’t really noticed but I read that one of the modifier keys, Win (Option) I think, is not used by default? I guess this would make sense if the scheme was following windows since I guess you could argue that the Win key is also not used in Windows since it got a very specific fixed function, compared to Apple using it as a modifier. Am I correct in remembering that correctly? If that’s the case I would prefer to remove it. I find the application launcher menu to be in my way. I keep popping the thing up randomly. I have removed the key-combo from it and assigned Peek to the Pause button to switch out of full screen games and apps. I have not yet got into using virtual desktops. I use them in MacOS. I think that’s just because I’m still acclimatizing.

  • Command / Alt: seems to be utilized as a secondary in Win and KDE and apple seem to use Option / Win as their secondary with Control as third. I guess it makes sense to be using Alt as its legend in Linux context. I’m curious how other people feel about the application launcher being set to the Win key. It gets in my way all the time and I get that’s a me thing. I personally don’t see much point anyway since i will still grab the mouse to utilize it. No real need to assign it to a key.

So I’m inclined with my current thinking that I would delete the Option / Win key from the keyboard and just have Control and Alt / Command pair on each side of the space key. A compromise would be to only have it to the right of the Alt and Control pair, since that side is use a bit less. But on my own keyboard it wont be on the keyboard unless I’m mistaken about its use in KDE.

2) Navigation Cluster

Referring to the rectangular block of keys located above the arrow keys. I have heard it referred to as the “Navigation Block” which I think included the arrow keys. Items of interest here are: Insert, Delete, Home, End, Page Up, Page Down. I consider Print Screen, Scroll Lock, Pause, Number Lock to all be part of this even though it’s not always grouped with the former. They seem to be the precursor to Soft Functions but are dedicated. I have gone through them and tried to make a list of my own preferred set in context to my own project design work flows.

  • Print Screen: I fine this to be useful but not high priority I prefer to keep it handy. Hate the key legend though.

  • Scroll Lock: I’ve never used. To be honest I’m not sure what it’s original use case is. Delete.

  • Pause: Well not seen this do anything but then I don’t listen to much on my Linux machine. I assume this an actual media pause button. I have assigned Desktop Peek to it. These days we have a set of media keys which I would add as a group of new keys in this list. Delete.

  • Insert: This doesn’t do anything as far as I can figure. Delete.

  • Home, End, Page Up, Page Down: All useful to me.

  • Delete: Useful to me. But I think it makes more sense being shifted up a row so that it sits to the right of the Backspace key.

  • Number Lock: To me this is redundant and I never turn it off. My BIOS and KDE have options to have it turned on at startup. Delete.

  • Media Keys: Play / Pause, Sip Forward, Skip Back, Progress Back, Progress Forward? I use that a bit in YouTube. Probably not have the four back and forward variations though.

  • Volume up, Volume Down: I happen to mostly use headphones and use the volume controls on it. Also monitor has it’s own. Not convinced I would omit these since they are probably still very useful.

  • Desktop Peek / Program launcher: New Key - Maybe a home button. Legend “Home”.

  • Search: New Key - I don’t use it a lot. I know that you can just start typing while the desktop is selected. But this kind of hidden functionality irritates me so much and I forget it’s there. But usually when I do a search I’m looking for a file and use the Dolphin search field for that. Maybe this is not necessary.

3) Soft Functions

All the secondary F-Key assignments drive me absolutely nuts. Most items are easily accessible with the mouse and are not critical. For me they will not be assigned. Ones I like will get dedicated keys as part of, the poorly named, Navigation Cluster. Probably use a better name.

I think that’s it for now. No doubt I’ll come up with more. Anyway thanks in advance for any thoughts opinions etc. Keep it cool.

The key that in Windows is “Win” is called “Meta” in KDE (but “Super” in most other Linux desktop environments).

It’s heavily used for shortcuts at the level of the desktop environment (i.e. Plasma shortcuts rather than app-specific shortcuts).

I find myself using it more on Linux than I did on Windows, in fact. (It’s suboptimal on my own QMK layout, since I tucked it away on the right little finger, but I want to make it more accessible now that I’m on Linux.)

No, “media pause” is a separate keycode (KC_MEDIA_PLAY_PAUSE in QMK).

Traditional pause (KC_PAUS in QMK) doesn’t have much use these days. But it is one of your choices in KDE for a Compose key, so I have it on a layer for that purpose. It avoids sacrificing a more useful key for Compose.

Interesting. So it should probably stay. Wonder if it would be swapped position with Alt. I guess at this point I would just be adding confusion potentially. Not for me so much since i’m already confused LOL.

What do you mean by Compose. What does that do?

My keyboard will have some extra blank keys besides any F-Key mappings I can use. I originally designed it with an entire additional row for that purpose. but I got cold feet second guessing how useful it would actually be. The current version of the PCB still has them. Original intention is to assign some frequent tools for apps like blender and KiCAD etc. Graphic programs if I can find one on Linux I don’t hate and works.

Hmm regarding the name of the Win key confused me. I knew it to be Meta key but when I searched around for some clarity I just became uncertain as it seems it being different across the distro’s causes confusion where a lack of clarity causes problem. I appreciate your clarity on that.

It allows various special characters to be typed. For example, Compose followed by oc types ©.

i would never want to use such a keyboard in linux and would prefer to stick with a standard spec 104-key full keyboard, even with keys i don’t (yet) use, because plasma lets you make so many keyboard shortcuts for things that it would be easy to run out of keys.

i would want to keep all my modifier keys because they can be repurposed.

for instance the Alt key on the right side, i use for my 3rd level shift key to access a whole separate set of characters for each keycap.

i also use the Ctrl key on the right side for the Compose key which gives access to any character i desire using 2-4 letter combos and my own custom .XCompose file.

the Ins key is for switching between the insert and overwrite cursor in a text application

You’re a record breaker. I thought I talked too much…

The Meta (Win) key is SUPER useful - I mean really, it’s used in about 75% of my shortcuts… indeed, the cluster in that corner is brilliant, the number of combinations that can be made with Shift, Ctrl, Alt, and Meta - not to mention the ability to separate Right and Left Ctrl and Alt for some stuff - it’s awesome.

I don’t like Caps-lock, so I use both Shift keys to get that, and any shift to ‘unlatch’ it. Shift_Caps-lock is my compose key, and Right Alt is my ‘3rd level chooser’.

You can disable the ‘Win’ or ‘Meta’ key from launching the menu - you can make that Alt_F2 (as it used to be) or Alt_Space (which I use for my krunner shortcut, but you could also map it to something else…).

Scroll-lock, Pause and Insert should definitely be moved to a function layer.

I have a knɔb, which I fully recommend if you can fit one - it manages quite a few functions (System master volume up and down, press to play/pause, then with modifiers (ctrl, Alt, Ctrl_Alt, Meta_Alt… use your brain - it can do brightness, gamma, individual application volume, window expand/contract - it’s truly an awesome tool).

Just ease yourself in, make small adjustments as you go along - and fully expect not to ‘get the job done’.

For every few changes you make, you’ll hit regressions - realise you blocked something used by some application…

For years I never used Alt_S in Konsole - it just never worked, but that’s because I had the menu showing, so that Alt_S would pull a menu down instead of prepending sudo.

Just get familiar with the settings for keyboard shortcuts, how to add them, how to search and check - remove stuff that’s not useful and so forth.

I’m also having a lot of fun with the other layer - the long press layer has taken away the need to remember many shortcuts (like half a dozen currencies useful in a multilingual forum… €-¥-£-฿ or maths (2×2 ≠ 2x2).

Finally, spend time with .XCompose (as I said, my CapsLock is the gateway to being able to type ⇪CapsLock or µmanage small phrases (in ไทย which I can’t type because it takes forever to remember where those keys are…).

Enjoy it. You’re about to uncover a massive amount of choice for reconstructing your experience, but with great freedom comes the ability to tie yourself in some ridiculous knots.

So take notes, take snapshots and backups, and remember:

<Multi_key> : “:shortcake:

  • Now eat it.

Page Up / Page Down is a good use for it too!

Hmm just got up for the day with a fresh brain. Just poked through shortcut lists. I didn’t realise how much it is used here. I guess I just don’t use them much. I’ll chalk it up to being new and no knowing the shortcuts yet. Accustomed to MacOS ones.

I understand. I often try to keep things default for the ease of shifting from installation to installation, in life-in-general. But it’s not always easy for me not to be irritated by things that don’t make sense to me. It’s the fate of a designer. Always meddling.

Yes I’ll be keeping three modifier keys. :slight_smile: Glad I brought it up.

Wow you are a shortcut power user! Awesome!

Just to clarify I’m not removing most keys where I say delete physically from the keyboard. yes I was suggesting that with the Meta key. But the others it’s a matter of assigning them new default with new legend that makes more sense, to me at least. Additionally I’m still likely to add the second row of unassigned (by default) functions. Likened to the F-Key row but without the legends. What I was thinking of doing was to put the f-key legends on the front face of the key leaving the top clean. The additional ro I have seen refereed to as the M-keys or the C-keys. So I might do the same for them. I have grouped them in lots of four as was more common in the past. Don’t see that as much now. But it helps to quickly identify location where keys have no legend until muscle memory forms.

QMK can handle quite a few layers and once the keyboard is added to the list can be modified in firmware via browser and flashed with a small utility. Advantage of that is it’s done in keyboard so will (I’ve not tested this) work on other systems without any configuration on that system. It’s handled by the keyboard. That of course doesn’t handle the differences between OS’ but that is just a given no matter how you do it.

HAHA Runs in my family. You should see us try get out the door or hangup a phone… I’m sure you know what it’s like.

Yea I use the three on MacOS prodigiously. As I mentioned in my last reply (to someone else) I think I just haven’t familiarized myself yet. I will keep the three. Personally I wont have the FN key as a personal irritation. obviously this is dependent heavily on how each individual likes to use their keyboards. I just find it in the way. I like discrete things. One of the reasons I’m getting more and more frustrate with Apple. use their stuff for about 40 years. They used to know how to design an interface. that’s all gone now. I also rejected Gnome GUI for being too much like Apples. There are other reasons I am diverting to Linux and not Windows which is getting off topic.

Interesting situation with the shift keys.

Well I was thinking the launcher menu could be alternately assigned to Home key which I think I might place top right apposed to the escapes top left. I experimented with it this morning and realised why key command for it is more useful to people than I expected. Bring it up with key and start typing to get the app you want. Looks to be actually reliable compared to Windows or MacOS since in my experience they don’t consistently put an ap at the first entry requiring a check and maybe an arrow key tap. On KDE it’s just apps. Or at least stock setup as mine is. My only real complaint is that it’s wedged between all the modifier keys. Not something that is on the MacOS keys; probably why it annoys me so much.

I had thought about putting a ‘knɔb’ on it. Honestly forgot all about it. It would definitely condense the soft function keys. I’ll add that to my list.

Yea I’m trying to to make too many permanent changes. I can always make new keys with different legends on them, or move them about along their rows. Switching rows is harder to reuse keys because of the physical profiles.

I have been designing this keyboard for a while now. Partly because I am assessing how I use it. What I learn about KDE’s setup and such. This topic is meant as a last stage for keyboard variant one. I expect there will be mistakes and regrets. But since this is my first keyboard it’s where my biggest effort goes. Later versions will be where physically I made a mistake or want new features. I have chosen to leave some things out of the design for that rrason. Trying to avoid feature creep. I will have a better feel on the next version if I really want to go to the effort to include a new major feature. Short-cut assignments are mostly just an assignment in software issue that may just require a new key with a new legend.

Tell more about this.

I live for design so I’m enjoying it a lot.

Just a small correction. I just realised there is other content in the list. Didn’t see that earlier.

“Compose” keys start the composition of a character with multiple keys.

For example: I have a little machine “GPD Pocket 3” with an English keyboard layout. However sometimes I also need to enter German umlauts. To make this possible I configured the keyboard in a way to have multiple “compose” keys to combine vowels with letters like ¨ to form umlauts like ä, ö, ü or Ä, Ö, Ü. In my case the exact input is [Caps]+['] followed by [a], [o] or [u] since I don’t need the [Caps] key on this specific device. By default the compose key would be [AltGr] for the keyboard layout I have configured (“English (US) – English (intl., with AltGr dead keys)”).

Also see Installing Kubuntu Linux on the GPD Pocket 3 | Arno Welzel which contains a more detailed explanation of the layoyt being used and how to change the compose key.

I use DSA with all the keys 1u size, which is one way to solve that :wink:

Also, the only legends I use are for the alphanumerics. All the other keys are plain colour keycaps, so any layout decisions aren’t really physically baked in, and I can just keep the freedom of changing the layout in QMK.

This is on a 58-key board though, I can see you’d want more legends on a full-size board.

LED brightness, Display brightness, Volume, Skip, Progress…

Problem I have is after looking into what it takes to add an encoder I would have to make some serious changes that basically will require me to re-spin (re-layout) the entire board. Not against doing that but it’s a serious decision.

The issue is to do so I need two pins for the encoding of the knɔb and a pin for the switch. I can put the switch into an empty slot in the matrix no problems. But as far as I can tell, right now, it needs two dedicated pins. I don’t know that the encoding will function within the key matrix itself. Maybe it can, but I suspect it can’t. The matrix cols and rows are repeatedly scanned for connections and depending on what the encoder is presenting it might always register as a connection. I’m unsure exactly how they work since they are not potentiometers which I’m sure those wouldn’t since they are analog in nature. It depends one whether an encoders idle state is off or on. They are divided into segments so possibly they register just at the time of rotation, sending pulses instead of changing the resistance. Good chance they are. If the two encoder pins are acting like two switches then I would expect it to work by just occupying two empty switch locations in the matrix which is fine.

If not I would have to free up two pins on the MCU of which I have used all the ones I have available. So I would have to delete two entire rows, or two columns, or one of each. Which would necessitating a rearrangement of the matrix table and that means rerouting the PCB design. A re-structure would require reduction of the number of custom keys (blanks) and shift some keys keys around in the matrix table. The issue with that is when designing a keyboards physical layout you have to run the traces around the PCB and laying the matrix out as close to how it will be physically makes it easier and less spaghetti. I’m using an ATMega32u4 which gives me twenty four pins to work with.

For FYI: two images attached.

The first one shows two tables. The top one is (out of date) showing the intended physical layout and the table below shows the matrix table with the keys placed within. Table is displayed with cols and rows each occupying a pin on the MCU. Note that the Matrix table rows and cols can be divided up as desired. Square tends to be more efficient. Mine is a bit more rectangular because I wanted to keep the main body of the keys arranged in their correct relative positions.

The second image is showing the schematic diagram of how the matrix is connected and drawn up similar to the matrix table for clarity.

Ahh I see. I never had to do that since I tended to use them directly from the font since apple seemed to make them available with option key and the appropriate key. e.g. If I press Option-g (alt-g) I get the copyright symbol ©. So never knew this was a thing. Cool

Amazing. I’ve heard of keyboards like this. I wouldn’t know where to begin :slight_smile:

I believe that’s the case (as illustrated here). The encoder outputs digital pulses on two channels, and the firmware needs to interpret that as clockwise or counterclockwise movements of the wheel. (The base QMK code does this for you.)

So the “analog to digital” part is all done inside the encoder, but the output isn’t simple “keypresses” for clockwise and counterclockwise movements which could be accommodated as part of your switch matrix - the firmware still needs to process the pulses.

As I understand it, each encoder needs two dedicated pins, separate from your switch row/column pins.

Some encoders can also be pressed down - that (as opposed to the rotation) works just like a keypress and would use normal switch matrix locations, I think. Mine do this, but they need so much force to press that it’s uncomfortable to use them for anything routinely.

Don’t take anything I say as 100% reliable though - I’ve only used prebought PCBs with hotswap sockets ready-soldered, I’m definitely no electronic engineer!