8

Background:

Ultimately, I'm trying to set up a custom one handed keyboard layout similar to this demo(click one-handed typing demo).

XKB is used in many linux distros. Wikipedia has a decent description of xkb.

In human-computer interfaces, the X keyboard extension or XKB is a part of the X Window System that extends the ability to control the keyboard over what is offered by the X Window System core protocol. The main features of this extension are:

Unfortunately to achieve this functionality I must make the space bar a modifier.

The Question:

How would you set up the space key as a modifier in the XKB program?

http://www.charvolant.org/~doug/xkb/html/node3.html

It appears the space is unable to be a modifier by default.

William
  • 1,438

3 Answers3

5

I found that Space2Ctrl is a best tool to do this remapping. Very easy, do not require any configuration and works as intended without excess delays. I tried keydouble but it introduced noticeable delay before space was shown on screen

user220055
  • 51
  • 1
  • 1
3

I think you're going to have immense difficulty getting the 'tap to space; hold to shift' behavior.

That said, you can use xkbcomp :0.0 to dump the current keymap from the server to a file server-0_0.xkb, and I think I see an easy way to get the space bar to function as as modifier:

key <LALT> {         [           Alt_L,          Meta_L ] };
key <SPCE> {         [           space ] };
....
modifier_map Mod1 { <LALT> };
modifier_map Lock { <CAPS> };

Try replacing space with Mod5 (or whichever modifier key makes most sense), and then add a new modifier_map line:

key <LALT> {         [           Alt_L,          Meta_L ] };
key <SPCE> {         [           Meta5 ] };
....
modifier_map Mod1 { <LALT> };
modifier_map Lock { <CAPS> };
modifier_map Meta5 { <SPCE> };

This is untested, but it feels right.

I don't know how you'll get a plain old space though. I'd suggest mapping it to another key entirely.

sarnold
  • 3,828
1

Consider using keydouble. It's a user-space utility that attaches itself to X and continues to grab and processes keyboard events. The default configuration provided in examples/keydoublerc does exactly what you want - space becomes ctrl. If it is not used with another key then space is inserted upon key release.