{# bokeh #} {% for f in bokehres.js_files -%} {%- endfor %} {% for f in bokehres.css_files -%} {%- endfor %}

Ergonomic Arabic Keyboard Layout

لؤلؤة

This is work in progress and contributions are welcome. Head over to GitHub to see where you can help.

Goals

  • Ergonomic typing of unvocalized and vocalized text with 10 fingers
  • Modern Standard Arabic and Quranic Arabic
  • Localized numbers (European/Arabic-Indic)
  • Usable as primary or secondary keyboard
  • Compose-based
  • Support for Markdown, RST, Wikitext and similar markup

Other languages using the Arabic alphabet (regional dialects, Urdu, Persian) are explicitly not supported.

Usage

Windows
Download driver and follow instructions in INSTALL.txt
Android
Install AnySoftKeyboard and Arabic for AnySoftKeyboard
Linux
Run: xmodmap ar-lulua.xmodmap

Learn more

الأبجدية العربية

The Arabic Alphabet

There are 28 letters in the Arabic alphabet, plus quite a few extra symbols required for proper text input, like the hamza in its different shapes أ إ آ ء ئ ؤ, ta marbutah ة, alif maqsurah ى and various diacritics for vowelized texts. Since the usability of a keyboard layout depends on the text entered it is necessary to study letter and letter combination frequencies first. The corpus used for the following analysis consists of

{% for c in corpus|sort(attribute='source.name') %} {% set count = c.get ('count') %} {% if count %} {# use new style formatting, for some reason %7,d does not work #} {% else %} {% endif %} {% set stats = c.get ('stats') %} {% for k in ('words', 'characters') %} {% set i = stats[k]|approx %} {% endfor %} {% endfor %} {% for k in ('words', 'characters') %} {% set i = corpustotal[k]|approx %} {% endfor %}
SourceWordsCharacters
{{ c.source.name }}{{ '{:7,d}'.format(count[0])|numspace }} {{ count[1] }}{{ '%5.1f'|format(i[0])|numspace }} {{ i[1] }}
Total{{ '%5.1f'|format(i[0])|numspace }} {{ i[1] }}

The plot below shows ا ل ي م و ن can be considered the most frequently used letters in the Arabic language. Together they account for more than 55% of all letters in the corpus.

Arabic letter frequency distribution

Layout properties

The following evaluation uses color coding to identify fingers:

red
little finger
blue
ring finger
magenta
middle finger
violet
index finger
cyan
thumb

Asymmetry is defined as the difference between left and right hand usage.

{% macro fingerhandstats(stats) %} {% set hands = stats.hands %} {% set fingers = stats.fingers %}
{% for hand in Direction %} {% set handpct = hands[hand]/stats.buttonPresses*100 %}
{{ '%.2f'|format(handpct) }}%
{% for finger in fingerOrder[hand] %} {% set fingerpct = fingers[(hand, finger)]/stats.buttonPresses*100 %} {# finger width is relative to parent (i.e. hand) #} {% set fingerwidth = fingers[(hand, finger)]/hands[hand]*100 %}
{{ '%.2f'|format(fingerpct) }}
{% endfor %}
{% if loop.first %}
Asymmetry: {{ '%.3f'|format(stats.asymmetry) }}
{% endif %} {% endfor %}
{% endmacro %}
{{ fingerhandstats(layoutstats['ar-lulua']) }}

Related work

{{ fingerhandstats(layoutstats['ar-asmo663']) }}

Trying to unify existing layouts, the Arab Standardization and Meterology Organization (ASMO), now part of AIDMO, published an Arabic keyboard layout in 1987 as standard 663. This, however, turned out to be a failure, due to lack of adoption by the typewriter industry.

{{ fingerhandstats(layoutstats['ar-osx']) }}

Mac OS X’s Arabic keyboard layout makes a few small changes to the layout by moving the ة to a hard to reach spot on the right of the top row. It also moves the short vowels from the first to the second layer and replaces them with punctuation. The bottom row keys are aditionally shifted to the right, beginning with ر.

{{ fingerhandstats(layoutstats['ar-linux']) }}

Instead we’re currently using this layout (on Linux), which is similar, but not quite the same. Most notably this layout arranges letters by their visual similarity. Thus it allocates suboptimal or even awkward positions to frequently used letters like ا ل and ذ.

{{ fingerhandstats(layoutstats['ar-malas']) }}

The work by Malas et al. (2008), Toward Optimal Arabic Keyboard Layout Using Genetic Algorithm, presents an alternative layout generated by a genetic algorithm. They used a snapshot of the Arabic Wikipedia probably from around 2008 and optimized for typing speed only, claiming 35% faster typing compared to the currently used layouts. However the decision to put ي in the top row seems odd. Assigning the same left index finger to ا ي و, which are three of the most frequent letters, heavily strains this particular finger.

{{ fingerhandstats(layoutstats['ar-osman']) }}

In 2015 patent 9,041,657 B2 was filed in the US, presenting yet another computer-generated layout. Its genetic algorithm was seeded with just 54 Arabic e-books consisting of 7 million characters in total. Overall it claims to be 9% faster than default layouts. This layout rips off most of the standard layout’s second layer, but amusingly fails to include a question mark, while it does provide three single-quote marks ’ and two Arabic semicolon ؛. Additionally it places ي in an even worse position than Malas’ layout.

{{ fingerhandstats(layoutstats['ar-khorshid']) }}

In the paper A new optimal Arabic keyboard layout using genetic algorithm Khorshid et al. present yet another layout. They claim a 36% improvement over the standard keyboard based on their criteria for ergonomic layouts. However in their layout from figure 8 the letters ل ب ر are in suboptimal positions. Also it seems their algorithm favors the bottom row instead of the easier to use top row.

{{ fingerhandstats(layoutstats['ar-phonetic']) }}

The Arabic Phonetic Keyboard simply maps the QWERTY layout to Arabic letters, based on their sound. Thus Q becomes ق, Y becomes ي and so on. It claims to be optimized for writing vowelized texts, especially Quranic Arabic, and thus includes quite a few combining characters and special symbols. Although it claims to make frequently used letters easily available – based on the work of Intellaren – it makes no effort to arrange letters according to their usage frequency.

While technically speaking not a layout but alternative input method, Intellark by Intellaren is worth mentioning. It is based on repeatedly pressing the same button to modifiy the current character. For example pressing A on the QWERTY keyboard cycles through the alternatives ا أ إ آ and ء. Obviously this is slow, error-prone and violates Dvorak’s guidelines for keyboard layout designs.

Acknowledgements

This work would not have been possible without Martin Krzywinski’s work on carpalx.