• You are not logged in.

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

  • Started by DreymaR
  • 384 Replies:
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

No good place to but the Z key? This baffles me. You've read about this in the BigBag I suppose. Are you under the impression that Z needs a better position than it deserves?

On ortho boards it's a different game of course. I know some people elected not to use Angle mods to keep their row-staggered boards more similar to their ortho boards. I'm not sure what to think of that, as the DH mod without an Angle mod on a row-staggered board does get weird and suboptimal.

The statement that you don't need the "fancy features in the Big Bag" tells me that you probably haven't grasped the power that lies in using Extend right. But your funeral...

Last edited by DreymaR (18-May-2020 10:24:42)

*** 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
LinuxFish said:

I usually use an ortholinear board so I use the correct fingers for all the keys. I would like to keep the columns the same (ie no angle mod) on my laptop because I have an ansi layout on the laptop and I have no good place to put the z key if I apply the angle mod. If I could graft a planck into my laptop that would be the best solution but I don't think it's very practical to bring a separate keyboard with me at all times.

But, but... if you use a ortholinear board most of the time, but sometimes have to use your laptop board, then I would have thought that would want to make the experience of using your laptop keyboard as near as possible to that of your external board.  I would argue the angle mod should give you an experience which is closer to that of an ortholinear board than using the standard fingering.

Obviously the ideal solution would be to get a replacement ortholinear laptop board, but since that's basically not possible, applying the angle mod is going to be the next best option. Suerly typing Qwerty C with your middle finger on a standard board is going to be especially difficult once you're used to ortholinear. (I take the point about Z but most ANSI users find the Qwerty B position perfectly satisfactory for such an infrequent letter).

I mean, yes you can do cool things in the firmware of the planck - but you can also do most of those same things in software so that they work with the builtin keyboard too - which is just what stuff like Extend gives you. This way you get as much consistency of experience as possible across your input devices.

Last edited by stevep99 (27-Apr-2020 14:43:26)

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 0
  • Registered: 18-May-2020
  • Posts: 3

Sorry if this has already been brought up before, but this forum doesn't seem to have any decent way of searching within a topic...

Has anyone else had an issue where enabling the `misc:extend` option disables the Ctrl+Alt+Fx shortcuts for switching to console? I really like the extend layer but as a relative newbie to the Unix game, the console is super important for when (and not if) I break things.

I imagine I can define my own shortcuts to replicate what the built-in shortcuts are doing, but if this is a known issue with a relatively easy (or at least cleaner fix), I'd much prefer to go about it that way.

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

Yes, it's been brought up several times but I don't blame you for not finding it!

So, the F# keys are remapped to multimedia keys with Extend and I couldn't do that without mussing up the Ctrl+Alt shortcuts. So to get those back just find the symbols/extend file and comment out the F# keys. No more multimedia keys, no more broken shortcuts.

If you figure out how to preserve the shortcuts without losing the Extend mappings for those keys, please let me know.

Last edited by DreymaR (18-May-2020 10:23:33)

*** 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: 18-May-2020
  • Posts: 3

Thanks for clearing that up! Annoying that the Ctrl+Alt shortcuts are messed up by the extend file... I'd definitely like to dig into it at some stage, but I have quite a number of things on my plate at the minute (I suppose we all do...)

Also big kudos for putting this mod out there, it makes things a lot easier than having to write all of these from scratch! :D

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

Thanks. Appreciation is always appreciated!   ♪♫ (*ノ・◡・)ノ ♫♩ ┏(・o・*)┛ ♫♪

*** 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: 18-May-2020
  • Posts: 3

Hey all, seeing some issues with the mod after an update to xkeyboard-config (from 2.29 to 2.30) on Manjaro 20.0.3 (based on Linux 5.4). Originally had the layout hard enabled in /etc/X11/xorg.conf.d/00-keyboard.conf, like so:

Section "InputClass"
	Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbModel" "pc104curl-z"
        Option "XkbLayout" "us(cmk_ed_us)"
        Option "XkbOptions" "misc:cmk_curl_dh,misc:extend,lv5:caps_switch_lock"
EndSection

This worked fine until my next boot after that upgrade (there were a couple of other upgraded packages but I can only presume this is the one causing the issue?)

Anyone else who upgraded xkeyboard-config seeing this issue?

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

I think that I've seen issues with the System layout settings pointing to a non-existing layout. It's part of the reason I'm using a call to setxkbmap (in ~/.bashrc) instead of system settings.

*** 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: 09-Sep-2020
  • Posts: 7

