• You are not logged in.

Remapping Alt to Shift

  • Started by misterW
  • 34 Replies:
  • Reputation: 6
  • Registered: 25-Jan-2017
  • Posts: 54

The Shift keys get more use than Backspace, and are one of the most used keys on the keyboard outside of the alphabet letters

I find I make the most mistakes in all typing tests when I have to Shift-letters. The problem is that the Shift keys move your hand. Consider the following two words:

Food
Hand

In QWERTY, both of those words are awful to type if you use the standard rule of "use the shift key in the opposite hand of the letter you're pressing". You have to use right-shift for "F", and now your hand is out of position to type the following "o". "Hand" isn't as bad but still illustrates the problem. These are only basic examples. Sure you could use left-shift for "F" but that would then run into the same problem with "Fat".

Using Alt as a shift key solves all problems. You just use your thumbs to shift letters to upper case. This seems like a no brainer for both comfort and speed. This is what some of the ergonomic keyboards do already with all of their thumb keys

I'm curious others think

Last edited by misterW (25-Jan-2017 06:21:17)
Offline
  • 0
  • Reputation: 6
  • Registered: 25-Jan-2017
  • Posts: 54

Ah a search turned up some old threads such as this:
https://forum.colemak.com/topic/2166-al … keyboards/

Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978

You should also take a look at this page for more ideas on this topic!

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,362

Good point there. I agree that many words create uncomfortable situations with Shift.

The Sean Wrona approach to this problem is sticky shift! You hit the Shift key instead of holding it down, and then your hand can gravitate back to home position which would mitigate the problem of your two examples.

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978
DreymaR said:

The Sean Wrona approach to this problem is sticky shift!

This is easy to do in Windows with AutoHotKey, but what about in Linux?  I was looking to see if there is an easy way, and I found this:

xkbset sticky -twokey

It works, but there are two problems:
1. It applies stickyness to all modifiers, not just shift (I don't really want this feature for Control, Alt, etc)
2. It doesn't allow you set a timeout period for the stickyness (I only want it to apply stickyness for about 0.5 seconds)

I haven't found any other solutions, if anyone knows of any, do tell!

Last edited by stevep99 (01-Feb-2017 11:02:04)

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,362

The Archlinux Wiki has some of the best answers about XKB.

According to that, you can edit your shift key's function (or make a new one, but that's trickier!):

replace

   key <LFSH> {         [         Shift_L ] };

with

   key <LFSH> {         [         ISO_Level2_Latch ] };

I don't remember which file has the Shift key definition, but poke around in xkb/symbols to start with.

One cool thing you can do (not for super-fast Wrona typing but still cool) is make modifiers two-level. So both Shift keys together could be Shift Latch or Shift Lock (or Caps Lock), for instance.

Unless you're into recompiling your OS, you can safely forget about that sticky delay ttbomk.

Last edited by DreymaR (01-Feb-2017 13:12:41)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978

Found the definition in:

/usr/share/X11/xkb/symbols/pc

Unfortunately, it doesn't work (for me at least). It just disables the shift key entirely.

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,362

Looks to me like it should work; are you absolutely sure you haven't borked it in any way? All capitalizations and symbols correct? Have you tried making the LShift into Control_L as a test? Did you delete the .xkm server and restart (as per my install script – may not be necessary though)?

If you look in symbols/shift, you'll see some cool examples. For test purposes, try editing for instance Shift_Lock to ISO_Level2_Latch under "lshift_both_shiftlock", and then set that option (for instance with my setxkb script or the setxkbmap command. Now your LShift should be normal shift but with RShift held down first it should be sticky.

Last edited by DreymaR (01-Feb-2017 13:13:25)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978
DreymaR said:

Looks to me like it should work; are you absolutely sure you haven't borked it in any way? All capitalizations and symbols correct? Have you tried making the LShift into Control_L as a test? Did you delete the .xkm server and restart (as per my install script – may not be necessary though)?

If you look in symbols/shift, you'll see some cool examples. For test purposes, try editing for instance Shift_Lock to ISO_Level2_Latch under "lshift_both_shiftlock", and then set that option (for instance with my setxkb script or the setxkbmap command. Now your LShift should be normal shift but with RShift held down first it should be sticky.

