• You are not logged in.

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

  • Started by DreymaR
  • 283 Replies:
  • Reputation: 1
  • Registered: 13-Nov-2018
  • Posts: 6

I found this forum when I attempted to search for how to change xkb's Level4 to CapsLock. I even wrote a post asking this question. But eventually I decided to just use DreymaR's Extend (with Qwerty).

In this post I will tell you my experience of 1.5 month of using Extend and issues I encountered. The post will be quite long, but all the details are relevant (either to my case or for the future - lest people struggle like me).


I use PC105 keyboard with two layouts: fin (with a few modifications of mine) and rus_fin (Phonetic Russian alphabet with Finnish layout; layout I created myself a long time ago).


Stage 1.
Since I made my own modifications to xkb, I installed all the necessary files manually. All important keys worked, as far as I could see - arrow keys and all the mouse commands. The only problem was that my system (Linux Mint 19 Cinnamon) was crashing. At least the visual part of it - programs seemed to continue to work fine in the background.

Even after restarting, the system was broken. Thanks God Linux Mint has a Timeshift program now and I could lose a lot of time, but just restore the working system!

Those crashes were directly related to Extend, but in an extremely weird way:
- Extend is disabled in Mint's graphical keyboard setting. Enabling it crashes the whole system.
- Extend is enabled in Mint's graphical keyboard setting. Disabling it works fine. Enabling it after also works totally fine!
- Running a terminal command enabling Extend (

setxkbmap -model pc105 -layout fi,ru -variant classic,rus_fin -option "grp_led:scroll,grp:alt_shift_toggle,terminate:ctrl_alt_bksp,lv5:caps_switch_lock,misc:extend"

) works fine.

Therefore every time I rebooted my system, I had to make sure that:
1. Extend was enabled from the start (if it wasn't - enabling would always crash the whole system)
2. Go to settings and both disable and enable it again.

Not a big deal and definitely worth the hassle, but I would prefer to have something totally automatic. While trying to figure out how to do it, I got a suspicion about HD errors.


Stage 2.
I went and checked my disks for errors. It did indeed found some and fixed them.

Yay! Now my system doesn't crash when enabling Extend!

But my next worry became that some of the keys suddenly stopped working. For example all the keys related to Mouse (be it movement, clicks or mouse wheels). They simply didn't work.

At this point I also noticed a problem with non-working key repeats: sometimes the system would go in a continuous key-repeats-disabled state in which pressing a key would give only one character. Interestingly Backspace's key repeats worked fine. In order to get my key repeats back I had to go to settings and disable/enable Extend ('terminally' speaking not "lv5:caps_switch_lock", but simple "misc:extend"). After that it worked for some time again.

I am pretty sure that I encountered this issue in the previous stage as well, but can't be 100%.


Stage 3.
I was in Stage2 for several weeks having a blast with Extend, getting more experience I could report. One day I decided to finally write and send the report in. But during the exact same day mouse commands started working again! I didn't do anything to fix it, I don't think I updated a system, I am pretty sure that I didn't reboot the system, I am not even sure that I hibernated the system! I feel like it didn't work at one point and then, without me doing anything out of ordinary, it suddenly started working!

That was a total surprise!

I have been in Stage3 for several weeks now - having more experience with Extend and waiting if half of the buttons would stop working again. But mouse commands are still working. I hope this is the status that will continue and not end abruptly like it started.

Everything is working quite well and generally speaking I am very satisfied and would not go back. But I had or still have some issues that bug me:
1. Terminal does something weird while trying to e.g. delete previous work with Ctrl+Backspace (or Ctrl+Delete to delete the following word). Fortunately, this is a a common problem with a solution. Just google "zsh ctrl+backspace" or "bash ctrl+backspace".
2. The upper row that is supposed to work with Ext+Shift+Fnumber-Key is not working. The buttons work fine without Shift.
3. Some other keys also seem not to be working: Ext+Enter. Ext+Backspace - I either don't understand the function of this key (so why does it exist and why did you put it in such a visible place?) or it doesn't work.
4. There is a major issue with Esc. Obviously, there are 4 types of Esc (fin-Normal, fin-Extend, rus-Normal, rus-Extend).
4a) fin-Normal is the only one that works properly (at least I think so; in some programs Esc key doesn't do what I would assume it should, but this is probably just bad programming/UI/design skill of the developers - this is Linux... :shrugging shoulders: ).
4b) fin-Extend, rus-Normal, rus-Extend.
- Works: in Libreoffice..
- Doesn't work: Firefox, calculator, Telegram Desktop, SMPlayer, Nemo (file browser), SpaceFM (file browser), System Monitor, Steam, QBittorrent, Clementine (music player), GParted, SublimeText3, Start Menu...

