• You are not logged in.

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

  • Started by DreymaR
  • 371 Replies:
  • Reputation: 2
  • Registered: 25-Oct-2013
  • Posts: 136

Dreymar, you are right ! I'm sorry, I'm so used to go to the Linux side of this topic.... I'll check at the "dark side" ;-) Thanks.

Offline
  • 0
  • Reputation: 2
  • Registered: 25-Oct-2013
  • Posts: 136

OK, I managed to get the pkl working.... based on a modified other layout. Works, with some quirks, and slower then the 'native' linux xkb solution.  I ll post at the Windows thread.

Offline
  • 0
  • Reputation: 0
  • Registered: 05-Dec-2014
  • Posts: 6

First of all, thank you very much for sharing this project DreymaR.
Tough I'm not using the Colemak Layout, I am really curious about your extended navigation layout.

I am using the German layout on Ubuntu 14.04 and here I don't have the possibility to add options via GUI. So I added the extend layout with the following command:

setxkbmap -model pc105 -layout de -variant nodeadkeys -option lv5:caps_switch_lock,misc:extend

I was really impressed, that everything seemed to work fine, since I was fiddeling around with xmodmap to make something similar for some time lately.

Your work is really nice, but there are still a few issures for me:

  • How can I reenable the Caps_Lock key, or customize it? I would like to map it to sth like extend+control_r

  • When the extend key and ctrl (the iso5 one) is pressed together and hold for a second (without any other key), there is also send the letter on which is the ctrl key on, when releasing the key again. This doesn't happen with the other iso5 modifier keys like alt and shift.

  • Setting this keyboard layout disables my virtual consoles (tty's) on Ubuntu, did you also notice this behaviour? I'm sure they're running in the background but I cannot access them. Neither with your extended mods, nor with the 'normal' shortcuts ctrl+alt+f1-6. Can this be solved?

Thanks for your work again!

Last edited by uloco (05-Dec-2014 14:37:26)
Offline
  • 0
  • Reputation: 187
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,259

Thanks for the praise! :)

The 'lv5:caps_switch_lock' option sets the Caps key to be a level5 switch; that's like a second AltGr dimension where the Extend mappings are. The 'misc:extend' option maps useful key presses to the level5–8 mappings.

I haven't seen the behavior you describe with the mapped Ctrl key, nor the virtual consoles. I'm not that used to calling tty's I'm afraid, but the issue may be that you're used to having lv5 mappings that call the server control XF86 keys: These are often mapped to Ctrl+Alt+F#. Since my Extend mappings make the F# keys into multimedia keys there may be a conflict. Either set whatever calls your server key mappings again (they're in the symbols component "srvr_ctrl(xfree86)" but this isn't in the rules file now?) after the extend mappings have been invoked, or comment out the F key lines in symbols/extend. Your multimedia F keys should then be gone and your tty F keys back; and you should be able to use the tty keys with Caps+F#. Finally, if you're feeling brave you could have the terminal keys on Caps+AltGr by adding the actions for it to the extend file but that's tricky (the action that switches to tty 1 is 'SwitchScreen(Screen=1, !SameServer)', it seems).

You can select another lv5 chooser than the Caps key; see the options for level5 switches in the keyboard settings.

To customize the Extend mappings, you'll have to edit the symbols/extend file but be warned that it is *not* a pretty file!

What I'm missing is key repeat, as Extend seems to break that. Not sure what to do.

Last edited by DreymaR (05-Dec-2014 15:09:35)

*** 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: 05-Dec-2014
  • Posts: 6

Thank you for your quick response!

I managed to get the ttys working again by disabling your media key mappings on the function row, as you supposed.

Still, I don't recognize how to enable Caps_Lock with leaving the key as extend.
I found this snippet here in the extend file, but nothing of it works for me. How is this supposed to act?

    key <SCLK> { symbols[Group1]=[ NoSymbol , NoSymbol , NoSymbol , NoSymbol ,
                   Caps_Lock            , Caps_Lock             , // CapsLock
                   Caps_Lock            , Caps_Lock            ], // CapsLock
                 actions[Group1]=[NoAction(),NoAction(),NoAction(),NoAction(),
                   SetMods(mods=Lock)   , SetMods(mods=Lock)    , // Lock mod for <CAPS>
                   NoAction()           , NoAction()           ]
               };  // ScrollLock

