# Looking for advice with Qukeys/Spacecadet and unicode

**URL:** <https://community.keyboard.io/t/looking-for-advice-with-qukeys-spacecadet-and-unicode/2062>\
**Category:** Programming\
**Tags:** question\
**Created:** [September 24, 2018, 10:05am UTC](https://community.keyboard.io/t/looking-for-advice-with-qukeys-spacecadet-and-unicode/2062 "2018-09-24T10:05:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngetal](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/ngetal/32/2937_2.png) [@ngetal](https://community.keyboard.io/u/ngetal)\
**Post date:** [September 24, 2018, 10:05am UTC](https://community.keyboard.io/t/looking-for-advice-with-qukeys-spacecadet-and-unicode/2062/1 "2018-09-24T10:05:47Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [September 25, 2018, 6:20am UTC](https://community.keyboard.io/t/looking-for-advice-with-qukeys-spacecadet-and-unicode/2062/2 "2018-09-25T06:20:42Z")

</div>

> [@ngetal](#):
>
> 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.

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

> [@ngetal](#):
>
> Is the unicode plugin able to handle continuous typing?

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.

---

<div class="post-metadata">

**Author:** ![ngetal](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/ngetal/32/2937_2.png) [@ngetal](https://community.keyboard.io/u/ngetal)\
**Post date:** [September 25, 2018, 8:59am UTC](https://community.keyboard.io/t/looking-for-advice-with-qukeys-spacecadet-and-unicode/2062/3 "2018-09-25T08:59:39Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![ngetal](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/ngetal/32/2937_2.png) [@ngetal](https://community.keyboard.io/u/ngetal)\
**Post date:** [September 25, 2018, 11:17am UTC](https://community.keyboard.io/t/looking-for-advice-with-qukeys-spacecadet-and-unicode/2062/4 "2018-09-25T11:17:57Z")

</div>

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

𐲘𐳬𐳓𐳞𐳇𐳐𐳓

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [September 25, 2018, 11:35am UTC](https://community.keyboard.io/t/looking-for-advice-with-qukeys-spacecadet-and-unicode/2062/5 "2018-09-25T11:35:51Z")

</div>

> [@ngetal](#):
>
> 𐲘𐳬𐳓𐳞𐳇𐳐𐳓

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:)

---

<div class="post-metadata">

**Author:** ![ngetal](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/ngetal/32/2937_2.png) [@ngetal](https://community.keyboard.io/u/ngetal)\
**Post date:** [September 25, 2018, 1:15pm UTC](https://community.keyboard.io/t/looking-for-advice-with-qukeys-spacecadet-and-unicode/2062/6 "2018-09-25T13:15:51Z")

</div>

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:

- [https://medium.com/@damko/a-simple-humble-but-comprehensive-guide-to-xkb-for-linux-6f1ad5e13450](https://medium.com/@damko/a-simple-humble-but-comprehensive-guide-to-xkb-for-linux-6f1ad5e13450) - seems to be a good starting point although it appears to be dated a bit in places
- [https://wiki.archlinux.org/index.php/X\_keyboard\_extension](https://wiki.archlinux.org/index.php/X_keyboard_extension)
- [https://wiki.archlinux.org/index.php/Xorg/Keyboard\_configuration](https://wiki.archlinux.org/index.php/Xorg/Keyboard_configuration)
- [https://www.freedesktop.org/wiki/Software/XKeyboardConfig/](https://www.freedesktop.org/wiki/Software/XKeyboardConfig/) - there is a link section at the bottom although most linked articles seem to be quite old, not sure how up-to-date they are

### 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`:

```auto
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:

```auto
> 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:

```auto
> localectl
   System Locale: LANG=en_GB.UTF-8
       VC Keymap: uk
      X11 Layout: gb,hu,hu
     X11 Variant: ,102_qwertz_comma_nodead,oldhun

```

```auto
> 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:

```auto
> 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.

---

<div class="post-metadata">

**Author:** ![ngetal](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/ngetal/32/2937_2.png) [@ngetal](https://community.keyboard.io/u/ngetal)\
**Post date:** [September 25, 2018, 3:04pm UTC](https://community.keyboard.io/t/looking-for-advice-with-qukeys-spacecadet-and-unicode/2062/7 "2018-09-25T15:04:07Z")

</div>

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](https://github.com/aspiers/desktop-config/blob/c3818de94c81bc8145d0c3c34694962184753ac0/bin/xkb-geometry-to-jpeg) that helps you visualise layouts using the geometries defined in there.

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

```

 ![teck](https://canada1.discourse-cdn.com/flex031/uploads/keyboard/original/2X/b/bf822e7b57f398c920e3f6e0d8da611def30c27b.jpeg)

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 🙂 What a small world.

---

<div class="post-metadata">

**Author:** ![aspiers](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/aspiers/32/245_2.png) [@aspiers](https://community.keyboard.io/u/aspiers)\
**Post date:** [September 26, 2018, 1:29pm UTC](https://community.keyboard.io/t/looking-for-advice-with-qukeys-spacecadet-and-unicode/2062/8 "2018-09-26T13:29:08Z")

</div>

Small world indeed! 😜 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.
