• You are not logged in.

DreymaR's Big Bag of Keyboard Tricks (Linux/XKB files included)!

  • Started by DreymaR
  • 384 Replies:
  • Reputation: 0
  • Registered: 11-Oct-2013
  • Posts: 79
stevep99 said:

I think people often think too negatively about modifier keys - but this really only stems from the fact the most of the modifiers are in terrible locations on a standard keyboard.

For example, my backspace key is Extend-H (which on a "normal" keyboard would be the equivalent of LAlt-M). You might think that backspace, being a quite a common key (unless you are extremely accurate, which sadly I'm not) should have pride of place in the primary layer.  But actually Extend-H, despite being a two-key combo, is easier and more comfortable than the single default backspace key. I'd even go so far as to say it's probably better than over half of the single-keys on the keyboard.

Modifier placement is pretty much ubiquitous, so the negative view of modifiers is understandable. Very few people have ever seen or tried a keyboard with a thumb cluster. I use "backspace a word" more than backspace, but I agree that both are more convenient on a layer than the default backspace location. I don't use keys that are far away from the home row like backspace and the function keys.

stevep99 said:

That said, if you're not sold on Extend yet...

It's not that I'm not sold on Extend. I used a navigation/extend layer for a while even before I switched to Colemak. It was great when I was on Windows and using software designed to be used with a mouse. A navigation layer isn't nearly as useful for keyboard-driven programs where you can get to any visible location in a few keypresses and can navigate by semantic units. I still use some of the keys that would be on the extend layer (like backspace), but using a modifier with local rebindings (to more useful program-specific functionality) makes more sense for this case since with a global extend layer you can't map something like "Mode_switch + key" directly like you might with "control + key". Instead you have to indirectly remap what "Mode_switch + key" is bound to.

stevp99 said:

then putting Escape on CapsLock sounds reasonable to me.

What I was saying is that the two aren't mutually exclusive. The most common thing to do is to bind caps to both escape and control, but escape and Mode_switch (or whatever key for extend) works fine as well.

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

Read my Extend topic, and you'll see that Extend is in itself a somewhat semantic utility. Backspace alone on Extend is meh; arrows/editing with Ctrl and Shift is nothing short of wonderful. Caps+S+T+N to select previous word for instance, then holding down Caps hit X to cut, then similarly move down a paragraph and paste at the end of the line (Caps+T+E,Caps+Y, Caps+V). And that's just one example. Have you read that topic?

I use Extend even in Vim, particularly to replace the jkhl keys that are somewhat out of place. But you'll find other tricks too. And, yes, the Caps+Q Esc.

Last edited by DreymaR (03-May-2016 14:23:57)

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

Offline
  • 0
  • Reputation: 0
  • Registered: 11-Oct-2013
  • Posts: 79

Yes I'm familiar with the fact that you can combine modifiers, but those combinations don't work in most of the software I normally use (and they would be less efficient). I don't really type text in any environment where I can't use vim keys. If I was using someone else's computer, I'd definitely see the value in having a global extend layer. I'd still prefer a modal version created with keyboard macros and layer switches in that case though (but I still haven't been able to test that with tmk firwmare).

DreymaR said:

I use Extend even in Vim, particularly to replace the jkhl keys that are somewhat out of place. But you'll find other tricks too. And, yes, the Caps+Q Esc.

I've just rebound n and e to j and k, and I hardly ever use h or l. That said, it's definitely a valid point that it is useful to have these keys (and home and end, for example, which I use a lot) bound on a modifier. This can be done just as easily with control though. My point is that more useful vim-specific functionality can then be bound on control as well. Extend as a global layer isn't as useful for vim.

Last edited by angelic_sedition (03-May-2016 19:07:47)
Offline
  • 0
  • Reputation: 11
  • Registered: 06-Jun-2013
  • Posts: 551

note to self for future colemak installation

NB acess to a qwerty usb keyboard, keycaps in original locations is critical

0. Get dreymar_x-mod dir from Dropbox or Colemak Forum->Linux Big Bag thread:

https://forum.colemak.com/viewtopic.php?id=1438&p=1