No Joy. I can switch around Shift_L / Control_L and it works fine, but as soon as I set anything to ISO_Level2_Latch, it stops working. It's as though ISO_Level2_Latch doesn't have any meaning to my system. No idea why.

Will just have to live without it I suppose.

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 6
  • Registered: 25-Jan-2017
  • Posts: 54
stevep99 said:
DreymaR said:

The Sean Wrona approach to this problem is sticky shift!

This is easy to do in Windows with AutoHotKey,

Sticky Keys is built-into Windows, no need for AHK

And I thought Wrona uses Capslock, not Sticky Shift

Last edited by misterW (02-Feb-2017 04:03:43)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,362

Wrona has used both I think. I don't see a good rationale to use Caps instead of sticky Shift, other than the obvious availability. And it's one more key press which seems counterproductive!

Last edited by DreymaR (02-Feb-2017 09:32:13)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 6
  • Registered: 25-Jan-2017
  • Posts: 54
DreymaR said:

Wrona has used both I think. I don't see a good rationale to use Caps instead of sticky Shift, other than the obvious availability. And it's one more key press which seems counterproductive!

i agree, but in practice when i tried Sticky Keys, i found sometimes that i would be pressing shift once and then releasing it, as if i had made a mistake and not wanted to use shift, but because now it was 'stuck' down for the next character, i was screwed

Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978
misterW said:

i agree, but in practice when i tried Sticky Keys, i found sometimes that i would be pressing shift once and then releasing it, as if i had made a mistake and not wanted to use shift, but because now it was 'stuck' down for the next character, i was screwed

That's exactly why I said I wanted to set a half-second timeout. You can do that in AHK at least.

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 6
  • Registered: 25-Jan-2017
  • Posts: 54

ah i missed that, yes thats an excellent solution

Offline
  • 0
  • Reputation: 15
  • Registered: 12-Sep-2016
  • Posts: 45
stevep99 said:
DreymaR said:

Looks to me like it should work; are you absolutely sure you haven't borked it in any way? All capitalizations and symbols correct? Have you tried making the LShift into Control_L as a test? Did you delete the .xkm server and restart (as per my install script – may not be necessary though)?

If you look in symbols/shift, you'll see some cool examples. For test purposes, try editing for instance Shift_Lock to ISO_Level2_Latch under "lshift_both_shiftlock", and then set that option (for instance with my setxkb script or the setxkbmap command. Now your LShift should be normal shift but with RShift held down first it should be sticky.

No Joy. I can switch around Shift_L / Control_L and it works fine, but as soon as I set anything to ISO_Level2_Latch, it stops working. It's as though ISO_Level2_Latch doesn't have any meaning to my system. No idea why.

Will just have to live without it I suppose.

To give ISO_Level2_Latch meaning, you also have to add

modifier_map Shift { ISO_Level2_Latch };

to your symbols file.

Create advanced keyboard layouts in various formats using my Keyboard Layout Files Creator!

Offline
  • 1
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,362

Thanks, Aldo! I actually thought about that but then forgot it again. Silly me.

Do you actually need this:

modifier_map Shift  { Shift_L, Shift_R, ISO_Level2_Latch };

...or is it okay to add on just the last one?

Steve: You can do this in the symbols/pc file (affects all pc model keyboards) or in your layout definition, as suits you.

Last edited by DreymaR (02-Feb-2017 15:13:40)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 15
  • Registered: 12-Sep-2016
  • Posts: 45

It's okay to just add

modifier_map Shift { ISO_Level2_Latch };

since it adds ISO_Level2_Latch to the modifier list for Shift. But you could also redefine

modifier_map Shift  { Shift_L, Shift_R };

to

modifier_map Shift  { Shift_L, Shift_R, ISO_Level2_Latch };

in symbols/pc.

Create advanced keyboard layouts in various formats using my Keyboard Layout Files Creator!

Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978

Nice one, aldo39, that works!