You can see a trend here where:
- the only thing that works is the proper Esc key in fin-layout.
- the only program where Esc works in every layout is LibreOffice.

I don't expect all the Extend keys to work - after all, at least half of the keys (related to mouse) didn't work and I was ok with that. So I can live with Extend's Esc not working.

But what bothers me is the fact that a proper physical Esc key is not working in rus-layout if Extend is enabled. If Extend is disabled, physical Esc key in rus-layout starts working again. Enable Extend => stops working again. So a clear Extend-related issue. Really damn irritating to have been writing something in Russian and not having the Esc key functionality (have to either grab the mouse or switch to Fin layout, press Esc there and switch back to Rus layout again!).


And what makes it super-weird is that LibreOffice (6.0.7.3) is the only program that works with all 4 Escs. How and why does it manage to work if every other program refuses to work with the 3/4 of Escs - I don't even... If the keys wouldn't consistently work everywhere, at least it would have been logical...

5. Issue with non-working key repeats still continues. Every once in a while I have to go to the settings to disable and enable Extend to get key repeats working again. This issue doesn't seem to be related to time (how long computer has been on), but to reboot/hibernate cycles.

Here is a little testing I did consequently with hibernate:
- Reset. 5 hibernates. Not working, have to reset.
- 5 hibernates. Not working, have to reset.
- 2 hibernates. Not working, have to reset.
- 2 hibernates. Not working, have to reset.
- 3 hibernates. Working, but I try to test and decide to reset keyboard. 7 hibernates. Not working, have to reset.

6. Shift+Space. It works, but doesn't repeat (even if all other key are repeating fine). This is very unfortunate, because in a browser I use Space as DownPage and Shift+Space as UpPage (a very convenient shortcut few people know about!). If I disable Extend, Shift+Space starts repeating again.


(While writing this post) Stage4.
While writing this report, I was obviously testing and re-testing to make sure that I know what I am doing, that I have solid facts and that I won't report (too much) garbage. And while testing different Extend buttons, my mouse stopped working again! I was like "Is this for real?! What are the chances?!".

As you can already guess, it was all my fault - I was triggering the strange-looking Circle button (to the right from the Left Shift), which turned out to be the Enable/Disable Mouse button. Who knew! :-) Actually, I did. I am an avid reader and I like to RTFM. But there is so much information that I forgot (decided that I don't need this functionality and didn't make a conscious effort to remember; therefore was never able to link this information in my mind) why that button is there and it does.

It wasn't helped by the key map. I downloaded it, printed, made it a lot more understandable (by writing what some of the buttons do; because often it's not understandable from the icons alone), hanged it on the wall in front of myself, but still missed this.

The Extend functionality is great, but I feel like the Keymap doesn't do it justice. Just a couple of examples from my own, understandably flawed and subjective, experience:
1. Arguably the most important (used by me most often) invention of Extend - putting Enter functionality on the Space key. I only found out about this functionality because I saw DreymaR mentioning it in some obscure comment in some obscure thread. I had not idea this functionality was there after reading a bunch of material. Space button is big, no need to save space and only use the lavel - I would put a proper "Enter" label in there and promote this main feature in the text form as well (in the starting posts)...
2. Enable/disable mouse movements icon. A circle that represents... what?.. I would have a simple contour of a mouse with a line striking through.
3. The same thing with Mouse Buttons. Perhaps there is a space for a simple contour of a mouse with visible keys?
4. There are so many arrows and it's very difficult to distinguish between them without the label (Extend-ISO-NoWi-Win_90d.png has even more).
5. One of those arrows is the CapsLock functionality (Esc button). It looks like a... symbol of a button that can be pressed down?.. Very confusing! I stumbled upon this CapsLock funtionality by accident - enabled it somehow and had to research how to turn it off... Here is a symbol that would IMO be more understandable:
HoR24Y1.png
6. The upper row (F1 - F12) have understandable icons and no text needs to be added. But icons are not panacea - if they are not understandable, then why not to add some additional labels, especially if there is enough space?


I hope that reading my perspective was interesting, revealing and perhaps even useful.


Is Extend-ISO-NoWi-Linux_90d.png the best quality of key map that there is? If you don't have time/interest (or flatly don't agree with my perspective), I could try to make changes. I am really bad at graphics, but perhaps we can see how it goes and if the result is any better?