If I test this with xev, my keysym output is as follows:

  • When I press <SCLK>, I get Scroll_Lock

  • When I press <Shift>+<SCLK>, I get NoSymbol

  • When I press <Extend>+<SCLK>, I get Caps_Lock

Though this sounds as it should work, it doesn't :((

my xmodmap output is this here:

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Scroll_Lock (0x4e)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Meta_L (0xcd)
mod2        Num_Lock (0x4d),  BadKey (0xcf)
mod3        ISO_Level5_Shift (0xcb)
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce)
mod5        ISO_Level3_Shift (0x5c)

Hope you have some suggestions, xkb conig files really confuse me... :P

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

The right way to enable and disable the CapsLock state using my mappings is Extend+Esc, but in Linux there was a problem with that so I made ScrollLock with Extend a CapsLock key too. As you say, Extend+SCLK should change the CapsLock state. It did for me, the last time I checked. I may look into it if I have time. This is annoying, for sure.

*** 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: 05-Dec-2014
  • Posts: 6

I finally managed to solve my problems with caps lock with sort of a workaround.

I simply disabled your capslock solution completely and remapped it with dconf-editors option 'shift:both_capslock'
There was also a problem with your caps lock solution, that the number row wouldn't behave like before.
Usually caps lock does only trigger on the alpha keys in Ubuntu, not on the numbers and signs (at least for the german language).

Here is the guide for everyone who has similar problems, I'm on Ubuntu 14.04:

  • First, I completely commented out the code section I mentioned above with scroll lock in the extend file.

    // key <SCLK> { symbols[Group1]=[ NoSymbol , NoSymbol , NoSymbol , NoSymbol ,
    //                Caps_Lock            , Caps_Lock             , // CapsLock
    //                Caps_Lock            , Caps_Lock            ], // CapsLock
    //              actions[Group1]=[NoAction(),NoAction(),NoAction(),NoAction(),
    //                SetMods(mods=Lock)   , SetMods(mods=Lock)    , // Lock mod for <CAPS>
    //                NoAction()           , NoAction()           ]
    //            };  // ScrollLock
  • A few lines above, I commented out the line with EIGHT_LEVEL_SEMIALPHABETIC and uncommented your line above this one witch says 'EIGHT_LEVEL'

    key.type[group1]="EIGHT_LEVEL"; // Lock not used
    // key.type[group1]="EIGHT_LEVEL_SEMIALPHABETIC"; // Lock affects lv1/5 but not lv3/7 - a bit inflexible but OK I guess
  • And finally I changed my configuration in dconf-editor to reenable caps lock with pressing Shift_L and Shift_R simultanously.
    For this, you have to navigate to the path 'org > gnome > desktop > input-sources' and insert the following line in xkb-options

    ['lv5:caps_switch_lock', 'misc:extend', 'shift:both_capslock']

After going through this steps, everything works like before again + the extended functionality.


Furthermore, I recognized the problems with control and the f key only happen when I'm working in a virtual machine. Must be something with that, though it is really weird...

I already fell in love with this extended functionality. Thanks again for making this possible. I'll spread the word ;)

Last edited by uloco (10-Dec-2014 14:20:46)
Offline
  • 0
  • Reputation: 187
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,259

The edits in my files should not be necessary:
• The SCLK lines only map that key with Extend to send a Lock key action. As long as you don't press ScrollLock it doesn't to anything.
• The EIGHT_LEVEL vs EIGHT_LEVEL_SEMIALPHABETIC lines affect how keys are affected by the Lock status: Alphabetic keys are shifted by Caps, whereas other keys are like the number keys in that the Lock state doesn't affect them (e.g., you don't get '#' from the '3' key when CapsLock is on). You probably didn't want that change you made.
• The "shift:both_capslock" option can be selected independently from the others, through GUI, setxkbmap or as you did, dconf-editor

