You are not logged in.

#1 2011-05-23 04:25:57

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

EDIT (2022-02-27): May the people and the land of Ukraine be in peace; also those of Russia. Death to V V Putin, together with G W Bush.

Hi. This hack, at-home-modifier (or ahm for short) provides for example "space/shift dual role key". When you press the space key alone, it's a space; but when you press it with another key, it's a shift. Any pairs of keys are possible. This means your hands stay almost always at their home positions.

It's a fork of the Xorg "evdev" driver (= xf86-input-evdev). Read README for the details.

Installation
The latest release is 2.10.6. (Mar 2020)
* AUR for 2.10.6 by Rhinoceros. (Salkay in this forum. Thanks a lot!)
* Modify 80-ahm.conf in the package, and put it under /etc/X11/xorg.conf.d/. Config options are described in README. (Make sure the evdev driver is used. Today the default keyboard driver is libinput.)

* For older versions / full source tarball / git access, visit the homepage.

When you upgrade your xorg-server-x.y.z, you have to rebuild this hack, too. More precisely, a change in z doesn't affect, but x or y does.

It can be built exactly the same way as the Xorg's original code. (I'm a Gentoo user, though.)

News for 2.10.6 (Mar 2020)
* Kernel >= 5.4 bug workaround. This bug was fixed in the kernels 5.6, 5.5.14 and 5.4.29.
* Merges the upstream 2.10.6.

FAQ
Q: Can I input Shift+Space if my Space is Space/Shift dual-role key?
A: Turn both of your Space and Shift into Space/Shift keys.

Alternatives
* xcape (AUR). It's a userland software, so you don't have to catch up the upgrades of xf86-input-evdev.
* For Wayland, see the comment #53 by acegallagher.

Notice
Probably I don't develop any more my hack as a fork of xf86-input-evdev. It's better to do all in user space, rather than as an X driver.

Contact
Read README.

With best regards.

Last edited by teika (2022-02-27 07:18:53)


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#2 2011-06-12 21:32:22

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

I was just planing* on doing this slightly eccentric manipulation with actkbd, but your hack seems effortless to configure !

* https://bbs.archlinux.org/viewtopic.php?id=120191

Last edited by bloom (2011-06-14 19:44:49)


gh · da · ds

Offline

#3 2011-06-14 07:14:22

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Thank you for taking a look. It seems it's exactly what you want, and I hope it'll help.

I didn't know actkbd. It has its own pros and cons over mine, but it's not good that it's not maintained any more. If you like my hack, then please advertise it so that better maintainers take me over. :)

[8 oct: deleted an outdated comment]

Last edited by teika (2011-10-08 05:57:23)


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#4 2011-06-14 20:03:24

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

teika wrote:

Thank you for taking a look. It seems it's exactly what you want, and I hope it'll help.
I didn't know actkbd. It has its own pros and cons over mine, but it's not good that it's not maintained any more. If you like my hack, then please advertise it so that better maintainers take me over. smile

I did advertise your work:

http://geekhack.org/showthread.php?1884 … ard-Layout

And I doubled the number of votes of the related AUR package !

I read this in the README :

And I press the space to use as a modifier, but I change my mind, and release it, and there comes an unwanted space.

I think that, as soon as the key is sending a repeat event, it should be considered as the modifier.

#You're right: I shouldn't be using the word I was using in my original post, I replaced it.


gh · da · ds

Offline

#5 2011-06-17 08:51:34

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Thanks a lot, bloom. Ok, I've added the pointer to the AUR in my first post.

I don't (yet) understand your suggestion on repeat and modifier issue. I may try if you could detail more.

I confess you're better than me admitting your own fault. I often resist and later I feel petty. ;/


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#6 2011-06-18 08:30:08

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

teika wrote:

I don't (yet) understand your suggestion on repeat and modifier issue. I may try if you could detail more.

I was referring to the autorepeat mechanism as a way of resolving the fore mentioned issue.
If I press the original key long enough to trigger the autorepeat mechanism, then, when the original key is released, it should send a release of the translated key and nothing else.


gh · da · ds

Offline

#7 2011-06-25 05:28:17

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

I see, thanks. It's worth trying when I've got time. Wait a bit.


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#8 2011-07-10 17:49:10

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Now that I've tried it, I have found a little problem :

My Return key is translated to Control_R and if I type too fast, I press Return before having released the last key and I release the last key before releasing Return, hence I get Control_R instead of Return.


