DreymaR/BigBagKbdTrixXKB

How to set "u" and "o" keys to toggle over word instead of beginning/end of line. (and assign N and "." the functionality of original "u" and "o")

Closed this issue · 3 comments

I want the u and o keys to toggle over whole words instead of going to the beginning or end of the line. I am using Linux Mint and the functionality of this is ctrl+arrow key. I'd also like to assign the original functionality of the u and o keys to n and "."

You don't specify it, but I'm assuming you refer to the main Extend layer.

It should indeed be possible to send Ctrl+Arrow. However, I can't do everything for you unless you pay me to do so, hehe.

Look how I did it with Extend+V sending Ctrl+V:

Redirect(key=<AB04>,mods=Control,clearmods=LevelFive), Redirect(key=<AB04>,mods=Shift+Control,clearmods=LevelFive), // Ctrl+V

From that you should be able to extrapolate how to send the <LEFT> and <RGHT> keys with Ctrl.

After editing the symbols/extend file in your pulled repo, you have to rerun the install script obviously.

It's a decent idea. I really need the Home/End keys in my work though, so I don't have room for that. Heh.

Thanks for the help! I believe I got it working.

I changed my u and o keys to

key <AD07> { symbols[Group1]=[Any       , Any       , Any       , Any       ,   // U
                    Left                        , Left                          ,   // Home
                    KP_4                        , U21D0                         ] , // KP_4   /   ← ⇐
                 actions[Group1]=[NoAction(), NoAction(), NoAction(), NoAction(),
                    Redirect(key=<LEFT>,mods=Control,clearmods=LevelFive)        , Redirect(key=<LEFT>,mods=Shift+Control,clearmods=LevelFive)          ,   // <HOME>
                    NoAction()                  , NoAction()                    ] ,
                 repeat=yes     };  // QWE U, Cmk L
key <AD09> { symbols[Group1]=[Any       , Any       , Any       , Any       ,   // O
                    Rght                         , Rght                           ,   // End
                    KP_6                        , U21D2                         ] , // KP_6   /   → ⇒
                 actions[Group1]=[NoAction(), NoAction(), NoAction(), NoAction(),
                    Redirect(key=<RGHT>,mods=Control,clearmods=LevelFive)        , Redirect(key=<RGHT>,mods=Shift+Control,clearmods=LevelFive)          ,   // <HOME>
                    NoAction()                  , NoAction()                    ] ,
                 repeat=yes     };  // QWE O, Cmk Y

and my m and . keys to the standard home and end functionality:

    key <AB07> { symbols[Group1]=[Any       , Any       , Any       , Any       ,   // M
                    Home                        , Home                          ,   // Home
                    KP_0                        , U21D5                         ] , // KP_0   /   ↕ ⇕
                 actions[Group1]=[NoAction(), NoAction(), NoAction(), NoAction(),
                    Redirect(key=<HOME>)        , Redirect(key=<HOME>)          ,   // <HOME>
                    NoAction()                  , NoAction()                    ] ,
                 repeat=yes     };  // M
    key <AB09> { symbols[Group1]=[Any       , Any       , Any       , Any       ,   // . >
                    End                         , End                           ,   // End
                    KP_Decimal                  , colon                         ] , // KP_. :
                 actions[Group1]=[NoAction(), NoAction(), NoAction(), NoAction(),
                    Redirect(key=<END>)         , Redirect(key=<END>)           ,   // <END>
                    NoAction()                  , NoAction()                    ] ,
                 repeat=yes     };  // . >

It might not be the cleanest solution but it gets the job done.

These things are never "the cleanest solution" anyway. XKB doesn't allow for cleanliness, hehe.

If I were you, I'd add a clearmods=LevelFive to the redirect actions of the last two keys, on both shift states. It ensures that the redirected keys work more as intended (although it seems KDE can't handle this directive?).