So that's that about the usability/UI regarding the key map and the mouse issues.

But I still have technical issues with:
1. Esc keys.
2. Key repeat.
3. Shift-Space.
4. Upper row keys not functioning with Shift.
5. Ext+Enter (Ext+Backspace?)

I hope you or other people have solutions/ideas!

Thank you for years of active and dedicated development - the ideas and implementation is really solid. I can attest to that with 6+ weeks of experience. I won't go back! Thank you once again!

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563
mixer said:

I hope that reading my perspective was interesting, revealing and perhaps even useful.

I have to confess that right now, my impression is that you want me to do a lot more hard work than all the hard work I've already done, so that you can avoid having to work yourself to find and understand things. That may be revealing, and some of it useful, but it's more annoying and frustrating than interesting if my interpretation is correct. Have you read the main Big Bag and Extend topics that I've linked to at the top of the post fairly thoroughly? Some of the answers are found there.

Your criticisms of my images miss some marks: No, there isn't a lot of room! These images are used as screen help images and on those you barely see the elements as they are. Your suggestions would make them less clear. They are meant as mnemonic devices for a person who has understood Extend mappings, not to teach those mappings. For that, we have the Extend topic, and also the ASCII chart found directly below the help image in this topic (and in the extend symbols file). If in doubt, there's also the extend file itself, which is commented.

A major image clue is key colors. All the mouse buttons are blue, and it should be quite clear in that context what an up arrow means (mouse up), or an up arrow on a narrow rectangle (mouse wheel up). Granted, the circle is obscure and might've been blue too. But it's not a key everyone will want there, some will map it to something else and many won't use it at all so I chose to not oversell it.

The Ext+Space=Enter functionality is clearly described in the Extend topic. On the help images, simple symbols are used to keep the images clear. So Enter uses the common Enter symbol found on most keyboards, and CapsLock uses the same arrow as Shift; the upside-down Shift arrow is used on some keyboards to denote CapsLock but I realize that not all users know this. The CapsLock key is also yellow. I don't see how that is so unclear?

Your text is a really long and somewhat messy read. I can't tackle it all in one go! I'll be back with some comments and tips regarding some of your points.

Last edited by DreymaR (30-Jan-2019 13:05:12)

*** 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: 13-Nov-2018
  • Posts: 6
DreymaR said:

I have to confess that right now, my impression is that you want me to do a lot more hard work than all the hard work I've already done, so that you can avoid having to work yourself to find and understand things. That may be revealing, and some of it useful, but it's far more annoying and frustrating than interesting if my interpretation is correct.

I sincerely apologize if my post has created such an impression! I really tried to achieve an entirely different impression here.

I had a lot to say/ask and it wasn't possible to do justice to all the great stuff Extend does (and you personally did). I tried to say how great you/Extend is, but I can understand if you felt like the post was too negative. It's hard to see sincere praise when 95% of the amount of the text is questions/bugs/misunderstanding/suggestions.

So, disregarding the technical issues I would be happy to get resolved, here is the general sense I tried to convey (and failed):
- Extend is amazing!
- Your active and consistent work over so many years is beyond great!
- I will be using Extend even if all the issues I currently have are going to remain unsolved.
- I will be recommending Extend to everyone who uses keyboard even semi-actively.

All the super/hyperlatives are used in a proper way (for something truly outstanding), not in the American way (when 95% of everything is awesome).


The reason why I spent so much time writing the text and described different stages (instead of simply writing about my remaining issues), was not for the abundance of time and not enough interesting things to do. It wasn't to vent and test Extend in action on a big text. It wasn't to annoy or troll you. No, my attempt was to provide you with a "user story" ("playtest feedback" in game development). I think that they are critically important for the success of the product (and I think it is useful to treat Extend as a product). In my life I have personally noticed two major problems with making a certain product/service for a long time:
1. Over the years my view on a subject is dimmed ("professional deformation"). I am became an expert, but I lost touch with how things look from newbies' point of view. Users' first-time experience described in a story form help to mitigate the "expert bias". Doesn't mean that newbie's POV is correct. It's his point of view and if looked at objectively, a lot can be learned from it.
2. People have issues, but they never tell about them. They either solve them themselves (so a bunch of people are forced to fix the same stuff as countless people before them; but the issue is never totally solved on the strategic level) or they fail and leave (still not saying anything). User stories are an excellent resource of such overlooked problems, I find. Even if 90% of said thing is garbage, the rest can provide a very useful information that can be used to improve the product.

