How to code a custom input/keyboard for Chrome OS ?

1,685 views
Skip to first unread message

Murtaza Kanorwala

unread,
Oct 21, 2021, 11:31:30 AM10/21/21
to Chromium OS Development
I want develop a custom language input/keyboard for Chrome OS which I read somewhere is still not yet supported by Chrome OS for some reason.

It is actually a type of Arabic (101) language which can be Saudi or Egypt and has it's own custom fonts.

I read that Chrome extensions can help in achieving that, but I don't know where to start. I tried to read the source code for one of the few custom input extensions available there and it was just a .json which was just providing information about the input and not the logic - it didn't made any sense to me. Also somewhere I found a site where the author had described the coding/logic for how to swap/modify key inputs, but not where and how to compile the code.

So I would appreciate any input or guidance or even docs to refer to because this topic seems very rare.

dragon788

unread,
Oct 21, 2021, 1:43:38 PM10/21/21
to Murtaza Kanorwala, Chromium OS Development
I'm guessing you are referring to this repository for the extra keyboard layouts?


--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-dev
---
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-d...@chromium.org.

Murtaza Kanorwala

unread,
Oct 22, 2021, 12:33:45 AM10/22/21
to Chromium OS Development, drag...@gmail.com, Chromium OS Development, Murtaza Kanorwala
Ah yes, that is the one.

Sorry this was something I did few weeks ago, and I really didn't bother saving the links or creating a post to ask somewhere until yesterday.

https://dgopstein.github.io/articles/chrome-keymapper/  -> this is the link which I was referring to that showed the coding logic.

dragon788

unread,
Oct 22, 2021, 6:59:12 AM10/22/21
to Murtaza Kanorwala, Chromium OS Development
Check out the examples for adding a new layout in this pull request. If there is a close xkb layout you can reference it, otherwise you are doing remapping which requires the background.js to detect a key being pressed and output a different key.

Murtaza Kanorwala

unread,
Oct 22, 2021, 9:51:35 AM10/22/21
to Chromium OS Development, drag...@gmail.com, Chromium OS Development, Murtaza Kanorwala
Wow, I can't believe that was hidden in one of the pull request details. Thanks, that cleared my doubts about how to add a custom keyboard/layout!

Upon researching I found that Arabic is totally supported for the Chromebook which I'm working on. So the problem that is left now is that the custom font type (.ttf) which I want to install is not supported by the Chrome Browser more specifically Google Docs.

Sorry, this was something I tried to do weeks or maybe months ago? which is why my thoughts were not organized when I created this thread, but I remember now that custom fonts cannot work for Google Docs; but I can make them work in Linux Apps. But guess what, Arabic keyboard/layout is not supported in Linux Apps (yet?).

So this is why I wanted to create an extension for Chrome Browser which will help me do that. So I can:

1. Create a totally new keyboard layout from the existing Arabic one by replacing all the fonts

or

2. I came across an extension called Extensis that allows Google Docs to access vast number of Google Fonts which means I need to submit the custom font file to get accepted by Google Fonts.

If you have a better suggestion, I would like to know, but I think these are the 2 options that I have now.

dragon788

unread,
Oct 22, 2021, 2:50:49 PM10/22/21
to Murtaza Kanorwala, Chromium OS Development

Murtaza Kanorwala

unread,
Oct 23, 2021, 12:42:58 AM10/23/21
to Chromium OS Development, drag...@gmail.com, Chromium OS Development, Murtaza Kanorwala
Thanks for the links, they were quite informative. But, alas the workaround isn't working.

I installed fcitx and ibus, configured it according to the posts in the links (as well as read the reddit thread) and added the Arabic language as one of the input language in the fcitx-configtool. I'm able to switch keyboard layout in Linux apps using the hotkeys but when I press any key it still inputs English instead of Arabic.

Murtaza Kanorwala

unread,
Oct 23, 2021, 12:57:31 AM10/23/21
to Chromium OS Development, Murtaza Kanorwala, drag...@gmail.com, Chromium OS Development
Sorry, I tried to change the default language when no input in fcitx-configtool to Arabic and moved the default language Arabic above English, also I installed fcitx-table-all and task-arabic using apt and bingo, I can type in Arabic now in Linux Apps, as well as the custom font works!

Thanks for all the support man, my problem is solved!

Cheers!

Aliasgar Badri

unread,
Nov 22, 2022, 2:03:32 AM11/22/22
to ChromiumOS Development, kanorwala...@gmail.com
Salam Mr Kanorwala
I m also looking for the same solution i was hoping you can help me with it  
Reply all
Reply to author
Forward
0 new messages