fabi1cazenave / qwerty-lafayette

QWERTY keyboard layout for French-speaking users
https://qwerty-lafayette.org/
106 stars 65 forks source link

AltGr is too opinionated and prevents lafayette42 from becoming rigid #113

Open lobre opened 1 year ago

lobre commented 1 year ago

The heart of this issue is about the title, but I would like to thoroughly explain why I think this is the case. To have the context, I will have to share a broader vision of what I think Lafayette should be to be a useful layout. I will define concepts and make assumptions that are my own, and I hope they will resonate. But I can be wrong and I am more than open to comments and arguments. I don't mean to impose anything apart from sharing what I think, and I was not part of the birth of Lafayette, so I don't necessarily know its true DNA.

Why Lafayette came to be?

Today, most French people type on azerty keyboards. The reason is simple: it is what is here out of the box for them. Azerty is recognized as "not good enough" (otherwise I would not be here talking about this, and Lafayette would not exist). To remind a few drawbacks of azerty, it does not allow proper typography, numbers are hardly reachable, and the dot character is not direct while extremely frequent in French, ...

So Lafayette first came as a response to those problems. It wants to generalize qwerty (which happens to have roots that make it "not that bad" for French) and slightly modify it to make it French-friendly.

Effectively, in a broader scope outside of France, qwerty is the most popular layout around the globe.

As of now, I don't know other keyboard layouts that have the same goals as Lafayette. So that is why its existence totally makes sense to me. It is a solution to a problem that has not been properly answered yet.

The story of French keyboard layouts is not extensive. There are not many options that were sufficiently supported to be "available". I put "available" in quotes because I think this is super important in the world of layouts. An "available" layout is a layout that became somewhat "standard" so efforts were made to integrate it as default on the main operating system.

Only 2 layouts come to my mind to type French (please tell me if there are others I forgot), and they correspond to my journey.

bépo

I have learned and typed in bépo for 7 years, and I know that @fabi1cazenave was implicated in its development. Bepo is in the category of "ergonomic keyboard". I don't want to deep dive into ergonomic keyboards because this is not the topic. But in a few words, bépo is not very friendly with English (because of the position of the 'w'). Also, it has actual letter keys that are too far outside of the 3x10 main panel, so it requires complicated extensions of the pinky. Numbers are also not reachable without shift.

And last argument, people don't necessarily want to learn an "ergonomic layout". It takes months to learn, default keyboard shortcuts become complicated to type and it might not always be worth the effort. It is usually said that to improve ergonomics, changing the physical keyboard to an ergonomic one gives quicker results than learning a new layout.

qwerty international

This year, I decided to stop my bépo journey and see what was existing out there. Qwerty international is to me the only "available" layout that makes sense for French.

It is close to qwerty (not exotic), easy to learn for azerty people, and it allows to type accents.