If your attitude would have been "I did this for myself, take it or leave it - I don't care" - I wouldn't have spent so much time writing my posts. But it's clear that you still care about this marvelous product of yours! And if you care - even after all those years - then I care as well to spend more time trying to help your efforts (I know how impossibly hard it is to get a proper user story and how valuable they can be)! Whether or not my attempt was successful or caused more harm - that's for you/history to decide. But please do know that my intentions were pure!


I hope that this clears things up a bit!


DreymaR said:

Have you even read the main Big Bag and Extend topics that I've linked to at the top of the post?

I haven't read all the posts from the Main Linux (this one) and Extend threads. Maybe 50%.
I have read your main posts from those threads multiple times over.

If you say that some of the issues I encountered were solved in those threads, I can go and read them in their entirety.


Your criticisms of my images miss some marks: No, there isn't a lot of room! These images are used as screen help images and on those you barely see the elements as they are. Your suggestions would make them less clear. They are meant as mnemonic devices for a person who has understood Extend mappings, not to teach those mappings. For that, we have the Extend topic, and also the ASCII chart found directly below the help image in this topic (and in the extend symbols file). If in doubt, there's also the extend file itself, which is commented.

Thank you for explaining. I understand the size thing now.

My perspective came from the "print it on A4 and put it on the wall in front of you" scenario - in which there is enough room for additional markings.

I am not saying that you should do what I suggested. Or that I would do it and you would have to replace the current version. I simply asked if there is a bigger resolution version somewhere, which could be used for the experiment, which - if even successful - could be put as an additional picture in the Docs directory, not replace the current one.


So Enter uses the common Enter symbol found on most keyboards, and CapsLock uses the same arrow as Shift. I don't see how that is so unclear?

Enter symbol is a common one. And it's totally understandable once you know it's there. But I personally didn't (a small symbol on such a big key; kinda looks like the typical symbol for Space) until it was pointed out separately. Maybe I am the only one with such an alternative viewing pattern. Or maybe I am simply the first one to bother to write about this kind of embarrassing (for me!) peculiarity...

CapsLock is not exactly the same thing as Shift. The symbol is also not exactly the same - it is turned 180 degrees. When I first saw it, I thought that there is simply a bug in a picture (I planned to actually report it). Another theory was that the graphics was correct and it was "a button that can be pressed". The third theory was "maybe it's a button that somehow re-disables the function of the Shift key - hence the opposite direction from the Shift symbol". I didn't seem to need any of those strange functions, so I concentrated on discovering other buttons and functionality.


Your text is a really long read. I can't tackle it all in one go! I'll be back with some comments and tips regarding some of your points. I wish you hadn't made multiple numbered lists in it though, but since they are in different sections it should be workable.

I don't assume that I deserve any help or that you need to spend a single second answering me. The work you did so far is more than enough for me to feel gratefulness towards you for the rest of the eternity!

But I will be humbly waiting for any help you may decide to provide! :)


And to conclude. Thank you for all the amazing work you did! My appreciation goes way beyond my English skills!

Offline
  • 1
  • Reputation: 0
  • Registered: 12-Mar-2019
  • Posts: 2

Hi there!

I came to the forum to ask another question: How would I go about changing the modifier for the extend layer from capslock to something else? I took a gander inside the

BigBagKbdTrixXKB/xkb-data_mod/xkb/symbols/de
BigBagKbdTrixXKB/xkb-data_mod/xkb/symbols/extend

files, but I'm confused and lost.

As I described in the discord, my journey to alternative layouts started with me wanting to get into vim, which strongly recommends mapping the esc key to capslock. I'm an i3-gaps user too, where the default modifier to use for shortcuts is Super, which makes sense as you'd lose access to shortcuts in so many apps if you were to use alt. But as Super is really not that ergonomic I mapped both esc and super to capslock using xcape in a script that runs when I login:

# Map the caps lock key to super...
setxkbmap -option caps:super
# But when it is pressed only once, treat it as escape.
killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'

That way caps lock acts as esc when tapped, but as Super_L when held down. So that's why I'm in need of the capslock key. A thing that makes my decision somewhat harder is that my keeb replaced the menu key with a fn key. I pondered about doing something like what is described here https://colemakmods.github.io/ergonomic … fiers.html but I'm still open to suggestions!

8oOzDJM.png

Offline
  • 0
  • Reputation: 52
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 659

Your proposal looks extremely sensible to me.