I am very much enjoying this Extend functionality! But I'm having one issue. When I'm using Google Spreadsheets, whenever I hit Caps Lock (which is mapped to ISO_Level5_Shift) it clears the current spreadsheet cell. I have to use these spreadsheets for collaboration at work and I'm getting a reputation as the person who accidentally deletes other people's data.

Is there some other modifier I could map Caps to that would avoid that side effect?

Thanks!

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

Not sure what you're asking. The Level5 Shift is what makes Extend work so without it you don't have Extend anymore. You could use another key than Caps for it but the problem would probably be the same?

Why a Shift key would delete a cell's content boggles the mind. Must be some weird hotkey in Google Spreadsheets?  (ʘ言ʘ╬)

I don't see it here: https://support.google.com/docs/answer/181110

But it says you can edit and turn on/off hotkeys, have you tried that?

Last edited by DreymaR (10-Sep-2020 13:07:42)

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

Yes, I have the same problem - and I'm not even using Caps. My Extend key is Left Alt, but sure enough, if I hit Left Alt in Google Spreadsheets, it does clear the current cell. However, I am remapping modifiers by keycode (in keycodes/evdev), so my LeftAlt key is still sending the CapsLock keycode to the OS. Therefore I conclude that Google Spreadsheets is listening for the Caps keycode, and that's what's causing us the problem.

This isn't often a problem, as most software doesn't use the hardware keycodes in this way, but I must admit I have come across it occasionally enough to be an irritant.

It further leads me to think there might be a ready solution. Perhaps we could have Extend mapped to an unused keycode so ensure it doesn't conflict with anything else, and bind the Extend feature to that keycode. Would be interested to know DreymaR's thoughts?

Last edited by stevep99 (10-Sep-2020 13:29:25)

Using Colemak-DH with Seniply.

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

Yes, that'd be possible. Not sure if I should make it a standard solution, as it gets a bit more involved than I like. But...

The <FK13> to <FK24> key codes are defined, but not present on most keyboards. This makes them good targets. So in keycodes/evdev, you could try swapping the code for 66 from <CAPS> to, say, <FK13> making sure to also comment out or swap out the alias for key 191 to <CAPS>, and then in symbols/level5 under caps_switch or caps_switch_lock (which is what I use) change <CAPS> for <FK13>.

But that only matters if Google Sheets looks at the symbolic key codes. If it looks down to the 66 code instead of its <CAPS> alias, we're screwed and I don't see any conceivable way to fool it. But if what SteveP says is that making the <LALT> key into <CAPS> makes Google Sheets misbehave, then it should work the other way around. Was that under Linux, or another OS Steve?

Actually... if the <CAPS> alias is the only problem, then you could possibly even add a line in the keycodes/evdev file that says "alias <EXT> = <CAPS>" and use <EXT> in the level5 file. Not sure, but that might work too. It'd be kind of cool if it did!

Try it out, and if it's an instant hit I'll consider making it canon.  ( のvの) c[_]

Last edited by DreymaR (10-Sep-2020 15:38:22)

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

Yes, I am talking about Linux/XKB here. So, I have experimented a bit with this... but not very successfully. Something I don't really understand is going on.

I was thinking along the lines of using the function keys too. In fact, I did this in my AHK/Windows scripts, where I used F22 and F24 as my base mappings for Extend and AltGr layers, to make it easy to remap those functions to any arbitrary key. So doing something similar for Extend in XKB would be quite nice. To this end, my first attempt was just to see if Extend can be mapped OK to a function key. Taking this:

xkb_symbols "caps_switch_lock" {
  include "level5(lock)"
  key <CAPS> {
    type[Group1] = "EIGHT_LEVEL",
    symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift,
                        ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ]
  };
};

What I found is that you can use have like LALT and RWIN in place of CAPS, but for some reason it won't accept other keys. I tried FK12 for example, didn't work. Perhaps only special keys / modifiers are allowed there?

I then decided to just go with using RWIN as my Extend key, and then rebinding my physical LeftAlt key to be RWIN.

xkb_symbols "rwin_switch_lock" {
  include "level5(lock)"
  key <RWIN> {
    type[Group1] = "EIGHT_LEVEL",
    symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift,
                        ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ]
  };
};

As you'd expect, Extend works perfectly well. But if I go to Google Sheets, I can still reproduce the cell clearing problem. So it seems it doesn't really matter what the binding is, but I'm a bit confused about how the same effect is seen with both different physical keys AND different evdev mappings. Maybe it's something inherent with ISO_Level5_Lock?

Last edited by stevep99 (10-Sep-2020 16:11:20)

Using Colemak-DH with Seniply.

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

