Designing a Devanagari Keyboard on Mobile

2023 August 21


Background

Over a year ago, I started learning Hindi after becoming good friends with this group of Indian boys in college. I wanted to be able to hold a conversation in Hindi, as well as text/type in Hindi.

Hindi uses a different script, namely Devanagari. Although it's possible to write Hindi using the Latin/Roman alphabet (e.g. romanization) I didn't want this. I wanted to be able to type in the real deal which is Devanagari. This meant learning the Devanagari script as well as some new Devanagari keyboard layout on mobile.

I'm only interested in typing on mobile (not desktop, nor handwriting). It's 2023 - only relevant skills!

Learning About Devanagari

Devanagari a phonetic script, meaning:

By comparison, the Latin/Roman alphabet is not phonetic:

snoop tweet

The non-phonetic-ness of English has some interesting consequences:

We have spelling bee's. This is because in English, spelling is non-trivial. In phonetic languages like Hindi, spelling is trivial: you just sound out the word and that is also the spelling.

Q: Do you think they have spelling bee's in India?

A: Actually they do! (but in English)

You can spell English words different ways in Devanagari depending on the accent:


The spelling for certain Hindi words can change as their pronunciation evolves:

word formal spelling colloquial spelling
why क्यों (kyo) क्युं (cue/queue)
he/she/it वह (vaha) वो (voh)
very बहुत (bahut) बहौत (bahaut)
no नहीं (nahii) ने (nay)

Rhyming words have equal suffixes when spelled in Devanagari (not always in English):

word pronunciation in Devanagari
boar बोर
core कोर
door डोर
four फोर
nor नोर
you're योर

Every English word can be spelled in the Devanagari script by just sounding it out.


List of weird mistakes I make:

word, correctly spelled my weird mistake explanation
शब्द (sh-ah-bd) typed it like शुब्द (sh-uu-bd) शब्द is stored like 'shubd' in my head, so my brain sees 'shu' and thinks it is pronounced like 'shoe'
bull (बल) typed it like बुल (b-uu-ll) My brain sees the 'u' in 'bull' and wants to spell it like बुल (b-uu-ll). But bull is pronounced like 'b-ah-ll' (बल)
pong (पौंग) typed it like पोंग My brain sees the 'o' in pong and thinks it's spelled with the ' ो' symbol representing the 'o' sound. When actually pong is pronounced 'p-aw-ng' (पौंग)
Americans (अमेरिकन्ज़) typed it like अमेरिकन्स s=स in Devanagari, so my brain thinks 'Americans' is spelled like अमेरिकन्स. When actually it's pronounced like 'American-z' and z=ज़, so the correct Devanagari spelling is अमेरिकन्ज़
आसमान (aas-maan) pronounced it like आज़मान My brain sees the 'sm' in आसमान and thinks it's pronounced like the 'sm' in
  • cosmetic
  • journalism
  • plasma
e.g. like zm=ज़म
अन्य (ah-nyah) pronounced it like ऐनी (an-ee) My brain sees the Romanization of अन्य='any', and wants to pronounce it like that, e.g. like 'an-ee'.
सिर्फ (s-ee-rf) pronounced it like सर्फ (sirf) In my head, सिर्फ is stored like 'sirf', and my brain sees 'sir' and pronounces it like that (e.g. like सर)
कहावत (kuh-haa-vat) pronounced like कहावित (kuh-haa-vit) My brain sees the 'va' in the pronounciation 'kuh-haa-vat' and thinks it's pronounced like the 'va' in avatar, e.g. like 'vi'=वि
लिपि (li-pi) pronounced like लिपी (li-pee) My brain thinks the 'pi' in the pronounciation 'li-pi' is pronounced like the 'pi' in words like:
  • camping
  • playing
विशेष (vi-shay-sh) typed it like वेशेष (vay-shay-sh) This one is the hardest to explain. My brain starts to sound out the word like 'vi..' and remembers words like:
  • canvas (can-vi-s)
  • conservative (cuhn-ser-vi-tiv)
  • equivalent (ee-kwi-vi-luhnt)
Then my brain further forgets that in these words, 'va' is pronounced somewhere in between 'vah', 'vih'; and instead thinks it's pronounced 'vay'=वे.

Conclusion: my brain stores words/sounds in some disorganized way because of English's non-phonetic-ness. It would be so awesome to have a phonetic language as your mother tongue because then your brain would be much better organized.


It's possible to be able to read/pronounce Devanagari out loud without understanding the meaning (by just sounding out the script).


The Actual Layout

behold! (Tap or swipe to the corner to type that character)

Devanagari layout Devanagari layout fn layer

Consonants Row

In Devanagari, the consonants are grouped by tongue/lip movements:

Devanagari consonants
source

For example, the "Labial" group's characters are all lip-movements:

consonants original

Let's have a key for each consonant group.

Further organization:

consonants grouped by aspiration consonants grouped by sound

Here, each circled pair of consonants has the same tongue/lip movement.

Vowels Row

In Devanagari, the vowels are grouped by sound:

Devanagari vowels source

For example, the "Rounded high back" group's characters are all "u"-sounds.

Q: What is "diphthong"?

A: When you change your underwear

vowels original

Let's have a key for each vowel group. The vowel row also somewhat follows the "standard" vowel order:

अ आ इ ई उ ऊ ऋ ए ऐ ओ औ

It's analogous to the "standard" vowel order in English: AEIOU. Note neither of the "standard" vowel orders follows pitch order (sad).

Further organization:

vowels grouped by diacritic vowels grouped by sound

Here, each circled pair of vowels has the same sound.

Alternative Layouts

Before creating my layout, I asked my Indian bros which layouts they used. They pretty much had 2 answers:

1. GBoard's Hindi layout

Gboard Hindi layout

2. SwiftKey's Hindi layout

Swiftkey Hindi layout.png

In hindsight, these are both great options. They both have similar organization. Both these keyboards have auto-complete, whereas Unexpected Keyboard (the app which I added my layout to) doesn't have auto-complete.

If you already know Devanagari and simply want to type fast, auto-complete might be the move.


I briefly considered the Inscript layout, the official Devanagari layout for desktop.

Inscript layout

(Google Play Store) If you already know this layout from typing on desktop, this might be the move.

Is My Layout Better? (opinionated)

short answer Probably not; It is better for me specifically

As mentioned above, Unexpected Keyboard doesn't have autocomplete/autocorrect. Also, Unexpected Keyboard uses swipe to type characters, whereas for GBoard and Swiftkey you can swipe to type entire words.

To most people, these features are a pro of GBoard/Swiftkey. To me, someone learning Devanagari, I like how my layout forces me to type out words in full from memory. This forces me to learn the spelling (which is also the pronunciation) without the crutch of these features.

In particular, this helped me learn the conjunct consonants. For example for the conjunct consonant त्य:


I like how my layout has large keys, thus I almost never mis-type.