gh · da · ds

Offline

#9 2011-07-14 00:47:47

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Right.

I've tried to fix it some time ago in a git branch "fast-type", but it failed. Simple, direct solution doesn't work. I don't know why. See the README of that branch for the detail:

http://gitorious.org/at-home-modifier/a … ype/README

Currently it's unlikely that I'll have time to complete it. Please someone write correct codes. :)


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#10 2011-10-08 06:01:48

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

ahm-2.6.2 is released. Many new features, bugfixes, README improvements are done.

* Fast type fix
  Users of this hack often have “tongue-twister of finger”: Suppose you want “ x”. But if you press space/shift, press x, and release space/shift (before releasing x), you’ll get an upper-case X instead.
  Fixes are attempted with new “AhmDelay” and “AhmFreezeTT” options.

* Cancellation by timeout
  Suppose you were about to input shift + A and pressed space/shift, but you changed your mind. If you release the space/shift key, you’ll receive one space, but it’s not what you want!
  This can be fixed by long enough press now.

* "Big keycode support" is introduced in 2.6.2, but deleted in 2.6.3, since loadkeys (1) command suffices. (12 Nov 2011)

* Reset
  When something is wrong, leave the keyboard untouched for 10 secs. Then all are reset to the initial state.

* 2.6.1 was never released.

For full changes, read README, "News" section:
http://gitorious.org/at-home-modifier/a … ter/README

Forum / mailing list
Now there's a forum for this hack:
http://at-home-modifier.2300353.n4.nabble.com/

Please use it for general topics, and use this thread for distro specific things only.
(But I'd be glad if you could add a comment here to make it draw more attention. =)

Any comments, both positive and negative, are more than welcome. Please give me a feedback. (I don't know how many have tried.)

With best regards.

AUR: https://aur.archlinux.org/packages.php?ID=49546
Source download: http://gitorious.org/at-home-modifier/pages/Home

Last edited by teika (2011-11-12 06:14:31)


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#11 2011-11-12 06:12:41

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Hi. at-home-modifier-2.6.3 is released. It's a bugfix release. Changes are:

* Gtk widget double press issue.
To push a gtk button, sometimes you had to press space/shift key twice, but this is fixed. If it doesn’t work out-of-box, set “AhmPaddingInterval” option. (This “bug” is not the author’s fault, but what’s bad for users are bugs.=)

* Reset and Delayed key
“Delay” and “Reset” are features introduced in 2.6.2. If a delayed key is pressed after a long enough period is passed (i.e. a reset is done), the press was ignored. It’s fixed now.

* “Big keycode support” introduced in the previous release is deleted, since xloadkeys (1) command suffices.

For full changes, read README, "News" section:
http://gitorious.org/at-home-modifier/a … ter/README

# By the way, I've never received any feedback. Please give me a short word of "Hi, I like this hack, please keep going on!" or so. I feel lonely. ;)

With best regards.

AUR: https://aur.archlinux.org/packages.php?ID=49546
Source download: http://gitorious.org/at-home-modifier/pages/Home

Last edited by teika (2011-11-12 06:15:23)


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#12 2011-12-03 16:01:46

grimp3ur
Member
Registered: 2010-09-05
Posts: 7

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Hi, thanks for great hack, my fingers highly appreciate it :).

After seeing this topic, I've added PKGBUILD for 2.6.3: http://aur.archlinux.org/packages.php?ID=54520.

BTW, can one hope for mouse support in foreseeable future? (probably it's question to xkb2-developers)
I'm aware that it's not currently supported by design, though AhmTimeout partially replaces this functionality.

teika wrote:

# By the way, I've never received any feedback. Please give me a short word of "Hi, I like this hack, please keep going on!"
You know, some linux advocates are introverts (speaking for myself) =), but the hack is really great.

Last edited by grimp3ur (2011-12-03 16:16:46)

Offline

#13 2011-12-05 09:01:55

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Hi, gripm3ur. Thanks a lot, (again!) for the AUR, and helpful comments in the AUR repository.

By "mouse support", you mean Space/Shift + mouse click, right? Actually, I think it's possible as long as the mouse is also handled by evdev driver. Notebook touchpads are major exception, whose driver is synaptic, though. (Now I understand things better than the first time I posted it.)

It's likely to benefit many. Ok, I'll try it. At least it's easy to give a try.

# On xkb2... The development seems stopped. Something has to de done in the X input, but X itself is obsolete, and if Wayland can replace X, then they don't want to spend their time in X renovation. Anyway a "correct", or at least better design of input is unknown yet, and the effort to seek one will never be a waste.

grimp3ur wrote:

thanks for great hack

My hack owes at least to three people. =)
Oops! Ahm's REAMDE lacks gratitude to them. I've added it now. =P