*** 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: 05-Apr-2011
  • Posts: 6

Saw some github discussion on the main page, but never a link.

Is this the main repo? Is it being updated?
https://github.com/DreymaR/xkb-mod_2-5-1-3

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

No, the main "repo" is the dropbox link in the main post. It's just been updated. I started establishing a proper github repo but haven't yet gotten it done. Sorry.

*** 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: 05-Dec-2014
  • Posts: 6

Is there any possibility to use the extend layer inside the TTY virtual console, too??

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

You know, uloco, that's a very good question. And I'm out of my woods.

The thing is, the console uses kbd and not xkb – which is what I've used for all my stuff. There's a bunch of compiled layouts in a .gz file so changing the xkb setup won't affect the console layouts because they're in a different place altogether, from what I gather. However, the command ckbcomp can compile an xkb setup for use with kbd through the loadkeys command.

http://manpages.ubuntu.com/manpages/uto … omp.1.html

That's about how far I've managed to read up on this. I don't use the tty consoles much myself, so I haven't really given this much thought before (or when I did, I got all confused).

*** 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: 05-Apr-2011
  • Posts: 6
DreymaR said:

No, the main "repo" is the dropbox link in the main post. It's just been updated. I started establishing a proper github repo but haven't yet gotten it done. Sorry.

Ah, ok. I really recommend github and their "releases" feature, which allows you to easily tag and release an easily downloadable .zip of the project. Would also let others follow along and/or contribute to development.

Offline
  • 0
  • Reputation: 10
  • Registered: 06-Jun-2013
  • Posts: 535

hi dreymar

just attempting to install the latest linux xkb stuff via your install script

it all looks pretty comprehensive with many options but it is not very clear what i have to actually do

the thing with it is that you want to be sure you are doing the right thing as mistakes are costly when it comes to xkb

i think a solid improvement would be to give some examples of running the install script from the cmd line in the 'install' section of the forum thread

i.e. show what cmd line args you use for several of the obvious use cases.

reading the README or running with -? option is not that helpful when it comes to the question of what args should i actually be using

the most obvious use case is someone wants to overwrite /usr/share/X11/xkb with your stuff whilst keeping a backup of the old xkb dir

how do you do that? is it -o or -o yes and what is the -t option all about? its not the sort of thing where you want to just try stuff out and see what happens

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

If the script is as good as I think it is, in this case experimenting should actually be quite safe. :-)

But yes, at this point your experience is very valuable as it may help us improve on the clarity of the product. Thanks for chiming in!

You're right, some examples are needed. I'm just reworking parts of the Big Bag text (locales, Curl mods!) so here's one more TODO for me then. I think the examples need to be in the actual file documentation because not everyone will be reading the BBoT while trying this.

The '-d' and '-t' options are only used if your mod dir has an odd path/name. If you're using my files as they came, you won't need to set those.

Install script usage example: Local install
    • Install in the default location (safe, under your home directory, but inaccessible to the GUI)
    • Run setxkbmap automatically, activating the French "Universal Symbols" Colemak[eD] layout
    • Furthermore, activate the WideAngle ISO board model ('pc105awide-sl')
    • For activating a single layout and model, we use a 'model locale eD-variant' shortstring with '-s <str>'
    • Since no system files are affected, force no backup with '-n'

$> ./install-dreymar-xmod.sh -s '5w fr us' -n
...or for instance...
$> bash install-dreymar-xmod.sh -ns '5w fr us'

