• You are not logged in.

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

  • Started by DreymaR
  • 317 Replies:
  • Reputation: 0
  • Registered: 28-Apr-2019
  • Posts: 4

@DreymaR Ok, I solved it all by removing the actions of my custom keys in xkb/symbols/extend (replacing them by NoAction()).

Offline
  • 0
  • Reputation: 114
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,742

Well, in that case I guess you could've just commented out those keys altogether? But it's nice that you got it to work, grats with that!

*** 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: 14-Jun-2019
  • Posts: 1

Hi everyone, I've read through the instructions and I'm lost with the combination for setting my preferred colemak layout, can someone post a setxkbmap command for it? I'd really appericate it! mod_dh_keyb_ansi_wide.png

Offline
  • 0
  • Reputation: 114
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,742
shay said:

I've read through the instructions and I'm lost with the combination for setting my preferred colemak layout...

Hi! What you have there is an ANSI-CurlAngle(Z)Wide(/) Colemak, but with SteveP's preferred placement of 6 vs =. In my opinion using the right hand on the 6 key is wrong for standard row-staggered boards since the distance from the home position is greater for the right hand and the physical middle of the board is between the 6 and 7 keys so to speak. So I haven't implemented the 6-to-the-right Wide option everywhere.

$> ./setxkb.sh 4cw