Thank you for a nice idea and kind comments. Good luck.

# BTW I've noticed you can buy Japanese keyboards from say amazon.com.  When you need a new keyboard, consider buying one. This hack works better with Japanese keyboards (read README). =)

Last edited by teika (2011-12-05 09:52:56)


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#14 2011-12-10 08:58:34

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Hi. A hack to support mouse is available at the git branch "mouse". Feel free to try it. If you don't see any problem for a week or so, please report. You can get the source by:

$ git clone -b mouse git://gitorious.org/at-home-modifier/at-home-modifier.git

I won't make a new release soon. There's one more feature request at Gentoo Wiki, and I'll give it a try. If it turns out too difficult, then I'll release with mouse support only.

Regards.


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#15 2011-12-28 08:39:55

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Hi. at-home-modifier-2.6.4 is released. It has one minor fix, "mouse support", discussed above:
When you press space/shift and a mouse button, the result used to be shift + click, ok, but also followed by an extra, unwanted space, as if the click hadn't happened. It's because each device ignored others. Now it's fixed, as long as the mouse is also handled by evdev driver. (Notebook touchpads are dealt by synaptics driver, so it's not fixed, and won't be fixed. Use AhmTimeout option as a workaround.)

I can't provide a PKGBUILD for the latest, but one for the previous, 2.6.3, is available here.

If you find the news or README difficult to understand, then feel free to ask.
<quote>"What's inconvenient is a bug." - Teika kazura</unquote> smile


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#16 2011-12-29 09:31:03

grimp3ur
Member
Registered: 2010-09-05
Posts: 7

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

teika wrote:

Hi. at-home-modifier-2.6.4 is released. It has one minor fix, "mouse support", discussed above

Excellent smile, I've just updated PKGBUILD, now can fall back to more convinient timeout-value. As far as I tested, fix works like a charm. Many thanks!

teika wrote:

I can't provide a PKGBUILD for the latest

AFAIU, you are Gentoo-adept? If you're also using arch (or just want to be able update PKGBUILD in proper time) I could pass an ownership to you. I'm not saying, that I don't want to update this package smile.

teika wrote:

By "mouse support", you mean Space/Shift + mouse click, right?

Exactly, sorry for too late reply, I visit archforums rather rarery.

And thanks for bothering to explain some details about xkb2 et cetera.

Offline

#17 2012-01-02 11:03:58

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

I thought your hack was responsible for some keyboard freezing (in fact it was the arcane terminal flow control being activated by '^s') but I might give it another try since you seem to have made some progress lately.

I had a splendid idea: map space to space / Mode_switch. And then use the standard `xmodmap` Mode_switch mechanism. Hence, one might map the cursor keys to 'space+h,j,k,l', return to 'space+caps_lock', etc.


gh · da · ds

Offline

#18 2012-01-31 02:00:05

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

I've found an alternative, Space2Ctrl, by Victor Moreira.

* s2c works in the user space, while ahm (=at-home-modifier) is the fork of an X input driver.
* s2c uses "X Record Extension" to detect events. I haven't given a try yet, but it probably stands between the X server and clients (or Xlib).
*** This (probably) means it can't coexist with other softwares which use Record Extension, e.g. AutoKey or xnee.
* s2c doesn't require much updates; ahm has to keep up with the upstream (= X).
* s2c is written in C++. (I don't understand C++. :P)
* The s2c code is slim; it's easier for users to hack.
*** Ahm is a fork, so the distinction of the genuine ahm part and the original X code is not clear.
* s2c is rudimentary. The sole keycode pair is hard-coded, and has no option. According to the author (in private correspondence), "more of a personal hack, very poorly tested and documented."

Read the git commit log to know the author's email address. He said he'd like more users, so sending patches may be welcome.

News: Ahm development hasn't seen any progress after the 2.6.4 release.

Welcome back, bloom. In my opinion, the space key is "too precious" to bind it to Mode_switch (roughly equal to ISO3_Level_Shift), which has very limited use. In my case, space is ctrl, and inside of emacs and shell, I can move cursors with alphabet keys, using a layout similar to vi. *Very* comfy.

On the PGKBUILD: I've sent a pm to grimp3ur, but he's probably busy. ;)


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#19 2012-02-14 10:35:28

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Very easy to hack indeed!
I've just released my own reworked version of it: keydouble.
The differences with Space2Ctrl are:

  • It's written in C.

  • The keycodes are configurable.

  • It will handle multiple natural/artificial pairs soon.