Thanks, Steve. This confirms the fear that it's the lvl5 Shift itself. As I said, that makes zero sense and should be considered a likely bug from Google's side.

Next up, would be whether you can edit or at least turn off Google Sheets hotkeys. Shouldn't that be possible?

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

As far as I can see, there is only a setting called "Enable compatible spreadsheet shortcuts". Enabling or disabling this has not effect on the bug.
I also confirmed the bug in both Firefox and Chrome, so it's not browser specific.
Problem is, ISO_Level5_Shift is so obscure and rarely used, that even reporting this bug would be difficult, let alone getting them to fix it.

Last edited by stevep99 (12-Sep-2020 12:25:33)

Using Colemak-DH with Seniply.

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

It's used in one Canadian and one Swiss layout that I'm aware of, so it's not totally obscure. Might be worth filing a bug report for I think. Hmmm... maybe test it with the Canadian International layout (if that's what it's named)?

*** 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: 09-Sep-2020
  • Posts: 7

Using xmodmap in the past (before I discovered Extend etc), I have set caps = Mode_switch, and that works as a modifier that doesn't bother Google Spreadsheets ... is that possible with xkb?

OR, is there a way to set the Caps key to work as a modifier in combination with another key, but when it's pressed on its own, not to send anything? I see that xkb has something called VoidSymbol but I don't know enough about the workings.

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

No, VoidSymbol just means the key doesn't do anything. Switching "modes" also won't do anything for my Extend implementation, as it uses lvl 5 Shift (lvl+4; that is, lvls 5–8) and the Mode_Switch is just an old fashioned lvl3 Shift (lvl+2; lvls 3–4). It may be possible to implement Extend in other ways, originally I tried to make it an Overlay but I couldn't do it. XKB is pretty difficult... And unless I'm really hard pressed to do so, I don't think I can warrant spending a hundred hours trying to fix this problem.

Last edited by DreymaR (16-Sep-2020 11:07:18)

*** 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
DreymaR said:

It may be possible to implement Extend in other ways.

I think it should be possible to implement it using kmonad

Last edited by stevep99 (16-Sep-2020 11:07:20)

Using Colemak-DH with Seniply.

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

Well, I'm talking about XKB implementations. Of course you can install programs that give you keyboard levels, but I'm not going there.

*** 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: 09-Sep-2020
  • Posts: 7
DreymaR said:

No, VoidSymbol just means the key doesn't do anything. Switching "modes" also won't do anything for my Extend implementation, as it uses lvl 5 Shift (lvl+4; that is, lvls 5–8) and the Mode_Switch is just an old fashioned lvl3 Shift (lvl+2; lvls 3–4). It may be possible to implement Extend in other ways, originally I tried to make it an Overlay but I couldn't do it. XKB is pretty difficult... And unless I'm really hard pressed to do so, I don't think I can warrant spending a hundred hours trying to fix this problem.

Maybe it's a different scenario, but in this article it looks like they set Caps as a modifier and use VoidSymbol to prevent side effects: https://www.linux.com/news/extending-x- … d-map-xkb/

Offline
  • 0
  • Reputation: 1
  • Registered: 09-Sep-2020
  • Posts: 7

In my limited testing (limited because I have tweaked my install a bunch by now), it may work to just change line 39 of xkb-data_mod/xkb/symbols/level5 to

symbols[Group1] = [ VoidSymbol, ISO_Level5_Shift ]

.

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

Really? That's in the "caps_switch" definition which I don't use myself, as I've used "caps_switch_lock". Furthermore, I read that as giving a ONE_LEVEL key two shift levels of which the first one is VoidSymbol and the second/shifted one is the ISO_Level5_Shift. I don't see how that'd work?

The level5 file is still a mystery to me. It contains the "modifier_mapping" and "lock" behavior which are included by the others, and map the modifier to a "real" modifier (the <MDSW> and <HYPR> keys). How exactly this works is still beyond my pay grade I'm afraid.  (p〃д〃q)

*** 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: 09-Sep-2020
  • Posts: 7

I don't even have an xkb pay grade.

Do we need to specify the ONE_LEVEL type at all? I got my config working and then dumped it as a single file and it has just this:

key <CAPS>  { symbols[Group1]= [ VoidSymbol, ISO_Level5_Shift  ], virtualMods= AltGr };
Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 975

Just a quick note on here to say that the above problem (Extend key clears cell) doesn't happen using an Extend implemented with kmonad (mentioned here), which further suggests it's related to ISO_Level5_Shift.

Last edited by stevep99 (03-Oct-2020 14:18:41)

Using Colemak-DH with Seniply.

Offline
  • 0