Where best to create/submit new keyboard layout

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
Post Reply
akerbeltz
Level 1
Level 1
Posts: 8
Joined: Thu Mar 08, 2018 1:46 pm

Where best to create/submit new keyboard layout

Post by akerbeltz » Thu Mar 08, 2018 2:02 pm

Hi
I'm helping a literacy project in Namibia get some additional tools to make their life easier. We've created a prototype Hunspell spell checker (fortunately they are on Linux Mint & LibreOffice) but we've got a bit of a headache.

Ju|'hoan (ktz) uses four special characters: ǀ ǁ ǃ ǂ (U+01C0 U+01C1 U+01C3 and U+01C2). But since these are on no physical keyboard or even just layout, they tend to use en-GB or en-US as a layout and use / (U+007C) or the pipe character | , double // or ||, the exclamation mark ! (U+0021) and = in place of ǀ ǁ ǃ ǂ and then do a global replace once they're done with the document. This is far from ideal, not only does one end up with the wrong code point for ! and | (whether punctuation or the character is intended) but worst of all, Hunspell in LO treats the pipe character, exclamation mark etc as stop characters, which means that spell checking ends up being a greater mess than help.

We'll be looking into filing a bug with LO but a similar bug is already up there and has been for many years with no action, so that may take a long time. So in the meantime, our thinking was to create a keyboard layout for Ju|'hoan with some combining keystrokes (like AltGr + = > ǂ) so users can enter the correct characters directly, without needing to resort to workarounds and sidestepping the Hunspell in LO problem (with the correct characters for ǀ ǁ ǃ ǂ, there is no problem with the spellchecker.

So our question is, where is the best place for such a bug? LinuxMint or should be be filing with some upstream project? Also, will this require creating a ktz locale at the same time or can a keyboard layout be added independently?

Thanks!

User avatar
Spearmint2
Level 15
Level 15
Posts: 5719
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: Where best to create/submit new keyboard layout

Post by Spearmint2 » Thu Mar 08, 2018 3:40 pm

The dconf-editor program if installed will allow change of keyboard layout, if there's one available for that language. Perhaps a change in font package is needful too.

https://wiki.debian.org/Keyboard

Mint already has a Keyboard Configuration program in it where country specific layouts can be set also. Check there first.
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....

akerbeltz
Level 1
Level 1
Posts: 8
Joined: Thu Mar 08, 2018 1:46 pm

Re: Where best to create/submit new keyboard layout

Post by akerbeltz » Fri Mar 09, 2018 6:26 am

There is nothing available for Ju|'hoan at this stage on any platform, so we have to create one somehow.

magnus7
Level 3
Level 3
Posts: 123
Joined: Sat Jan 30, 2016 8:46 pm

Re: Where best to create/submit new keyboard layout

Post by magnus7 » Fri Mar 09, 2018 10:43 am

These characters can be inserted into any keyboard layout.
What's your desktop and Linux Mint version?
Which keyboard layout do you want to modify?
Which characters do you want to replace and with what? Keys like Scroll Lock, Home, Insert, etc. can also be adopted for typing new characters if you don't use them.

akerbeltz
Level 1
Level 1
Posts: 8
Joined: Thu Mar 08, 2018 1:46 pm

Re: Where best to create/submit new keyboard layout

Post by akerbeltz » Sat Mar 10, 2018 8:46 am

Well, it's good to hear that it's going to be easy 8)

We'd be looking to modify en-GB (which is the current locale they're on, also the hardware keyboards). I'll have to get someone to check Mint Version but I suspect recent. The only thing is that we'd like to do it in a way that makes this accessible to other users too in future, hence the question about where one would commit such a new layout to make sure it gets to others too.

The ideal scenario would be to use the AltGr key i.e.
AltrGr + | » ǀ
AltrGr + / » ǁ
AltGr + ! » ǃ
AltGr + = » ǂ

This way we'd not impact any other keyboard functions and we'd re-use the existing workaround characters as much as possible to make it intuitive.

magnus7
Level 3
Level 3
Posts: 123
Joined: Sat Jan 30, 2016 8:46 pm

Re: Where best to create/submit new keyboard layout

Post by magnus7 » Sat Mar 10, 2018 12:57 pm

Run this command in terminal and restart the computer:

Code: Select all

