dumblob / ULKL

Uniform Latin Keyboard Layouts - intuitive, nationalized, multiplatform, powerful, and basically 100% mutually compatible (also with Dvorak)
The Unlicense
9 stars 0 forks source link
bsd dvorak intuitive keyboard-layout latin linux macosx multiplatform national windows

ULKL - Uniform Latin Keyboard Layouts

Ever experienced any of the following issues?

ULKLs mitigate these issues by introducing an all-encompassing, fully intuitive way of having a separate keyboard layout for each latin-based alphabet, while targetting 100% mutual compatibility between them (achieved through high uniformity).

The layout design idea is thus:

Put the nationalized characters at places, where your finger muscle memory expects them to be without pressing any modifiers.

(modifiers are in general keys like Shift Ctrl Alt etc.)

It means that typing č will use the same finger as typing c. The same holds for Č and C - even here, only one modifier is needed for both cases - the Shift. This allows one to very quickly switch between layouts without the need to learn anything. Exceptions to this rule, where finger overloading would happen, still guarantee a position of the symbol logical enough to be learned in a second. The following graphics explains it on the czed (ltgt variant) layout.

// ----------- czech dvorak ltgt, 1. and 2. level
//  Ú   É   Á   Ó   Ě   Ů   Ý   Ď   Í   Č   Ř   Š   Ž
//  ú   é   á   ó   ě   ů   ý   ď   í   č   ř   š   ž
//
//          "   <   >   P   Y   F   G   C   R   L   ?   Ť   Ň
//          '   ,   .   p   y   f   g   c   r   l   /   ť   ň
//
//          A   O   E   U   I   D   H   T   N   S   _   LF
//          a   o   e   u   i   d   h   t   n   s   -   LF
//
//          :   Q   J   K   X   B   M   W   V   Z
//          ;   q   j   k   x   b   m   w   v   z

(FIXME add shiny pictures (animated gifs?) depicting among other things differences between czed and engd to demonstrate compatibility and the easy-to-learn property)

Please note, the goal is not to have one ultimate keyboard layout (disregarding if by combining keys or by switching to ultra-high levels or both). That would lead by definition to awkward writing of many symbols, numeric expressions, digraphs, trigraphs, math, etc. Instead, we encourage to switch between multiple layouts as you are used to with the bonus of having all of them muscle-memory-compatible.

Features

1it's recommended to press first the shift under the hand which in the end is going to press the desired key

2in x11 there is a bug and the first pressed shift (not either of the two shifts) must be released to press the desired key

FIXME add FSM depicting the work with Shifts (mainly the third level) and later with other modifiers (probably just the compose key)

Available layouts and platforms

Supported platforms include X11 (Linux, BSD, etc.), console (Linux, BSD), Mac OS, and Windows. Layouts are to be found in corresponding directories: platform/x11 platform/console platform/osx platform/win.

The naming convention of layouts follows the ISO 639-2 language naming standard and adds the suffix d as an abbreviation for Dvorak (as the layouts are based on the Dvorak simplified keyboard layout).

Dvorak layout surprisingly performs only very few percent worse than optimal layouts for each latin-based language, but provides by far the best overall score among latin languages while maintaining a relaxed feeling while typing (compared to other layouts). Also considering the rapidly growing amount of human input in English (compared to other languages), Dvorak as a layout originally primarily focused on English is a sustainable solution for decades. This makes ULKL a perfect fit for teaching touch typing at schools.

Example layout names:

Each layout has 2 variants - ltgt and writer. The writer variant is allowed to provide up to 4 language-specific punctuation characters (e.g. „“), which might be useful especially to writers at the expense of slightly less accessible < and > characters. The ltgt variant on the other hand does provide < and > characters well accessible just like Dvorak does. ltgt is the default variant.

Installation and usage

Windows

  1. Download binary from the platform/win/ directory of this repository.
  2. Double-click the downloaded file and follow instructions (if any).
  3. Log out and log in to let the changes take effect.

X11

Mac OS

  1. Move the keyboard layout to /Library/Keyboard Layouts/. Keyboard layouts in ~/Library/Keyboard Layouts/ cannot be selected in password dialogs or in the login screen.
  2. Restart to apply the changes. Logging out and back in is not enough.
  3. Enable the new keyboard layout from System Preferences.

To apply changes to a keyboard layout later, run sudo touch '/Library/Keyboard Layouts' and restart.

Contributions

Please contribute! In whatever form (suggestions, bugs, new layouts, etc.).