1. Copy dreymar_x-mod dir to ~/Desktop
2. Open terminal
3. cd ~/Desktop/dreymar_x-mod
4. chmod u+x *.sh (NB important step, will fail otherwise)
5. sudo ./install-dreymar-xmod.sh -o
6. edit /etc/default/keyboard to look like this:

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

# XKBMODEL="pc105"
XKBMODEL="pc105awide-sl"
XKBLAYOUT="gb"
XKBVARIANT=""
XKBOPTIONS="misc:extend,lv5:caps_switch_lock,grp:shifts_toggle,compose:menu"

BACKSPACE="guess"

6. reboot machine (NB this is important - will not work otherwise)
7. Select English(Colemak[Ed],Curl-Dbg/Hk ergo) from drobdown top-right or from settings-keyboard

hopefully all will be well by this point..

Last edited by bph (09-May-2016 14:22:05)
Offline
  • 0
  • Reputation: 11
  • Registered: 06-Jun-2013
  • Posts: 551

@dreymar

I think you may have a minor typo here:

[5.2]    XKB CONFIGURATION
...
Editing the /etc/keyboard/default file:

should be:

Editing the /etc/default/keyboard file:

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

Ah, nice catch! :-D Actually, I never wrote that and you must've imagined it. Yep...

If I were you, I'd drop the chmod step and use 'sudo bash' <etc> instead!

But good points. I'll swipe your points and put them in my post. Could be nice with a simple point-by-point for a normal install. Thanks!

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

Offline
  • 0
  • Reputation: 11
  • Registered: 06-Jun-2013
  • Posts: 551

@dreymar I'm pretty sure 'sudo bash' approach doesn't work

the reason being that the install...sh script calls the setxkb.sh script like this ./setxkb.sh

now if the install...sh script called it like this: bash setxkb.sh

then I think all would be well, but it doesn't, so it fails and complains about permissions

I didn't make up that chmod step, I had to do it as it wouldn't work otherwise

possibly its worked for you and others as setxkb.sh happened to have execute permissions

but say you move the dreymar dir around with a usb stick running a FAT file system, all the permissions will auto-default to non-execute

thats what I was doing, hence my permissions issues and the requirement for the chmod call

Last edited by bph (09-May-2016 14:01:26)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

Ah, good call. I'll fix my install script to use bash explicitly. Although another solution is that you don't really have to use the -x switch to activate your layout as you'll be activating it manually later on (and the model through that default keyboard file) anyway.

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

Offline
  • 0
  • Reputation: 11
  • Registered: 06-Jun-2013
  • Posts: 551

ahh right, i can drop the -x option... in which case ./setxkb.sh never gets called

Last edited by bph (09-May-2016 14:22:49)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343
Update 2016-06-16:

Several tweaks and tricks. Shell scripts improved, Curl and Tarmak-Curl improvements, Kyrillic phonetic layouts updated.

See the main Big Bag for XKB topic, and the Tarmak topic.

Last edited by DreymaR (16-Jun-2016 15:08:33)

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

Offline
  • 0
  • Reputation: 11
  • Registered: 06-Jun-2013
  • Posts: 551

invaluable resource - keep up the good work

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

Since we can't make setxkbmap work from a local dir at the moment, system install is now kind of a default. Calling the install script without arguments to the contrary, now defaults to a system (X11 dir) install. The -o switch still works, but isn't necessary right now.

The scripts are colorful now! Now sure how that looks in a non-color terminal, but some writing should still be bold at least.

*** 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: 975

Nice!  Can you please update your github repo with these changes?

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 1
  • Registered: 24-Dec-2012
  • Posts: 20

Hi @DreymaR,

long time without visiting here. I have updated my OS to Ubuntu 16.04, reinstalled your wonderful bag of tricks - I cannot live without them - but I have a weird issue.

My key AE12 does not work - at all! No equal key(!). The cursor just flickers but does not type anything.

