A phonetic input method for Indic scripts.
- 99.9999% of all computer keyboards and laptops sold in India have the US layout. That number is an underestimation.
- Devanagari and other keyboard layouts are available in GNU/Linux but mastering such a keyboard is beyond the capability of most users.
- To write in Devanagari, or Bengali for that matter, users prefer to type phonetically.
- Avro keyboard does exist, but it requires iBus under GNU/Linux.
- iBus sucks. It was not designed for Indic scripts. And SCIM. And fcitx.
Indic keymappper is alpha software. It can blow up your computer, freeze your keyboard or mouse or even change the keyboard layout to Indic. You have been warned.
Indic is a Python script to the key codes generated by the Linux kernel using python-evdev and maps a phonetic key sequence to the symbols defined
/usr/share/X11/xkb/symbols/in
. The X11 keyboard is loaded using the setxkbmap in
command from within Python. The phonetic key sequences are defined in the files d.map
(Devanagari) and b.map
(Bengali). The kernel keycodes are in keycode.map
and any additional key codes could be defined in there.
The program works system-wide -- that is, it will map keystrokes for all X11 applications. Obviously, X11 applications need to support complex glyph rendering required for Indic fonts.
Indic keymapper works in GNU/Linux with X11. Wayland may or may not be supported (please let me know if you try it).
Indic doesn't use the mouse or touchpad devices. However, it needs to register mouse and touchpad clicks to adjust its state machines so that partial phonetic matches don't carry over when a different window is clicked (comes into focus).
Some keystrokes register more than once. Happens occasionally.- After exiting the program, one Return/Enter key doesn't get registered.
tkinter
- On Ubuntu or Debian, this can be installed from the packagepython3-tk.deb
evdev(https://github.com/gvalkov/python-evdev)
- sudo pip3 install evdevsubprocess
,threading
,select
- should be available in a standard 3.1x CPython installationselect
- sudo pip3 install evdev
The command below will add the current user to the input
group, this is needed only one time -- to let you access evdev:
$ sudo usermod -a -G input <your_username>
You might need to reboot your computer at this point.
Then run the Python source:
$ cd /git/clone/path/indic/
$ python3 ./indic.py
A widget to switch between Indic and US keyboard pops up. Bengali keymap is currently not available (under development). Press Shift+Escape to close the Indic keymapper.
Bengali needs sepcial handling of reph and khaNDa ta.
- Replace calls to system xmodmap using Python X11 bindings.