Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Background

   The current custom keyboard has plugin supports keys ( buttons ) by separating it through two commas custom keys by entering it keys through in the custom Keyboard inputbox,  The input box currently  has max character length of 51 characters ( 26 English Alphabets and 25 commas )input box each separated out through comma.


Image Removed
Expand
titleCurrent implementation Input samples
Click here see keyboard current implementation

Image Added


Problem Statement

Statement : 1

   In the custom keyboard expected to support 26 Characters Irrespective of the language . But almost all indic languages characters created through combing Base Character + Sound Character.
But We calculate the length limitation through javascript String.length Which does't fit with indian languages.

...

 As per requirement user should be allowed to enter maximum of 26 Linguistic Character. Splitting or counting a character linguistically is not straight forward in Javascript.

Image Added


Statement : 2

The keyboard does allocate a fixed width for each keys by calculating through

No Format
[ ( Number of Keys / 2 ) / 100 ] %

...

Expand
titleClick here see image ( problem statement 2)

Image Removed

Solutions

Solution for Problem Statement 1

Using grapheme splitter to Count the Number of charactersIn the current keyboard layout implementation all the key was fixed to same width. The disadvantage of the design is when applying fixed width for keys with too many characters, the key wraps inside the fixed width and the layout breaks.

Image Added

Key Design Issues

1. Splitting or counting a character linguistically.
2. Fixed width for all keys in keyboard layout


Solutions

Solution for Key design Issue -1 

Using grapheme-splitter Library to Count the number ( Reference Link for more https://runkit.com/shivashanmugam/5c3413183adcf800145d7b41 )


Code Block
languagejs
title

...

Solution 1

Telugu
"సింహం అడవి రాజు" character length 9
"పసిఫిక్ సముద్రం ప్రపంచంలోనే అతిపెద్ద సముద్రం" character length 27

Tamil
"சிங்கம் காட்டில் அரசன்"  character length 14
"பசிபிக் கடல் உலகிலேயே மிகப் பெரிய கடல் ஆகும்" character length 30

Hindi
"जंगल का राजा शेर है" character length 13


Limitations on the solution

On some cases does It does not work exactly as expected

...

color#c9e3f3
idCases Solution 1

Case 1: प्रशांत महासागर दुनिया का सबसे बड़ा महासागर है

Actual number of characters => 30

Grapheme splitter length => 31

Case 2 : க்ஷௌ 

Actual Number of character => 1

Grapheme splitter count it as => 2

Acknowledgement from Grapheme Splitter

Image RemovedGrapheme Splitter does't cover 100% the cases due to the requirement of language expertise and sheer number in a possibilities.

Code Block
languagejs
Case 1 
"प्र"
Expected value of character length 1
Actual value through grapheme splitter is 2

Case 2
க்ஷௌ
Expected value of character length 1
Actual value through grapheme splitter is 2

Solution for Problem Statement 2

...