There does seem to be a limitation: It only allows you to have ISO_Level2_Latch defined for one of the shift keys only.  That's not really a problem for my case though, I am experimenting with using Sticky shift on my third shift key (which I have called <MDSH> and is mapped to the left half of my space bar). For anyone interested, it looks like this:

    key <LFSH> {	[ Shift_L		]	};
    key <RTSH> {	[ Shift_R		]	};
    key <MDSH> {	[ ISO_Level2_Latch	]	};

    modifier_map Shift  { Shift_L, Shift_R, ISO_Level2_Latch };

This seems to work quite well. Shame it's not possible to set a time-delay though.

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 15
  • Registered: 12-Sep-2016
  • Posts: 45

Apparently, XKB doesn't look at all keycodes for ISO_Level2_Latch. But with the following, both shift keys will be sticky:

key <LFSH> { [ ISO_Level2_Latch ] };
key <RTSH> { [ ISO_Level2_Latch ] };
modifier_map Shift { <LFSH>, <RTSH> };

Create advanced keyboard layouts in various formats using my Keyboard Layout Files Creator!

Offline
  • 0
  • Reputation: 6
  • Registered: 25-Jan-2017
  • Posts: 54

So instead of using Alt, I'm experimenting using Sticky Shift and I like it very much (using the AHK script from stevep99)

One thing I'm realizing, is just how uncomfortable it is to press the Right Shift key. I'm a traditional typist, using the "proper" fingering of pressing the shift key with the opposite hand that I'm using. But this isn't very comfortable, nor is it fast.

Pressing the right shift causes me to rotate and displace my wrist, removing me from my homerow resting position. I'm quite certain this has resulted in numerous errors and slowdowns for me. Which probably means I could increase speed and comfort substantially by just using left shift for all letters except QAZ. This goes hand in hand with the observation I had in the original post

Could even go to the extreme of mapping Right Shift to an extend layer for keys other than QAZ

Last edited by misterW (06-Feb-2017 07:51:08)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,362

With a Wide mod, the right Shift key is quite accessible, no worse than hitting the apostrophe key. But I agree that it still isn't optimally comfortable!

The best solution must be some sort of thumb shift, as SteveP will surely recommend. I've been loath to mess with my modifiers so far (bar Caps → Extend) but it's tempting! And as cool as the JIS keyboards are, I don't actually want a Japanese keyboard.

Last edited by DreymaR (06-Feb-2017 09:44:03)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978
DreymaR said:

The best solution must be some sort of thumb shift, as SteveP will surely recommend

...must...resist...temptation...   

OK, I can't deny it, I *would* recommend thumb shift.

I'd say the whole concept of having to tap a key while holding down a modifier with an opposite-side pinky, is fundamentally flawed.
It's almost as silly as, say, having the J key in the best position on the keyboard. Who could possibly want a keyboard like that??  :-P

Last edited by stevep99 (06-Feb-2017 11:24:19)

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,362

Haha, Steve! :-D

These shifty discussions easily get sticky.

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 6
  • Registered: 25-Jan-2017
  • Posts: 54
DreymaR said:

The best solution must be some sort of thumb shift

Yeah that was my original goal with this thread, and why I was considering Alt, since Alt is placed nicely under the thumbs

However

Thumb shift doesn't solve the inherent problem that still exists: CHORDING.

Even if you use a thumb key for Shift, you still have to press two keys at the same time, and you have to release them at the exact same time. When typing at fast speeds, it becomes extremely hard to time it correctly without making typos and having an extra letter CAptalized for example

Thats why Wrona uses Capslock instead. And I think that's why Sticky Shift may work better for me. I'm curious to see if the AHK script will keep up or if it will have errors at high speeds

Last edited by misterW (06-Feb-2017 15:52:16)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,362

As a pianist, I have nothing against chords as such. They come quite naturally if they're ergonomic. :-)

You should not aim to press and release Shift+key simultaneously, but rather ShiftDn–Key–ShiftUp. But as you, me and Sean know, at high speeds there may be timing problems. A Sticky Shift would potentially save time as it is only two defined actions as opposed to the three actions with normal Shift.

I think I'll try to introduce a sticky Shift functionality into PKL, eventually. That way it'll be accessible together with Extend etc, without needing any further settings. Also, I just tested the standard Windows Sticky Keys and it doesn't work in conjunction with PKL.

Last edited by DreymaR (06-Feb-2017 16:13:21)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0