It seems to be a problem with the mapping of the key. If I change language (e.g. to spanish) the equal sign does work in its new position, however, the same key does not work , should type !
Other combinations of the AE12 do work, so with shift + AE12 I get +, with altgr + AE12 I get × and with shift+altgr+AE12 I get ÷
So it is not the keyboard. I have a laptop with an external keyboard and both AE12 keys have the same problem, so it is not a hardware issue.
Do you know how can I debug this? I cannot program with a computer without equal sign... :-|
This is a plain install of ubuntu 16.04.

And about this:
> Something seems to break key repetition after a while in Ubuntu?!? Not sure it's my fault but...
How do you fix this?

Thanks a lot.

Last edited by javix (22-Nov-2016 12:08:35)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343
javix said:

My key AE12 does not work - at all! No equal key(!). The cursor just flickers but does not type anything.

[...] If I change language (e.g. to spanish) the equal sign does work in its new position, however, the same key does not work, should type !

Other combinations of the AE12 do work, so with shift + AE12 I get +, with altgr + AE12 I get × and with shift+altgr+AE12 I get ÷

Oh dear, that is strange.

However, with my normal mappings that isn't the AE12 key you'd expect. My Colemak[eD] US (Universal Symbols) has the doubleacute dead key on AltGr and notequal on Shift+AltGr. In the Spanish layout, that key seems to have ¡/¿. So, what've you got then...?

Please let me know your exact settings and other relevant info:
• Keyboard model (are you using Wide/Angle?; if so, does that key work as it should with another non-DreymaR layout?)
• Layout name (Colemak[eD] KS to keep local symbol settings, is that what you're using?)
• What do you mean with "the equal sign does work in its new position, however, the same key does not work"? I don't understand.

If... if you've got the Spanish layout and chose my KS layout, then that key will still give you ¡¿. These, in turn, may not work in the terminal for instance so the cursor might just blink then. I'm just guessing.

I believe in choosing the Spanish/LatAm Colemak[eD] US layout. Then, you'll have my mappings on all keys and lots of nice dead keys and symbols. In this case, the '=' sign should be in the normal AE12 position (depending on Wide mods of course).

Last edited by DreymaR (22-Nov-2016 15:10:00)

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

Offline
  • 0
  • Reputation: 1
  • Registered: 24-Dec-2012
  • Posts: 20

Hi DreymaR,

Thank you for your reply, I'll try to give you more details and explain myself better
- I use standard/default colemak US - AE12 is

key <AE12> { [     equal,       plus,      multiply,         division ] };

So the equal does not work.

Keyboard model (are you using Wide/Angle?; if so, does that key work as it should with another non-DreymaR layout?)

- I use wide angle "pc105angle-lg", but I have tried leaving it at pc105 and 104, same result.
- You are right, in the spanish layout I have ¡/¿ - the ¡ does not work

What do you mean with "the equal sign does work in its new position, however, the same key does not work"?

Sorry. What I meant is that if I change layout (e.g. to Spanish standard) the equal sign is in the AE10, with shift. And there, it works, I get the equal sign.
But the AE12, that in spanish has the ¡ does not work.

I believe in choosing the Spanish/LatAm Colemak[eD] US layout. Then, you'll have my mappings on all keys and lots of nice dead keys and symbols. In this case, the '=' sign should be in the normal AE12 position (depending on Wide mods of course).

Doesn't work either.

Maybe I should undo your patch and try again? What would be the command, if any?

About the key repetition, any idea how to get it back?

Thank you again for your help.

Offline
  • 0
  • Reputation: 1
  • Registered: 24-Dec-2012
  • Posts: 20

Hi again,

I am suspecting something like this is happening: http://superuser.com/questions/129131/d … ork#161489
I.e. that my key has been hijacked by a desktop setting unconsciously. I will try to investigate that possibility.
The output of xev with a working key is

KeyRelease event, serial 40, synthetic NO, window 0x1800001,
    root 0xd6, subw 0x0, time 22837022, (158,-8), root:(158,921),
    state 0x0, keycode 12 (keysym 0x33, 3), same_screen YES,
    XLookupString gives 1 bytes: (33) "3"
    XFilterEvent returns: False

But the output of the nonworking AE12 is

KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys:  4294967254 0   32  0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 40, synthetic NO, window 0x1800001,
    root 0xd6, subw 0x0, time 22838822, (158,-8), root:(158,921),
    state 0x0, keycode 21 (keysym 0x3d, equal), same_screen YES,
    XLookupString gives 1 bytes: (3d) "="
    XFilterEvent returns: False

So there is a keynotify event associated with the key. I will hunt it! I'll let you know if I find it.

Thanks!

Offline
  • 0
  • Reputation: 1
  • Registered: 24-Dec-2012
  • Posts: 20

Ha!

fixed it! I couldn't find the event it was tied to, but I tried to assign = as a shortcut to another action. Then applied, and then unassigned it.

So I got my AE12 to work again! :)