Creation and submission of new layouts

  1. Choose platform you wish to create the layout for (Linux is the simpliest).
  2. Copy & paste existing definition file (e.g. https://github.com/dumblob/ULKL/blob/master/platform/x11/symbols/czed or https://github.com/dumblob/ULKL/blob/master/platform/win/source-20220624-gerdLTGT/gerdLTGT.klc ) - use ISO 639-2/B 3-character identification of your language (if there are multiple, just choose one you like - other will be symlinks or plain copies if they use identical alphabet) plus d character as suffix (to resemble dvorak) as both file name and layout name (used inside of the definition file).
  3. Change keyboard "visualizations" at the top of the definition file to suite your language so that each possible character of the full alphabet (i.e. containing all possible tuples of a letter and corresponding diacritical mark(s)). Overloading (i.e. use an empty space for "overloaded" column - see e.g. ťŤňŇ in https://github.com/dumblob/ULKL/blob/2265077c2befa47a5de644df25dbf73ae373ea45/platform/x11/symbols/czed#L49-L53 ) shall maintain relative spatial positioning if possible (with the exception of competitors having significantly different usage frequency in which case the highest priority for the most frequently used letter with diacritics has the empty space closest to the index finger) and must maintain the half of the keyboard to be written with the same hand (see e.g. úÚéÉ in https://github.com/dumblob/ULKL/blob/2265077c2befa47a5de644df25dbf73ae373ea45/platform/x11/symbols/czed#L46-L53 ).
  4. Change labels/names of characters in the definition file to match keyboard visualizations from (3). Do not forget to meticulously fill in VoidSymbol on X11 (-1 on Windows meaning \<none>; &#x0010; on macOS/Apple FIXME is this correct?) for 3rd (and 4th) level for letters which do not have any diacritical mark (and at the same time do not need to be "overloaded").
  5. Repeat 1-4 for other platforms if you can :wink:.
  6. Test your results (see Installation and usage in this readme).
  7. Make a PR (pull request) in this repo. Feel free to submit even unfinished work!

By issuing a pull request to this repo, you agree to the licencing conditions of this repository.

TODO

Additional information

How to overwrite CapsLock by Escape

In X11 either with xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' or by putting

remove Lock = Caps_Lock
keysym Caps_Lock = Escape

to "$HOME/.xmodmaprc".

In console e.g. by running echo 'keycode 58 = Escape Escape Escape Escape' | loadkeys -.

List of all available symbols in X11

Dash, en dash, minus, hyphen, soft hyphen, non-breaking hyphen, ...

Characters minus and en dash were chosen to be present instead of others based on the following information.

Motivation and reasoning for decisions made in ULKL

Switching layouts requires one to learn wildly differing layouts for each existing alphabe. Not switching layouts means most of special or national characters are nearly inaccessible due to too high number of levels one needs to switch to. As a consequence one would need to learn a specific layout for one language. A solution of this is simply use separate layouts, but maintain full compatibility for the basic characters (i.e. for the whole latin alphabet and numbers) while appropriately changing the rest according to a beforehand defined trivial pattern.

(the following text is in Czech because of its origin; it'll get translated to English once someone requests it)

Otazkou je, jake layouty tedy vytvorit? Dospel jsem k nazoru, ze je nejvhodnejsi cilit na dve zakladni skupiny uzivatelu klavesnic.

1) sekretarky, spisovatele, lide pisici casto ceske texty, bezni lide (napr. uzivatele socialnich siti)

2) IT uzivatel (programator, admin apod.)

Prvni skupina vyzaduje caste psani ceskych znaku (at uz malych ci velkych), interpunkcnich znamenek, cislic a nekterych specifickych znaku jako napr. paragraf, stupen, euro, dolar apod. Prave pro tuto skupinu jsem vytvoril nove rozvrzeni vychazejici z DVORAK. Efektivita psani cesky na DVORAK je mnohem vyssi nez na QWERTZ (viz. prilozene materialy a mereni spolu s daty z Ceskeho jazykoveho korpusu) a nikoliv jak je napr. uvadeno na webu http://www.uklavesnice.estranky.cz/clanky/klavesnice.html .

Druha skupina je jiz z principu schopna si sama prehodit layout, naucit se neco noveho na pocitaci apod. Tam neni potreba nic menit a vymyslet. Bud si sami vytvori vlastni layout a nebo budou pouzivat ISO dvorak, z nehoz vychazi prave tyto nove narodnostne-specificke varianty Dvorak.

Podle meho nazoru je zbytecne zabyvat se prohazovanim Y/Z (jak se tim zabyva napr. web http://www.ceskaklavesnice.cz/historie), prestoze tato malickost cloveka muze mirne otravovat. Avsak jedna se o tak nepatrny detail, ktery je kazdy kdo pise vsemi deseti schopen (docasne) udrzet v hlave. Pripadne si prepne na druhou variantu (kazdy bezne dostupny OS jiz mnoho let umi bezproblemove prepinat mezi rozlozenimi).

Pri navrhu czd byla rovnou udelana reserse abeced pouzivajicich latinsky zaklad a bylo zjisteno, ze slovenska abeceda obsahuje nejvice pismen a ceska je hned druha v poradi. Spolu s tim byla navrzena jednoducha metoda jak vytvaret narodni klavesnicova rozlozeni pro jazyky pouzivajici jako zaklad latinku. A\ protoze se podarilo uspesne vytvorit slovenskou a ceskou variantu dvorak, koncept zarucuje, ze danou metodou lze v pripade ostatnich latinskych abeced dosahnout nemene kvalitnich vysledku.

References

French AZERTY layout is totally unusable in practice

French BÉPO - Dvorak-based layout

Swedish Dvorak layout

Ivan Pascal - xkb internals

Creating custom keyboard layouts for X11 using XKB

X upstream: xkeyboard-config-2.10.1/rules/compat/layoutsMapping.lst

huge XCompose configuration

Ukelele key layout instructions for Mac OS

Ukrainian example of an Ukelele layout for Mac OS

Apple documentation about Mac OS layouts

MessagEase mobile keyboard

Czech National Corpus (maintained by FFUK)

UCWCS X11 layout

English Letter Frequency Counts: Mayzner Revisited or ETAOIN SRHLDCU