Install script usage example: System install
    • Install to the system X11/xkb directory with '-o' (changes will show up in the system settings GUI)
    • (You may need to know your sudo password, but don't have to run the script as sudo)
    • Just activate the default layout ('5w us us') with '-x'; necessary to get AngleWide as models aren't GUI selectable
    • (A backup of the xkb dir will automatically be made if none is found in the system X11 dir; to force a fresh one use '-b')

$> ./install-dreymar-xmod.sh -ox

Install script usage example: Restore
    • Restore the oldest backup with '-r 1'
    • (To get a newer one, use a higher number; may well be too high if you wish to ensure the latest backup)

$> ./install-dreymar-xmod.sh -r 1

Is that good?

Last edited by DreymaR (16-Jan-2015 14:23:15)

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

Offline
  • 0
  • Reputation: 10
  • Registered: 06-Jun-2013
  • Posts: 535

hey dreymar, yes thats the sort of thing that would make the installation section a bit easier to follow

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

Update:

New Generic pc104/ANSI keyboard models available for the ergo modder!
pc104angle-z: As before, the Angle(Z) mod moves the Z into the old B position to fix XCVB
pc104wide-qu: The Wide(Quote) mod is as before
pc104awide-zqu: The combination of the two mods above to the Angle(Z)Wide(Quote) mod
pc104aframe: Instead of going Wide, this achieves the Angle mod without sacrificing the Z

    Cmk-ANSI-AFrame_60d-Tinted.png
    The AngleFrame ergo mod

(The pc105/ISO models are as before)

Last edited by DreymaR (18-Jan-2015 22:15:06)

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

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

Finli, are you real though?

New images of the AngleWide mods with fingering are to be found in the main post. :-)

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

Offline
  • 0
  • Reputation: 115
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 961

I wonder if there is a case for putting apostrophe to the left of the A. It's a reasonably nice location by non-alphabetic key standards, so perhaps a more common punctuation should be there? That does split up the two square brackets though, unless you have the both directly above the return key and then have ' and \ on the left. I guess anyone adopting that layout may well customize it to their taste anyway.

DreymaR said:

Finli, are you real though?

I'm guessing not !

Using Colemak-DH with Seniply.

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

I'm a fan of keeping the brackets next to each other, having tried out a couple of variants that didn't. Also, the apostrophe is one of the most common symbols so I'd like to keep it on the same finger at least. In favor of your proposal, I've found that mirroring works well so the left pinky taking over for the right one in a perfectly mirrored setup might work. Also, one bracket on each "wing tip" as it were, would look cool. :-)

But yes, people will have to work on that themselves. I've provided an AngleFrame mod despite a low demand for it – I've no intentions of making further variants just for making them and so leave any further research in that field to the users.

Awright, two new layouts added to xkb as promised:

  cmk_ed_dvbghm   us: English (Colemak[eD], Curl-Dvbg/Hm ergo)
  cmk_ed_dbghk    us: English (Colemak[eD], Curl-Dbg/Hk ergo)

That is, you can now activate for instance us(cmk_ed_dvbghm) without editing any symbols files beforehand. Yay!

Locale users will still have to edit the xkb/symbols/colemak file I'm afraid, can't be helped.

Last edited by DreymaR (19-Jan-2015 23:20:19)

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

Offline
  • 0
  • Reputation: 10
  • Registered: 06-Jun-2013
  • Posts: 535

install bit script examples are a big improvement

on the curl section i would be equally explicit in your instructions

maybe highlight the symbols filename in bold or make it courier or something to show that its a file name that you have to modify

make the point that if its in the /usr/share type location you'll need root access to modify it

actually explicitly show the 'from' -> 'to' for the text changes you have to make to that file using that nice black box format

as with all documentation, the golden rule is that explanations are generally not that useful, examples and snippets are generally massively useful

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

Thanks for the feedback, again!

I hear you, examples and snippets are great. But I thought too many snippets would clutter up the post badly. I included one under the Curl-mod section, but I won't add one for Tarmak2 for instance as people can just look in the file and it's not going to be a common request I guess.

Looking clearer now? :-)

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

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

Main topic update: I added my MessagEase mappings! They're neither XKB(Linux) nor PKL(Windows) but they're a useful and important part of my Big Bag Of Keyboard Tricks nevertheless! And these days I type quite a lot on the phone so I want the public to know how it's done. ;-)

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

Offline
  • 0
  • Reputation: 115
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 961

Hi @DreymaR..... Guess what - I have been using my linux box a bit more lately, and therefore have been looking at the xkb version of your big bag of tricks! Hope you don't mind, I have some suggestions, feedback questions, etc for you :-P
Here goes...

1. I am setting the mapping using setxkb.sh but I notice that if I unplug/replug in the keyboard, or sometimes even *any* usb device, the OS seems to take the opportunity to reset the keyboard back to defualt one as shown in the UI. I still don't get the correct thing if I use the UI tool to select the keyboard (not sure whether that's *supposed* to work these days), so I am avoiding doing it that way, but nevertheless the OS seems to like to revert it automatically. Rerunning the setxkb.sh from the terminal always fixes it, but it would be nice it it never went wrong in the first place!

2. I am noticing that the mouse control keys on the extend layer are not working (usually) for me. That means the pointer movement and mouse clicks. Not a major issue but I wonder why, as other extend mappings work fine. I say "usually" because I did manage to see it working briefly at one point. Seems very temperamental for me at least.

Update: OK, silly me, I realized the reason for point 2 - there is a mouse keys on/off button that I must have accidentally pressed at some point!!

3. The extend mapping for paste doesn't work with "dvbg" mod enabled! That's because in the extend file, Extend-V is remapped to AB04, but V is now actually AB05 in this case.

4. Another minor point with the "hm" curl mod config in the main colemak file - it redefines the n key unnecessarily.

5. For the wide-angle config, on my keyboard I have the 6 on the right hand side but in the default pc105awide-sl configuration, it's on the left. I have modified the pc105awide-sl definition config to cope with this. Ideally I would put in a new config - based on pc105awide-sl - that I could select instead without affecting the default config. But I couldn't get the system to recognise any new entries in the evdev file so I had to modify the existing pc105awide-sl instead. Ho hum.

6. I also wanted to set up my mappings for "Shift on AltGr" and "AltGr on RWin". I have done this the following way:
(i) in level3 file I have a new definition
partial modifier_keys
xkb_symbols "rwin_switch" {
  key <RWIN> {
    type[Group1]="ONE_LEVEL",
    symbols[Group1] = [ ISO_Level3_Shift ]
  };
  include "level3(modifier_mapping)"
};
This nicely lets RWin be the level3 key.
(ii) in evdev, replaced <RALT> = 108 with <RTSH> = 108. I suspect that's not be the best way though. I was thinking a better way would be to have an additional bit of config that could optionally be selected rather overriding the existing keycode mappings, but couldn't figure that out. Don't know if you'd have any recommendations on that?

Otherwise quite pleased with all the hackery - everything works pretty much as I want :)

(Using Ubuntu 14.04)

Cheers
Steve

Last edited by stevep99 (10-Apr-2015 17:12:15)

Using Colemak-DH with Seniply.

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

Thanks for the feedback!

1) The GUI is supposed to be working, and did so last time I tested it in Ubuntu. Depends on your install options though – did you install with the -o switch?

2) Yes, as you noticed the Mouse Keys can be turned on and off in Linux so I added the switch for that.

3) The Extend mappings are by position more than by key name. I realize that this seems odd using your Curl(Dvbg) variant, so feel free to do a little Extend remappery yourself.

4) No, the 'N' key mapping isn't unnecessary in my opinion! I added the reason for it in the comments: A Vim-like line of Arrow symbols (instead of the default cross). Pretty, n'est-ce-pas?!?

5) Adding new entries takes a bit of practice. You'd have to alter evdev, the xml and list files in the rules component (and the base ones for other distros). You found the easy solution though.
    I chose to split between 6 and 7 as that's most often the case with split ergonomic keyboards. The right hand has the plus/minus keys too which are quite common, so it's more fair too.

6) Your keycodes/evdev solution is the most robust way of remapping the "hardware" key. To go with that, you could also just remap the RWin code.

Glad the hackery is useful! :-)

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

Offline
  • 0