Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from stackoverflow.com Dec 24 '11 at 1:33

This question came from our site for professional and enthusiast programmers.

    
What in the world is XKB? Questions like this need a lot more context...rather than just a c tag. – Cody Gray Dec 18 '11 at 1:10
    
@CodyGray added some additional context and background behind xkb – William Dec 18 '11 at 1:21

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.

share|improve this answer
    
Thank you for the response but this doesn't seem to work. – William Jul 22 '15 at 19:31

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.

share|improve this answer

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

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .