Let's face it, if you are here reading this, odds are you also spend a significant amount of your time in front of a computer pressing buttons on a keyboard. The keyboard mostly serves well unless yօu աre լike më and need to often switch between several keyboard layouts.

This is particularly relevant for people whose primary language does not use latin alphabet (uses Cyrillic,Armenian, Arabic, etc. ) as one often forgets to switch keyboard layout when going from one environment to the other. This is annoying and decreases պռոդւցտիproductivity

Alt text

What we bu!lt

Our product is a tiny program that sits right on top of the keyboard interface thereby allowing a universal layout switcher whether you are editing code in a code editor or texting in social media.

Alt text

How I built it

Alt text

Used the Logitech keyboard API to spy to keyboard events and ran buffering and dictionary search algorithms to infer the language my user is typing in thereby inferring the keyboard layout necessary. I obtained necessary dictionaries and word frequencies by dumping all of Wikipedia and running Map-Reduce word count on it.

Challenges I ran into

In a production setting something like this would be built into the keyboard or the corresponding driver thereby simplifying the security model and possible leaks. However, to build this on a public SDK, I often had to bypass keyboard spying limitations and sometimes completely change my approach into something waay way less effective.

Accomplishments that I'm proud of

I can use my keyboard in a universal layout for Armenian Russian and English (adding more languages is very trivial)

Alt text

What I learned

  • Naming is important! Things go wrong when error code and virtual key code for a key are represented by the same character
  • Swiss hackathons start on Swiss time (but on the positive side, interesting surprises may be awaiting you when you are late)

What's next for JUSType

  • Instead of naive word by word prediction, build an inference model that takes neighbouring words into account
  • Incorporate a Bayesian or Markov model in order to efficiently handle typos
  • Package the project as a native binary to simplify the security model and enable system configuration changes on the fly
Share this project: