• You are not logged in.

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

  • Started by DreymaR
  • 384 Replies:
  • Reputation: 0
  • Registered: 13-Sep-2015
  • Posts: 3

Very strange. I did mean just shift+space, which what I tend to use to page up while using browsers . . . that could be relearned though. I thought the problems might be related to some conflict with my keybindings using Awesome WM, but it appears to be same situation under Gnome. I'll have to give a shot on my Ubuntu work computer . . . it's probably something weird about my Arch install.

Edit: Just tried it under KDE, and Super+E and Shift+Space behave normally there. Very strange.

Last edited by someguy (16-Sep-2015 03:02:52)
Offline
  • 0
  • Reputation: 0
  • Registered: 17-Sep-2015
  • Posts: 12
someguy said:

Very strange. I did mean just shift+space, which what I tend to use to page up while using browsers . . .

EIGHT_LEVEL_SEMIALPHABETIC uses shift for level selection without explicitly preserving it and, therefore, shift is consumed.  That is, it must not be interpreted other than for level selection.  As both the shifted and the unshifted level of the space key contain the same keysym "space", space and shift+space cannot be distinguished.

To fix this, create a new type just like EIGHT_LEVEL_SEMIALPHABETIC (in types/level5), but with the added line

    preserve[Shift] = Shift;

and use that for the space key.  I use this approach succesfully with a Neo 2 level scheme which "Extend" is similar to.  Maybe it is sufficient to modify EIGHT_LEVEL_SEMIALPHABETIC, without introducing a new type.

Alternatively, find a unused keycode, give it one level with just space, and then rEIGHT_LEVEL_SEMIALPHABETIC uses Shift for level selection without explicitly preserving it and, therefore, Shift is consumed.  That is, it must not be interpreted other than for level selection.  As both the shifted and the unshifted level of the space key contain the same keysym "space", space and Shift+space cannot be distinguished.

Just tried it under KDE, and Super+E and Shift+Space behave normally there. Very strange.

Unfortunately, not all programs appreciate the fine points of XKB, such as consumed modifiers.

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

Wow, thanks for your insights!

Do I really need a new type though? Can't the preserve command be given locally for one key in addition to the key type properties?

Actually, modifying EIGHT_LEVEL_SEMIALPHABETIC should be just fine, as hardly anyone use it anyway. :-)

*** 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: 17-Sep-2015
  • Posts: 12

Can't the preserve command be given locally for one key in addition to the key type properties?

I am not aware of such a possibility.

Actually, modifying EIGHT_LEVEL_SEMIALPHABETIC should be just fine, as hardly anyone use it anyway. :-)

For a personal solution that is fine, for a solution distributed to other people I would be more cautious.  Maybe you can take advantage of the new type for other keys, too, such as Return, Backspace, or F1-F12.  Also, it probably also would better be derived from EIGHT_LEVEL than from EIGHT_LEVEL_SEMIALPHABETIC, if it is to be used for keys without letters.

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

That's a good point since this is not about letter key behaviour. Hmmm...

I think this should work for the Space key, in my extend file:

    key <SPCE> { symbols[Group1]=[ NoSymbol , NoSymbol , NoSymbol , NoSymbol ,
                   Return               , Return                , // Enter
                   space                , nobreakspace         ], // Space
                 actions[Group1]=[NoAction(),SetMods(modifiers=Shift),NoAction(),SetMods(modifiers=Shift),
                   Redirect(key=<RTRN>) , Redirect(key=<RTRN>)  , // <RTRN>
                   NoAction()           , NoAction()           ]
               };  // <SPCE>

I've changed the action for lv2/4 from NoAction() to SetMods(modifiers=Shift) which should produce the correct shift state for this key I think!

So if this is only a problem for a few odd keys, it may be fixed this way instead of messing with any key types. It requires using the Extend mod – but it may not be a problem without that mod anyway (since that's where the key type EIGHT_LEVEL_SEMIALPHABETIC is used)?

Disclaimer: I haven't yet tried this out.

Last edited by DreymaR (23-Sep-2015 13:24:27)

*** 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-Sep-2015
  • Posts: 23

Fairly certain the Install Script does not work. Can you please help me? I have tried running it multiple times now.
I opened up Terminal navigated to the correct Directory then ran the script with the SH command and never used SUDO. Why is it not working?

Last edited by IQubic (14-Nov-2015 20:34:14)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

That's not a lot of info to go on, IQubic. But try the bash command. Also, look inside the script to see how it's used.

*** 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-Sep-2015
  • Posts: 23

Nevermind I took a look at the first post and ACTUALLY read it. I now have it working. Next question: Is there a way to get a picture to show up on screen, like PKL for windows does? I ask because I don't want to have to print out a separate piece of reference paper for each TARMAK step. Also, I know this may sound dumb, but do I need to add a start-up command?

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

just built a ubuntu 64 bit VM. Used the dreymar linux installation script to get the keyboard up and running with the colemak curl mods.

worked very nicely - what a great tool!

many thanks once again..

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

Well, actually there is a layout picture in Ubuntu and some others, that you can access from the keyboard settings. And it shows what actually goes on in the layout so it'll show my layouts and CurlAngleWide-WhatHaveYou mods correctly. But only if the layout is correctly defined in the Geometry component. I've done that for my stuff so it should be fine.

*** 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-Sep-2015
  • Posts: 23

What do you mean "correctly defined in the Geometry Component"? What is that supposed to do?

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

It's the inner workings of the X11 xkb files. They're split into components, like keycodes (handles the scan codes from the keyboard and translates them to aliases and positions on the layout – I use it for the WideAngle mod), symbols (handles which glyphs and/or actions the keys produce so it's at the core of a layout) and rules (gets it all together and handles menu choices etc), etc.

The geometry component only handles the graphical presentation of a layout, so it could be completely wrong and you could still type away happily. But it's necessary for the image presentation.

You don't need to actually worry about this though. It's under the hood and should be working just fine for you.

Last edited by DreymaR (19-Nov-2015 11:02:43)

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

Earlier in this thread there was some discussion of the caps lock function not working in the extend layer when using xkb.  I also have been having this problem for ages, but today I was experimenting and found a configuration that allows it to work!

    key <AD10> { symbols[Group1]=[ NoSymbol , NoSymbol , NoSymbol , NoSymbol ,
                   Caps_Lock            , Caps_Lock             , // Caps_Lock
                   NoSymbol             , NoSymbol             ], //
                 actions[Group1]=[NoAction(),NoAction(),NoAction(),NoAction(),
                   LockMods(modifiers=Lock), LockMods(modifiers=Lock), // Lock mod for <CAPS>
                   NoAction()           , NoAction()           ]
               };  // ; :

(In my case caplock is mapped to extend-semicolon...)

Not sure why, but this LockMods notation seems to have the desired effect!

At last, my capslock feature is back!

Last edited by stevep99 (19-Nov-2015 19:09:56)

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 0
  • Registered: 11-Sep-2015
  • Posts: 23

I see no images being displayed. Is there some command I have to run?

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

In Ubuntu (if thats what you are using)

click the white square with two letters in it, top right of screen, prob inbetween the wifi and bluetooth icons

select 'Keyboard Layout Chart' from the resulting menu

Offline
  • 0
  • Reputation: 0
  • Registered: 11-Sep-2015
  • Posts: 23

I am using Ubuntu, and that does work for me. Although, I would like to replace that with one of the lovely pictures that DreymaR has created.

Last edited by IQubic (21-Nov-2015 02:31:05)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

There's no functionality that I know of to display those pics automagically for you in Linux.

Stevep99, had I forgotten to get that right in my extend file? I'll have a look... Yes, damn, I'd forgotten to fix this. Thanks. The below code should have a proper Caps on all Extend levels of the Esc key; can you test it out for me? I haven't got my Ubuntu machine up now.

// NOTE: If I set lv5-6 of Esc to Caps_Lock, lv1-4 would be CapsLock PLUS Esc! Is this fixed now?
    key <ESC>  { symbols[Group1]=[ NoSymbol , NoSymbol , NoSymbol , NoSymbol ,
                   Caps_Lock            , Caps_Lock             , // Caps_Lock
                   Caps_Lock            , Caps_Lock            ], // Caps_Lock
                 actions[Group1]=[NoAction(),NoAction(),NoAction(),NoAction(),
                   LockMods(mods=Lock)   , LockMods(mods=Lock)    , // Lock mod for <CAPS>
                   LockMods(mods=Lock)   , LockMods(mods=Lock) ]    // Lock mod for <CAPS>
               };  // ; Esc (could also use <SCLK> aka ScrollLock for Caps, if desired)

What happens here is that the actual functionality doesn't come from what you call the key ('Caps_Lock') but the action you set for it. For the other modifiers I used SetMods actions, but for Caps of course it should be a LockMods instead. The internal name of the CapsLock modifier is 'Lock'.

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

Yeah, that works for me. The only slightly strange thing is it seems to be applying to number and punctuation keys also, which is a bit non-standard, but not that important TBH.

Using Colemak-DH with Seniply.

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

That's strange, but probably not our fault. Must be some weirdness with the Lock definitions?

Thanks for testing!

Last edited by DreymaR (26-Nov-2015 09:46:47)

*** 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-Sep-2015
  • Posts: 23

Hey, DreymaR are you aware that every single one of the XKB Tarmak layouts has K and H switched from the correct Colemak Layout? This includes the final stage which is Colemak [eD]. Both the Keyboard layout chart and what letters actually get entered are switched. Can you fix this? It is hard to learn Colemak, so I want to do it right.

Last edited by IQubic (17-Dec-2015 05:50:43)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

Correct is a matter of definition. To me, K to the left and H down is more right. Read my sig topics if you don't believe me.

The layout images in xkb just show the actual layout so they'll show whatever you're actually entering.

It's not the Tarmak layouts but the DH-mod that trips you up. In the symbols/colemak file, make sure they're commented out if you don't want them, like this:

//// NOTE: Including the line(s) below will enable the Curl-Dvbg/Hm mod by Stevep99; see below.
//    include "colemak(cmk-dvbg-hm_ed)"
//// NOTE: This is the lighter Curl-Dbg/Hk Colemak ergo mod, keeping V and M in place.
//    include "colemak(cmk-dbg-hk_ed)"

*** 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-Sep-2015
  • Posts: 23

I would like to remap my keys so that I may have the same Tarmak layouts as shown in the animation on your Tarmak post. Currently I have the K and H (as they would be in the Colemak KH Ergo Mod) keys switched in all of my Tarmak Layouts. I tried the above solution and that did not seem to work.

Last edited by IQubic (19-Dec-2015 03:21:08)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

I'm sorry my overzealous modding has caused you confusion and trouble. Try downloading my files anew, the version that's out now shouldn't have this problem. Let me know if that works for you!

I'd still recommend looking into the DH-mod of course, but it is and should be entirely optional! ;-)

Last edited by DreymaR (19-Dec-2015 14:09:13)

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

hi dreymar

just trying to run your install script on a new (15.10) ubuntu machine

whats the console dir that has appeared in your x-mod_v2-12-1_2015-11-22 dir?

thats not present in the 15.10 xkb dir and as such its causing the install script to fail

I note my old 14.04 machine has no xkb/console dir either, and the prev version of your zip, x-mod_v2-12-1_2015-05-15, has no console dir in it, only the xkb dir

any ideas whats going on here?

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

Ummm, uff... that's odd. Sorry, I must've misplaced that folder. It's about getting up a solution for the virtual consoles. Just delete it or move it out of the xkb/ dir and everything should be dandy. Again, sorry about that. :-)

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

Offline
  • 0