This command activates my version of ANSI-CAW[eD]. See the setxkb help text to make it permanent by adding a line to your ~/.bashrc file. If you want the swapped 6 and = keys you may edit the symbols/colemak file to achieve this by swapping the key codes for those keys (it'll affect all Colemak[eD] layouts but that may be okay?). Look around in there and see if you can figure out how.

*** 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: 19-Sep-2019
  • Posts: 2

Hi,

thanks for the extend layer. Getting all those editor-independent movement keys at my fingertips is awesome.

I let install-dreymar-xmod.sh patch the xkb files and set the default layouts and options from /etc/default/keyboard like

XKBMODEL="pc105"
XKBLAYOUT="us,us,de"
XKBVARIANT="colemak,basic,basic"
XKBOPTIONS="terminate:ctrl_alt_bksp,grp:sclk_toggle,grep_led:caps,misc:extend,lv5:caps_switch_lock"

I have two annoying problems, that I don't know how to tackle:

1. My Fn keys below F8 do not work as soon as I add the misc:extend option.
   (Same for CAPS-1..7, only CAPS-8..0 generate F8..F10 keypresses)?

2. Keyboard repeat seems to be disabled for most keys (independent of whether the extend option is there or not, only dependent on whether patches are applied).

    xset reports some sort of a mask?

   

 $ xset q
[...]
auto repeating keys:  0001c000100000a0
                      0080ff6ffeedffff
                      9fffffffffffffff
                      ff77ffffffffffff
[...]

I am a bit at a loss on how to debug that. I suppose commenting out the multimedia keys in your config works towards 1, but I am at a loss for 2.

Offline
  • 0
  • Reputation: 114
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,742

Glad you enjoy it! Unfortunately, I'm not sure about the repeat thing, it puzzles me as well. I think it may be about key types but that's as far as I got. Yeah, that mask is certainly interesting.

Really not sure why my files should bork only F1–F7 for you either. That makes no sense to me. Sorry.

Last edited by DreymaR (19-Sep-2019 15:15:11)

*** 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: 19-Sep-2019
  • Posts: 2

As an additional data point worth noting, I found that the generated xkb layout by klfc does NOT affect the key repeat! And the CAPS-1..7 keys do produce F1..7, which is good enough for me for the time being.

The regular F1..7 don't work either. Probably some interference with the multimedia keys of this Thinkpad.

Last edited by coroa (19-Sep-2019 15:24:39)
Offline
  • 0
  • Reputation: 0
  • Registered: 02-Jul-2017
  • Posts: 3

Hey there Dreymar, thanks again for this great tool, been using it for long time already but on Windows. I switched to Linux and I wanted to use it differently here. My config right now is:

./setxkb.sh 5c us us

and I want to use the extend key on the LAlt key place, and have the LAlt mapped to CapsLock. Before applying your script, I successfully swap the behaviour of those keys via editing /usr/share/X11/xkb/keycodes/evdev , but after using the install-dreymar-xmod.sh script that no longer works, so I'm a bit stucked over here...  Please help me, what files do I need to manually edit in order to do that, and what else do I have to do to make this changes permanently for my user? Cheers! Thank you so much again.

Last edited by crisgon (11-Nov-2019 03:02:27)
Offline
  • 0
  • Reputation: 114
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,742

I guess my files just overwrote your changed evdev file? Have you checked it after installing the BigBag? Your change should affect the PC105 model, make sure it does that. Keycodes is a good place to swap "hard" key behavior.

My CurlAngleWide mods are implemented as keyboard models (like PC104/ANSI and PC05/ISO) but these inherit from the basic ANSI/ISO models so if your change is done to those it should come through just fine.

If you use a US layout, are you sure you're on an ISO board? If you're on an ANSI keyboard you probably don't want the 5c but 4c model?

To make the changes permanent, there's an option in setxkb.sh to write the setxkbmap command string to your ~/.bashrc file. If you use another logon file, copy the line to that.

Last edited by DreymaR (12-Nov-2019 12:24:15)

*** 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: 02-Jul-2017
  • Posts: 3

Hey again Dreymar, thanks for your reply. Yes, I have an ISO Latin American Keyboard, so 105 fits me. I was using your script without any hassle yesterday, however when I went to turn on my computer, Linux wont boot, it stays frozen after loading modules (I'm not sure exactly what it does when boots up), says:

bluetooth hci0 failed to send firmware data (-110)

I tried to find solutions on the internet but couldn't find anything similar. I don't use bluetooth but it wasn't giving me errors either. This was after applying your scripts, I can confirm this behaviour because I have used ElementaryOS and Ubuntu before (now I'm using Pop! OS) and got the same errors after rebooting the system. I thought this was because of my battery draining down to zero after having it suspended, but today I just confirmed that is this script that is making my laptop not to boot.

Do you have any idea what could be causing this issue? I really want to use the extend key and colemak itself, but I dont want to use Windows again.

PS: I wrote you on Discord.

UPDATE: After reinstalling Pop! OS and successfully logging in, I tried and run install-dreymar-xmod.sh -ox, set the layout to 5c us us, rebooted and again getting the same error. Meanwhile I found an xmodmap that maps keys to the desired but no Extend super powers for me. I'd really appreciate your help.

Last edited by crisgon (12-Nov-2019 22:57:02)
Offline
  • 0
  • Reputation: 114
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,742

Well, that's just weird. My script doesn't do anything to any bluetooth stuff. Have you run the script with normal admin rights? It should ask for a sudo password. If any of the X11 files change ownership you could get trouble.

*** 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: 25-Jan-2020
  • Posts: 7

Thank you very much for your wonderful work. How can I change the layout toggle key from capslock to space like touchcursor under Windows, and use capslock for backspace? Thank you for your time.

Last edited by makdhfan (25-Jan-2020 21:10:38)
Offline
  • 0
  • Reputation: 114
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,742

I don't know what 'touchcursor under Windows' is, but I haven't got a way to make a key dual-function if that's what you're getting at. I'd suggest swapping LAlt and Caps instead, which can be done in the keycodes component.

However, why would you want the Caps key to be a primitive Backspace when it can be a glorious Extend key instead?  /(⁎≧∇≦)\

*** 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: 25-Jan-2020
  • Posts: 7
DreymaR said:

I don't know what 'touchcursor under Windows' is, but I haven't got a way to make a key dual-function if that's what you're getting at. I'd suggest swapping LAlt and Caps instead, which can be done in the keycodes component.

However, why would you want the Caps key to be a primitive Backspace when it can be a glorious Extend key instead?  /(⁎≧∇≦)\

Thank you. It's mostly a habit thing from original colemak. Plus, with capslock mapped to backspace, I can concentrate a lot of editing shortcuts to my left hand area on the keyboard. And my right hand would use the mouse. Also, It's very cold where I live so having only one hand out is ideal sometimes. :)

My extend key was "space down" in Windows, and space would be "space down and then up without key presses in between". Touchcursor is a program in Windows that does this for me.