I use LeftAlt as my Extend key, and IMO it is the best possible key for an Extend layer. The key benefits of using LeftAlt over CapsLock, are that it makes it easier to access all the left-hand side Extend mappings, and using your thumb is more comfortable than using your pinky. YMMV.

However it might depend somewhat on your keyboard, as some keyboards have larger spacebars than others, which force the Alt keys too far to the sides. My main keyboard is a Matias Ergo Pro which has the benefit of a split space bar, plus very good Alt Key positions. There are other keyboards, such as the UHK where thumb key Extend would work well too. But even on my laptop, where LeftAlt is directly below Qwerty X, LeftAlt is still comfortable enough.

There are a couple of different ways to implement it. My approach is to redefine the scan code definitions in xkb/keycodes/evdev for the appropriate keys, <LALT>, <CAPS>, etc, to get the mappings you prefer.

Last edited by stevep99 (12-Mar-2019 11:51:30)

Using Colemak Mod-DH with some additional ergonomic keyboard mods.

Offline
  • 0
  • Reputation: 0
  • Registered: 12-Mar-2019
  • Posts: 2

I use LeftAlt as my Extend key, and IMO it is the best possible key for an Extend layer.

Basically what I thought. This is my keeb (imagine it in german), but still, considering I need capslock as super/esc way more frequently than I anticipate to use extend, mapping it to alt is the best thing that came to mind.

There are a couple of different ways to implement it. My approach is to redefine the scan code definitions in xkb/keycodes/evdev for the appropriate keys, <LALT>, <CAPS>, etc, to get the mappings you prefer.

I'm already using setxkbmap for my xcape capslock = esc/super(held-down) solution. Would the approach you're proposing help me with retaining original caps functionality to then use it with xcape? I imagined I would need to change something in DreymaR's files to make capslock behave exactly like it is on qwerty.

Last edited by Gotek (12-Mar-2019 13:05:40)
Offline
  • 0
  • Reputation: 52
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 659

I would think you should be able to map the CapsLock key to Super, and LeftAlt to CapsLock by editing the keycodes. Then, rely on DreymaR's files which by default apply Extend to the key that maps to <CAPS> which in your case (and mine) would really be LeftAlt. 

I don't use xcape but would assume you could still use it to produce Esc on a short tap on the Super key, which in your case would really be CapsLock.

Using Colemak Mod-DH with some additional ergonomic keyboard mods.

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

The Extend modifier is set with the "level5" option, and I use "level5:caps_switch" (or caps_switch_lock which only differs if you have several level5 modifiers).

In the Linux XKB world it's customary to treat Caps Lock behavior as an option. This allows for modularity.
• What SteveP does is to "cheat" a little by swapping keys and everything on them. That's a viable option.
• The more "proper" way would be to select whatever Caps option you like (or none) and instead add the level5 modifier functionality (its action name is ISO_Level5_Shift) to some key mapping you want it to apply to. It could be on any key really.
• Alternatively, make a new option but then you'd have to define it in the rules files etc which isn't for newbs.
• Alternatively, hack my level5 option in the symbols/level5 file to pertain to another key than <CAPS>.

If you use another caps option like "caps:super" in addition to a level5:caps_### option, the two options won't cooperate well unless you've hacked the level5:caps option as described above. So be aware.

There are many ways to skin this cat, in varying shades of arcanity. ^_^

Last edited by DreymaR (13-Mar-2019 11:03:00)

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

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563
Updated help images

mixer and others: Okay, I've finally gotten around to posting updated images with
• Text labels to hopefully explain the symbolic images better
• A high-res (DIY) version found in the Extend topic (in a Spoiler box) for printing
• A more universally understood CapsLock icon

This, then, is what a text labeled help image like the ones in the Extend topic looks like:

Extend-ISO-NoMod-Linux_96d-Labels.png?raw=1

Hope that helps someone. Mixer, thanks for the constructive criticism and sorry if I came across as crass. I was stressed and tired. It happens.

I think you were wondering why such arcane functions as PauseBreak and PrintScreen are on such big keys as Back and Enter? Well, in the Extend perspective these are actually among the least attractive ones despite their size. Extend is all about bringing important keys near your home position.

If some keys don't do anything in Linux despite producing the key code they are supposed to, it's because the Linux distro doesn't map those keys to any actions. You can use hotkey settings or tools to make those key codes do pretty much whatever you like, including their original intended functionality. This is described in the topic post's Extend section.

Last edited by DreymaR (17-Mar-2019 16:52:45)

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

Offline
  • 0