sudo sed -i \
-e '18s|.*|key<AB10>{[slash,question,U01C1,dead_abovedot]};|' \
-e '20s|.*|key<TLDE>{[grave,notsign,U01C0,bar]};|' \
-e '21s|.*|key<AE01>{[1,exclam,U01C3,exclamdown]};|' \
-e '23s|.*|key<LSGT>{[backslash,bar,U01C0,brokenbar]};|' \
-e '24s|.*|key<AE12>{[equal,plus,U01C2,dead_ogonek]};|' \
/usr/share/X11/xkb/symbols/gb && sudo dpkg-reconfigure xkb-data
This command is valid for English(UK) keyboard layout in any version of Linux Mint.

akerbeltz
Level 1
Level 1
Posts: 8
Joined: Thu Mar 08, 2018 1:46 pm

Re: Where best to create/submit new keyboard layout

Post by akerbeltz » Tue Mar 13, 2018 6:11 am

Before I try this, how would I reset this to just the standard en-GB layout? Or does it reset automatically and you have to run this command every time you start the machine?

magnus7
Level 3
Level 3
Posts: 123
Joined: Sat Jan 30, 2016 8:46 pm

Re: Where best to create/submit new keyboard layout

Post by magnus7 » Tue Mar 13, 2018 9:31 am

Locale is separate from keyboard layout and doesn’t matter in our case.
There isn't keyboard layout called "en-GB", basic GB layout is called "English(UK)".
Go to Keyboard > Layouts and change your layout to English(UK) if it's different.
The command I gave you will remap only English(UK) keyboard layout. You don't need to run it every time you start the machine, the change is persistent but can be reversed.

akerbeltz
Level 1
Level 1
Posts: 8
Joined: Thu Mar 08, 2018 1:46 pm

Re: Where best to create/submit new keyboard layout

Post by akerbeltz » Fri Mar 16, 2018 7:21 am

Yes, sorry, I know there's no en-GB keyboard, I was just messing with ISO codes all day - and they with my brain!

Ok so I basically re-set this to a "standard" keyboard by selecting it in the settings? Sounds easy enough. I'll give you code a bash when I get my hands on a Mint machine (I'm on Ubuntu at my office, long story).

akerbeltz
Level 1
Level 1
Posts: 8
Joined: Thu Mar 08, 2018 1:46 pm

Re: Where best to create/submit new keyboard layout

Post by akerbeltz » Fri Mar 16, 2018 7:27 am

Hang on ... I was just wondering why there are 5 lines

Code: Select all

-e '20s|.*|key<TLDE>{[grave,notsign,U01C0,bar]};|' \
Does the above re-set the grave key (the one left of the 1 key)? The | key we had in mind was the |\ key that sits left of the z key on the UK English keyboard.

magnus7
Level 3
Level 3
Posts: 123
Joined: Sat Jan 30, 2016 8:46 pm

Re: Where best to create/submit new keyboard layout

Post by magnus7 » Fri Mar 16, 2018 10:51 am

When you run this command in terminal and restart the computer, only English(UK) layout will be remapped, even if you use different layout in that moment. So to use new characters you have to switch to English(UK).
The | key (that sits left of the Z key) will be remapped as you wanted but because that key sometimes is missing on some keyboards, I additionally remapped the grave key (the one left of the 1 key, which also is sometimes missing by the way). If you don't want that additional key remapped just remove the line you quoted from the command.

akerbeltz
Level 1
Level 1
Posts: 8
Joined: Thu Mar 08, 2018 1:46 pm

Re: Where best to create/submit new keyboard layout

Post by akerbeltz » Mon Mar 19, 2018 3:24 pm

Just tried this on my Ubuntu machine, I figured what the heck - and it works great! I had to switch keyboards cause it turns out I was on UK Extended Winkeys but once I added English (UK), boom, there they were!

For now, this will do very nicely for the project. Maybe one day when there are more tech users, we'll look into doing a locale and some localization but for now, this is great so thank you very very much!

akerbeltz
Level 1
Level 1
Posts: 8
Joined: Thu Mar 08, 2018 1:46 pm

Re: Where best to create/submit new keyboard layout

Post by akerbeltz » Wed Mar 21, 2018 3:30 pm

One last question, is there a reliable list somewhere of these key names, should I need to modify these for some other keys/characters one day?

magnus7
Level 3
Level 3
Posts: 123
Joined: Sat Jan 30, 2016 8:46 pm

Re: Where best to create/submit new keyboard layout

Post by magnus7 » Thu Mar 22, 2018 11:50 am

A complete list of all available character names can be found in a file /usr/include/X11/keysymdef.h

Post Reply

Return to “Other topics”