Looking for advice with Qukeys/Spacecadet and unicode

Hey there,

I’m looking to make a few enhancements to my configuration, but before I dive in to upgrading to the new api and stuff, I wanted to make sure that what I want to do is possible.

  1. Spacecadet-like modifiers

I’ve been happily using Spacecadet and have my left and right alt keys tap as { and } respectively. Due to how I prefer some of my shortcuts and how rarely I use right alt, I would like to change it to a left alt while keeping its } tap function. Spacecadet doesn’t seem to be able to do that, will Qukeys be able to help here? I haven’t been able to figure that out from available documentation.

  1. Unicode layer

I want to map a good portion of the unicode characters in https://en.wikipedia.org/wiki/Old_Hungarian_alphabet to a layer, about 40 of them at least. Is this doable or will I be limited by available memory, etc.? Is the unicode plugin able to handle continuous typing?

Thanks.

As far as I’m aware, Qukeys should be able to do that, yes.

I… don’t think so. Inputting Unicode with the plugin involves pressing a shortcut, inputting a hex code, and then pressing space. That takes time, and even if we did it the fastest way possible, the OS would still require time to process it properly. I don’t think you’d be able to type faster than about 20WPM with unicode thingies alone.

If you want to type old Hungarian faster than that, or just more reliably, it would be better to set up your layout on the OS side to have those symbols bound to AltGr combos, and create a layer in firmware that inputs those combos. AltGr combos are a lot easier to process on the host side, and a lot faster too.

1 Like

Thanks for that, I’ll try qukeys.

OS layout makes sense now that I understand how the plugin works. Looked into my /usr/share/X11/xkb/symbols/hu file and there even seems to be something implemented already :slight_smile:

Re: old Hungarian - had to fiddle a bit with enabling extra xkb mappings under linux but it works and the layout is usable.

𐲘𐳬𐳓𐳞𐳇𐳐𐳓

2 Likes

Awesome \o/

Can you share how you enabled the extra xkb mappings? At some point in the not too distant future, I’d love to be able to input old Hungarian, so this would come handy then O:)

Sure thing. Be aware that my knowledge is very limited in this area, I basically just googled things out. I’ll try to write this in a way that is less specific to oldhun so it might be more generally helpful. My system is Arch Linux with Gnome and the latest updates from the stable repositories installed as of the writing of this post.

Resources that I found helpful:

1. Key maps are defined in /usr/share/X11/xkb/symbols (and keycodes)

Got the info from the medium article linked above. Looked into /usr/share/X11/xkb/symbols/hu and found a section that defines a layout for oldhun:

partial alphanumeric_keys
xkb_symbols "oldhun" {
name[Group1]="Old Hungarian";
include "level3(caps_switch_latch)"
include "level3(ralt_switch)"
key.type[Group1]="FOUR_LEVEL_SEMIALPHABETIC";
// In the remarks you can read characters displayed only Unicode point
    key <AE01> {[U10CFA,         apostrophe,	1,	asciitilde    ]};
//Old Hungarian one
    
    key <AE02> {[                 U10CFB,	quotedbl,	2,quotedbl]};
//Old Hungarian five

...

Therefore I did not (yet) have to come up with a custom layout. Next up, how do I use what’s there?

2. Setting the layout

The /usr/share/X11/xkb/rules folder

The medium article categorises this as “files to enable the configuration”. I don’t really know what the meaning of each file is in this folder but what I found is that oldhun only appears in the ones that have “extras” in their name:

> grep -r oldhun .
./base.extras.xml:            <name>oldhun</name>
./base.extras.xml:            <shortDescription>oldhun</shortDescription>
./evdev.extras.xml:            <name>oldhun</name>
./evdev.extras.xml:            <shortDescription>oldhun</shortDescription>

Using Gnome 3.30

Out of the box on my system, Old Hungarian did not show up as an available input source in Settings > Region & Language > Input sources > + > Hungarian.

After a bit of googling I found that I had to set the /org/gnome/desktop/input-sources/show-all-sources to true (I used the dconf editor but gsettings should also work from the command line).

Restarted the computer and Old Hungarian showed up as an available input source in Settings (not sure what triggers the list refresh, gnome/x restart or relogging, I wanted to makes ure).

Using the command line

This is something I am not sure about at this point. I tried the tools mentioned in the Arch wiki keyboard config page. After I did the GUI method above, these return the following:

> localectl
   System Locale: LANG=en_GB.UTF-8
       VC Keymap: uk
      X11 Layout: gb,hu,hu
     X11 Variant: ,102_qwertz_comma_nodead,oldhun
> setxkbmap -print                                                    
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+gb+hu(102_qwertz_comma_nodead):2+hu(oldhun):3+gb:4+inet(evdev)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

So it might be as simple as setting the right values using those tools.

However, when I try to list the available variants as per the tool suggests, I don’t see oldhun available:

> localectl list-x11-keymap-variants hu
101_qwerty_comma_dead
101_qwerty_comma_nodead
101_qwerty_dot_dead
101_qwerty_dot_nodead
101_qwertz_comma_dead
101_qwertz_comma_nodead
101_qwertz_dot_dead
101_qwertz_dot_nodead
102_qwerty_comma_dead
102_qwerty_comma_nodead
102_qwerty_dot_dead
102_qwerty_dot_nodead
102_qwertz_comma_dead
102_qwertz_comma_nodead
102_qwertz_dot_dead
102_qwertz_dot_nodead
nodeadkeys
qwerty
standard

It works properly though after setting it through the GUI. Perhaps extras need to be enabled somewhere else too to make them show up here? Needs further investigation.

2 Likes

One more interesting thing I found was that xkb has a collection of keyboard geometries defined under /usr/share/X11/xkb/geometry.

I haven’t found any official use for these, but after a bit of looking around I found this script that helps you visualise layouts using the geometries defined in there.

./xkb-geometry-to-jpeg -o teck.jpg -geometry teck -layout gb,hu -variant ,oldhun

Yep, the official package has geometries defined for the TECK, Kinesis etc. Just putting this out here in case anyone feels like they want to create one for the Model01.

Edit: though I found the script mentioned here through googling, it appears that it is from @aspiers :slight_smile: What a small world.

3 Likes

Small world indeed! :stuck_out_tongue_winking_eye: Glad you found it useful. Yes indeed it would be great if someone created a geometry for the Model01. I’ve created them before and it’s not hard.

2 Likes