OK, so I am back at work, but, still this key repetition problem. Any idea on why this stops working?

Thanks again and sorry for disturbing with the annoying AE12 isssue!

Best regards

Last edited by javix (28-Nov-2016 01:08:22)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

OK, nice! Xev is a good tool. :-)

The key repetition annoys me too. And I don't know how to fix it, as I _think_ I've set it right for my keys. I suspect it's an error within XKB itself, but not sure how to proceed.

Does repetition work with other 8-level layouts like the Canadian Multilingual? Just a thought.

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

Offline
  • 0
  • Reputation: 1
  • Registered: 24-Dec-2012
  • Posts: 20

Hi DreymaR,

I found that the interferring software was yakuake :( I use it everyday. As soon as I start it, no =. I close it, I get my = again.
Also, I am having issues with F8. This one got fixed assigning the shortcut to whatever and unassigning it again. But, I don't get it back in extended layer + 8.

There are some issues with this ubuntu, for sure. The most annoying one is, due to lack of key repetition, I don't really have alt+tab to switch tasks. I can only switch between two windows, but as the alt does not repeat, I can't get to the rest of the windows...

Does this happen on standard ubuntu, too? I use Kubuntu (with KDE), so maybe switching Destkop engines doesn't fix it, right?

Thanks, regards.

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

No, it's on all Ubuntu flavors I think. Wouldn't surprise me if it's on Debian too, but then again it wouldn't surprise me if it isn't either.

*** 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

I also have a lack of autorepeat on Debian. I noticed that the keys without autorepeat are the ones with a modifier or RedirectKey on the Extend layer. So, I think X disables autorepeat for those keys, since it thinks it is unwanted.

Fortunately, with 'xset r keycode' you can re-enable autorepeat on a key. Then, the key with keycode 'keycode' will autorepeat, but only for the symbols where it makes sense. Since it will only enable autorepeat on symbols for which it makes sense, I don't see a problem with enabling it on all keys. That can be done with this small script:

#!/bin/sh
for keycode in $(seq 8 255)
do
  xset r "$keycode"
done

Or, as one-liner:

seq -s " r " 8 255 | xargs xset r

Also, for switching between more than two windows, do you need autorepeat? Don't you need to hit Tab multiple times while holding down the Alt key? I don't want autorepeat on the Alt key for that...

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

Offline
  • 2
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

Nice, Aldo! :-)

But, I'd like to find something to put in my X11 code to get the keys to autorepeat without having to run any shell commands...

*** 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

I fully agree. The autorepeat behavior should be configurable in a compat file. But when I tried, it didn't seem to work...

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

Offline
  • 0
  • Reputation: 1
  • Registered: 24-Dec-2012
  • Posts: 20

Hey Aldo,

that is great, this fixes it for me!

Also, for switching between more than two windows, do you need autorepeat? Don't you need to hit Tab multiple times while holding down the Alt key? I don't want autorepeat on the Alt key for that...

Normally, I would just keep alt pressed and hit several times "tab" until I get to the window I want. But now it doesn't work. I thought it may have something to do with the autorepeat, but maybe not.
If I would want to test that, what would the keycode for ALT_L be? I have found this http://help.adobe.com/en_US/AS2LCR/Flas … 00520.html but there is no alt.
If I use xev to get the keycode, it says "64". That would imply that it is included in your 8 to 255 sequence.
But still it doesn't work. So maybe it is the window manager.
I can live better without alt-tab than without keyrepetition, so many thanks anyway!

Regards

Offline
  • 0