However, this layout was not made only for French, but for all languages that require extra characters. So it happens that some accents such as ` or ^ are possible but really uncomfortable to type. It makes the layout complicated to use when those are required.

But again, it is generally "available" and maybe makes it in my opinion "the best option out there to type French".

As there are not many competitors and because Lafayette with its dead key is really well-thought, it could easily overtake qwerty international and become the best option.

For that, one of the TODOS that can promote the layout would be to make it part of xkb at first, and maybe try to push it as a default Windows/Mac layout, but I don't know how hard this would be.

And before doing that, the layout should be "done", "v1", "stable" or whatever we want to call it. As it is hard to publish them, they should be by nature very rigid and not change a lot (or at all) over time. One good outcome of this rigidity is that they should not require a lot of maintenance. Another is that learning a new layout is hard. People don't want those layouts to change over time. They want to learn it and call it a day so that they have muscle memory well developed and can forget about it.

What is missing to make Lafayette "done"?

To be "done", lafayette should be good enough to tick a sufficient amount of predefined boxes. It should effectively answer the list of requirements to form a "good layout".

This section might seem more opinionated than the rest, but I will try to explain what I think is a good layout today. Those requirements were born from discussions I had with French people about layouts and keyboards. I will try to articulate them here.

Kinds of keyboards

There are different characteristics for a keyboard (speaking about keyboards here, not layouts). I will state two of them that I think are important in this discussion:

I will make the following assumptions that will help for the rest of the discussion:

Most ergonomic keyboards are programmable, and more generally speaking, keyboards become more and more programmable. This might come from the popularity of programmable firmwares such as qmk, zmk, and kaleidoscope...

Keyboards that are not programmable are usually "full-size".

The biggest portion of "full-size" non-programmable keyboards around here are the ones physically integrated into laptops.

People that have programmable keyboards usually want to program them (seems trivial but important).

How small a keyboard should be?

It seems the trend today for ergonomic keyboards is to be small enough, but not smaller. Effectively, one important aspect is for the fingers to move as little as possible. Usually, it is said they should not move farther than one key away. When we embrace this constraint, the keyboard requires layers so that a key can produce multiple characters according to which layer is activated.

If we go too small, we require additional layers and the mental overhead can be seen as counterproductive to the ergonomics. There is no fixed rule about what the perfect size would be, but it seems the sweet spot is having a panel of 3x10 keys in the middle for letters (so that all letters are typable without layers), and then having a few additional keys for modifiers, layer shifts or "input control keys" (a name I give for "space", "tab", "esc", "backspace", "delete", "enter"...). This number of additional keys depends on what people prefer. Same for the presence of a number row or not.

Now coming back to Lafayette, I think that a layout should be developed with a minimum size in mind. And I think the above sweet spot is what Lafayette should aim for.

Today, that is why I think that lafayette42 is superior to the classic Lafayette. It is directly compatible with this 3x10 panel because all letters (including accentuated characters) can be typed easily with a single dead key which belongs to the panel.

I personally decided to switch from qwerty international to lafayette42 for this reason. This dead key is the gold idea of Lafayette. It is what defines its existence and where the magic happens. It is way more comfortable than those multiple dead keys spread far away on qwerty international.

Also, when switching to a smaller programmable keyboard, one does not want to have to remap letters to be on different layers. The first layer should allow you to type regular English and French. I think we can all agree on this.

This reason is why I personally think that lafayette42 should become the real and unique Lafayette. Maintaining two different layouts is more complicated, and it splits the user base. If we want to have Lafayette "available" on operating systems, having only one layout instead of two would be simpler.

3x10 compatible and what it means for special characters

Let's focus on special characters now.

If we state that 30 keys are the minimum Lafayette should support out of the box, we can then examine how it should adapt to larger sizes, especially for special characters.

One strategy is the "mobile-first" approach.

The term mobile-first has been coined on the Ergol Discord, and it means that a layout should be first optimized for the smallest size that wants to be supported, and then progressively enhanced for larger keyboards. I was part of the conversations when defining this concept and it resonated a lot.

This is a nice concept and it led to having the current AltGr layer that exists in lafayette42 today (and in Ergol). It means all special characters exist first-class on the AltGr layer so they can be directly typed on smaller keyboards, and it makes special characters more accessible on larger/regular keyboards. Those larger keyboards also have duplicated special characters outside the 3x30 panel (where they are located on qwerty).

However, in practice, I think this is finally not a good approach and I will explain why.

It prevents the layout from being rigid

The location of special characters is a lot about personal preferences. We have seen that when designing the AltGr layer for Ergol. Ideas were not supported by strong arguments, but more about personal taste. Users have different profiles. Some are typists, some are programmers, and even in the programming world, there are a lot of different languages that lead to the use of some characters (and chains of characters).

I don't see how a "perfect" special character layer that would suit everybody could exist. It is just not possible.

As stated on the Lafayette and Ergol websites, the AltGr layer is meant to be adapted so that it suits your personal preferences.

La couche AltGr est dédiée aux symboles de programmation et cherche à en faciliter les enchaînements. Les développeurs sont invités à l’adapter librement à leurs besoins.

I think this is also the wrong approach for a keyboard layout. It goes against the idea of having a rigid layout that could be published and made "available" on operating systems. One would still need to recompile its customized version and install it manually.

It too restrictive for a programmable keyboard

The layer is effectively "compatible" with the 3x10 panel in theory. However, it is not true in practice. People who have programmable keyboards want to program them. On small keyboards, let's say 34 keys or 36 keys, there are not enough additional keys to support modifiers, layer shifts and "input control characters".

One of the possibilities is to use concepts such as home row mods, combos or tap dance, but it is also common to have a second layer that not only consists of special characters, but also has modifiers, layers shifts, "input control characters", numbers or navigation characters (see Callum, Seniply, or Ben Vallack video on its ferris for examples).

vallack_ferris_layer2

People want the flexibility to tune the programmable keyboard at will. And having a full 3x10 layer filled with special characters forces people to have a complete layer of special characters. This sounds more like a constraint than a gift to me.

They also have the possibility to drop the AltGr layer and rebuild their own layer of special characters which looks totally different from the one provided by Lafayette. And so it makes it a totally different experience when typing on a regular keyboard and when typing on their programmable keyboard.

Those are the reason why I think the AltGr layer is too opinionated and too busy.

A better approach

This goes against the mobile-first approach, but I think in the end that for special characters, the layout should be optimized for regular keyboards. People will have to remap anyway their special characters on programmable keyboards that are smaller.

However, there might be a way to satisfy both worlds.

I propose that the AltGr layer becomes a helper for difficult-to-type special characters on a full qwerty keyboard. The idea is that we don't need all possible special characters to be on the AltGr. Simply the ones that are too far from the 3x10 panel.

I have quickly put together a list of 8 characters that are too far from the central position:

I hesitated to add the backtick, the tilda, and the dash and underscore characters. They might not be that far and common, so keeping them at their position might be enough. The goal is to find the sweet spot to have as few characters as possible while adding the ones that are really difficult to type. For example, I don't put the simple and double quotes, because they are still rather simple to type, and keyboards such as the Planck or Preonic still have a key for that character.

This light AltGr layer also allows people wanting to program their special characters layer on their programmable keyboard to deliberately decide to take this AltGr as a starter. It just forces those 8 ones, and all other characters can be placed wherever they want, at their convenience. That's why it is better to have as few characters as possible on this AltGr layer. To reduce the friction and let people decide.

Now to continue and allow people to mimic this AltGr layer on their programmable keyboard, one goal should be to avoid strategic locations that are regularly used to place modifiers, layer shifts, "input control characters" or other special characters. I propose that we avoid the top row (the one starting with qwerty) because people usually place the characters that are normally on the number row. I would also avoid the two external columns, because they are harder to reach, and some people such as Ben Vallack put "input control characters" there. Those restrictions are a bit opinionated I have to assume. It should be discussed.

I would like to have feedback on all of this, but here is a first draft of what the AltGr could be. For what is it worth, the curly braces are positioned where they are on bépo, and the = and + are where they are today on the current AltGr layer of lafayette42. I preferred to put characters on the left hand because it is opposite to the AltGr key, and I tried to keep free spots such as [F] for more common characters when remapped on a programmable keyboard.

 ┌─┬─┬─┬─┬─┐ ┌─┬─┬─┬─┬─┐
 │ │ │ │ │ │ │ │ │ │ │ │
 ├─┼─┼─┼─┼─┤ ├─┼─┼─┼─┼─┤
 │ │[│]│ │=│ │+│ │ │ │ │
 ├─┼─┼─┼─┼─┤ ├─┼─┼─┼─┼─┤
 │ │{│}│|│ │ │\│ │ │ │ │
 └─┴─┴─┴─┴─┘ └─┴─┴─┴─┴─┘

To conclude, sometimes doing less ourselves means that other people can do more themselves. Lafayette should be comfortable out of the box on a regular keyboard, but should also be a "framework" layout that easily gives building blocks to people that want to program their keyboard with this layout in mind.

This is how I see it, and how I think it should become. Once "done" and free from opinions, this layout could turn into its rigid state and start its path to the world of "available" layouts.

Glad that you make it reading until here and hope that it was insightful.

lobre commented 1 year ago

While discussing this issue yesterday, I realized that something important is missing: "which population could use Lafayette, and how?" There are no proper stats for this and I can be wrong but I think a sensible distribution of users could be the following. This list pretends that a "raw" version of Lafayette (without the opinionated AltGr layer, as the one discussed in the issue) is available on their OS of choice.

1. Regular typists (french people using computers) who want a better alternative than azerty.

They would use their regular ISO keyboard with Lafayette simply enabled in the OS. They don't need to type a lot of combinations of symbols. Let's call them "normal users".

2. People who have a programmable keyboard, who use Lafayette as their base layout and who rarely use their ISO keyboard.

They can afford not to have an optimized AltGr when they temporarily type on their ISO. That way they can just enable Lafayette on the OS. They tweak their symbol layer on their programmable keyboard, and they have the freedom to put symbols wherever they want. Those symbols will just be at their qwerty location (except for the very few ones that we collectively decide to put on AltGr because they are too far out of reach) when using the ISO keyboard.

3. People who don't have a programmable keyboard and still want a really comfortable symbol layer

Those are programmers who need/want to have comfort when chaining special characters because it is more ergonomic, but who don't want to buy a programmable ergonomic keyboard. Two choices in my opinion:

Whatsoever, the Lafayette repo could still propose examples of well-thought AltGr layers so that people can directly use them or take them as starting points.

4. People who have a programmable keyboard with a custom symbol layer and who want to replicate this symbol layer when typing on their ISO keyboard.

Same as section 3, they could use the same tricks.

So my overall point is that I think 1 and 2 cover the most part of users in proportion to 3 and 4. I could imagine something like this in percentages:

I am describing here what could be the situation if Lafayette was available in OS (at least in xkb), but as of today, we do miss all those cases 1. And I think the project would benefit from being more popular.

Also, with the current AltGr symbols layer, people that are part of case 2 are not free to design their own symbol layer. If they decide to not replicate this layer, they have a discrepancy between their programmable and ISO keyboards.

To sum up, having a one size fits all symbol layer is impossible. So I would prefer not to have something opinionated baked into the layout, but maybe examples for guidance (or a way to make custom builds, but as a last option for the few people that really want to have their hands dirty).

And the second takeaway that I already mentioned: I think a layout should be rigid enough so that it can make it as a default option on the operating system. Custom build should be the exception, for people that are really deep into hacking things. But my bet is that qwerty Lafayette is not only for hackers but for every French who wants to comfortably type in French on a keyboard.

lobre commented 1 year ago

After having talked a lot with @Nuclear-Squid on Discord, we agreed on the following points:

Having said all of this, and having thought (a lot) about this issue the past few weeks, I would like to recenter the topic.

Those layouts (lafayette42/ergol) are system layouts. I still think they should be rigid enough so that they can make it to xkb for instance without having to change a lot in time. So the altgr layer should be defined once and for all, and we should not encourage people to adapt it to their needs (at least this option should be reserved only for advanced people that have really specific needs).

And I still think that we should instead encourage them to modify the symbol layer in their programmable keyboards (and if they don't have one, they should get one).

Then, instead of focusing on the layout to be fully compatible with compact keyboards (which is impossible because each one is uniquely designed and programmed), we should have sane concepts that adapt well to compact keyboards.

Typically, having all letters fit in the 3x10 panel is super important. But for altgr, I am not sure we should design it with compact keyboards in mind at all. People will have those symbols modified on their programmable keyboards to suit their needs. They can decide to follow what is on the ISO version to have a similar experience, or they can decide to have something totally different. We cannot control that.

Instead, we should focus on having an altgr layer which is optimized for ISO keyboards, and the design could be guided by those three principles:

  1. A symbol should not be too far away from the 3x10 panel.
  2. A symbol that is used a lot in the French/English language should be easily reached.
  3. Most used chaining of characters should be easy to type.

Apart from those goals, I would not add other symbols on that layer because it seems too opinionated and personal.

For 1, I propose that we only add symbols that are more than one key away from the central panel (that require a double extension). This means characters: =, +, ], }, \, |. Just for consistency, let's add to that list the opening curly brace { and square bracket [.

For 2, I think the parenthesis should be easy to type, and also the dash.

And for 3, I think the characters that chain the most are the angle brackets because they allow typing arrows, emojis or operators such as <= and >=. Other chaining such as bash shebang already works well at their regular location on the number row (#!). Same for the HTML closing tag </. That's why I think it makes sense to simply have the angle brackets on the altgr layer.

For example, having 0 and 1 on the altgr seems too opinionated to me. Those chaining such as [0] or += 1 are very specific to programmers, and even in the programming world, they are not that frequent compared to the number of other characters and chains typed in a program. To me, it does not justify a place on the altgr location, and it brings more confusion than help.

Just by following those rules, and keeping their current location on lafayette42, we can end up with this version, which seems lighter and less opinionated to me, while staying highly comfortable.

light_altgr

Most characters stay on the left side of the keyboard, which is comfortably used in combination with the right position of the altgr.

I have been running this version of the altgr layer for a few days now on my ISO keyboard, and I don't feel that I lack comfort when typing characters. It seems simpler to me (fewer duplications) and less opinionated. All characters on that layer are easily reachable and I don't have to bend my thumb or extend my right hand to go reach keys such as y to get ^.

I know we can still disagree, and I also realize that it is more of a philosophical discussion than a scientific one. One could argue that the current full altgr layer is as usable as this one (as the keys are in the same place). But having a "simple" and not a full layer makes it breathable, and more approachable to new users and even if I can choose not to replicate it on my customizable keyboard, I can take bits of inspiration from it without being presented with a full layer. This allows me to create a consistent experience with my ISO keyboard, while still having room for customization. Also, it is simple enough so that maybe it could suit most users and be a good fit for having it as the default version published in the OS.

While not advocating this solution, another option would also be to have two versions of the layout. One light one (just so that characters are sufficiently comfortable to type), and one that is considered as full-layer.