Last edited by bloom (2012-02-14 10:36:20)


gh · da · ds

Offline

#20 2012-02-14 21:17:33

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

I implemented multiple pairs in the multipairs branch.
In this branch, the configuration is read from an xmodmap-compatible file.

Last edited by bloom (2012-02-14 21:18:02)


gh · da · ds

Offline

#21 2012-02-15 11:11:18

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

The multipairs branch has been merged into the master branch.


gh · da · ds

Offline

#22 2012-03-14 12:30:58

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Xorg has released xf86-input-evdev-2.7.0. It has multitouch support.

I've merged it to my hack, which is available at the GIT repo, "master" branch. I don't make a release at least for a week, but you can try it. (It's been running for 30 min without problem. =)

To use the multitouch support, you need:
>=xorg-server-1.11.99.901
>=inputproto-2.1.99.3
sys-libs/mtdev

At-home-modifier itself doesn't have any progress since the last release.

I don't have any multitouch device, so I won't test it.

Last edited by teika (2012-03-14 12:35:07)


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#23 2012-04-22 12:36:17

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Hi, folks. Not a news of ahm update, but of a good keyboard.

keyboard glossary:
https://en.wikipedia.org/wiki/Keyboard_technology
http://www.overclock.net/t/491752/mecha … oard-guide

I recommend Japanese keyboards for at-home-modifier, because you can press many keys with thumbs. Image here:
https://en.wikipedia.org/wiki/File:KB_Japanese.svg

The bottom row of my keyboard is:
Esc-BS-Spc-Ret-Tab and
Alt-Shift-Ctrl-Shift-Alt
(The middle one is the space bar.) as described in the README of ahm. Japanese keyboards enable such stunt which is really comfy.

I use a membrane keyboard, whose touch is bad for your finger. There hasn't been good keyboards with enough many thumb keys.

Recently a new keyboard with "cherry mx brown switch", OWL-KB109BM(B)IIB, came out:
http://www.owltech.co.jp/products/keybo … _B_II.html (Japanese)
You can buy one from amozon.co.jp, at 8000 yen or so (roughly equal to $100; these days yen is high.). They offer an English interface, too. I dislike google/apple/amazon monopoly, though. (Who likes?)
There's also "cherry mx blue" one, OWL-KB109BM(B)II, too. They say blue is noisy.

There's already many other cherry switch or capacitive switch Japanese keyboards, but they have a long space bar, which doesn't suit my purpose.

I haven't bought yet. Not cheap, but interesting. Night night.


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#24 2012-05-08 09:47:25

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

Keyboard related essays by Xah Lee:
Keyboarding


gh · da · ds

Offline

#25 2012-06-06 08:33:26

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Re: Easy shift / ctrl / AltGr / etc hack on xf86-input-evdev

At-home-modifier-2.7.1 is released. (Called whimsically 2.7.1, not 2.7.0.) It merges the upstream 2.7.0, but has no changes in ahm since 2.6.4.

Modifications from the upstream 2.7.0 are:
* An upstream bugfix of horizontal scroll, X.Org Bug 46205, is included. (The fix is published after the 2.7.0 release.)
* Added an option to configure script "--without-mtdev". The upstream code always checks mtdev, and enables it when found. If you don't pass the above option, it falls back to the original behavior.

Read README for the details.

* Source tarball
* Patch against Xorg's original 2.7.0

Notice
Probably I don't develop any more this hack as a fork of xf86-input-evdev. It's better to do all in user space, not as an X driver. (And personally I'm terribly weakened.)

If you want some progress, improve Keydouble or so. I'm also interested in a rewrite in Python, which will be easier to allow flexible configuration. (In reality I don't think I'll ever write one.) It'll be great if it's integrated to AutoKey, but the AutoKey developer is not interested.

To make these hacks more popular, you can upvote my answer here to a question on Emacs Pinky in StackOverflow.

@bloom
I know Xah Lee's essays, but they never helped me. That's why I wrote this hack. ;-) Thanks anyway.

Regards.

Last edited by teika (2012-06-06 09:07:41)


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

Board footer

Powered by FluxBB