Could you please tell me more on how to change capslock to backspace with your xkb files? I couldn't figure out which files to edit. Thank you.

Offline
  • 0
  • Reputation: 114
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,742

For Linux, you don't have to edit anything. The function of the Caps key is a separate xkb "-option" setting. If you don't have it in your keyboard settings GUI then setxkbmap can be used. It's the caps:#### stuff, as here taken from rules/evdev.lst:

Spoiler:

caps                 Caps Lock behavior
  caps:internal        Caps Lock uses internal capitalization; Shift "pauses" Caps Lock
  caps:internal_nocancel Caps Lock uses internal capitalization; Shift does not affect Caps Lock
  caps:shift           Caps Lock acts as Shift with locking; Shift "pauses" Caps Lock
  caps:shift_nocancel  Caps Lock acts as Shift with locking; Shift does not affect Caps Lock
  caps:capslock        Caps Lock toggles normal capitalization of alphabetic characters
  caps:shiftlock       Caps Lock toggles ShiftLock (affects all keys)
  caps:swapescape      Swap ESC and Caps Lock
  caps:escape          Make Caps Lock an additional Esc
  caps:backspace       Make Caps Lock an additional Backspace
  caps:super           Make Caps Lock an additional Super
  caps:hyper           Make Caps Lock an additional Hyper
  caps:menu            Make Caps Lock an additional Menu key
  caps:numlock         Make Caps Lock an additional Num Lock
  caps:ctrl_modifier   Caps Lock is also a Ctrl
  caps:none            Caps Lock is disabled

Unfortunately, some of the Colemak XKB layout implementations hard code Caps key behavior instead of playing by these rules.

Last edited by DreymaR (27-Jan-2020 12:46:18)

*** 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: 25-Jan-2020
  • Posts: 7
DreymaR said:

For Linux, you don't have to edit anything. The function of the Caps key is a separate xkb "-option" setting. If you don't have it in your keyboard settings GUI then setxkbmap can be used. It's the caps:#### stuff, as here taken from rules/evdev.lst:

Spoiler:

caps                 Caps Lock behavior
  caps:internal        Caps Lock uses internal capitalization; Shift "pauses" Caps Lock
  caps:internal_nocancel Caps Lock uses internal capitalization; Shift does not affect Caps Lock
  caps:shift           Caps Lock acts as Shift with locking; Shift "pauses" Caps Lock
  caps:shift_nocancel  Caps Lock acts as Shift with locking; Shift does not affect Caps Lock
  caps:capslock        Caps Lock toggles normal capitalization of alphabetic characters
  caps:shiftlock       Caps Lock toggles ShiftLock (affects all keys)
  caps:swapescape      Swap ESC and Caps Lock
  caps:escape          Make Caps Lock an additional Esc
  caps:backspace       Make Caps Lock an additional Backspace
  caps:super           Make Caps Lock an additional Super
  caps:hyper           Make Caps Lock an additional Hyper
  caps:menu            Make Caps Lock an additional Menu key
  caps:numlock         Make Caps Lock an additional Num Lock
  caps:ctrl_modifier   Caps Lock is also a Ctrl
  caps:none            Caps Lock is disabled

Unfortunately, some of the Colemak XKB layout implementations hard code Caps key behavior instead of playing by these rules.

I'll definitely try this the next time I work with a physical Linux machine. Thank you so much for taking the time to educate me. You cannot believe how grateful I am. Thank you.

Offline
  • 0
  • Reputation: 0
  • Registered: 08-Feb-2020
  • Posts: 1

Massive thanks to DreymaR for this great big bag of keyboard tricks!

I'm trying to bind keys to "copy" and "paste". I've gotten some clues from the guide to XKB and reading evdev. However, I don't know how to bind one key to ctrl+c down & up. Any ideas?

I'm using "pc104curl-z" on Cinnamon.

Offline
  • 0
  • Reputation: 114
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,742

Look in my /symbols/extend file, there are a lot of working bindings. Of course, I'd just recommend using Extend Copy/Paste...  ¯\_(ツ)_/¯

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

Offline
  • 0