3

I would like to configure my keyboard to work as close to a MacBook as possible.

Here are some examples of what I would like to do:

---------------+------------------------------------------------
I press stroke |  App receives stroke
---------------+------------------------------------------------
Alt-Shift-[       Ctrl-PageUp (move to previous tab)
Ctrl-Backspace    Delete
Alt-Left          Home (move cursor to beginning of line)
Super-Left        Ctrl-Left (move cursor left one word)
Super-Shift-Left  Ctrl-Shift-Left (select left one word)

(Note that usually Mac keyboards have Cmd where PC keyboards have Alt/Meta, and Opt where PC keyboards have Win/Super)

How could I go about this?


I have experimented in the past intercepting keystrokes with Fluxbox, and emitting keystrokes with xdotool. The problem with this approach was that the app would see the original modifier key I had pressed down, unless I cleared it, in which case that would lose my input state. And sometimes when I let go, X would think the modifier key was still pressed down.

For this reason, I think I need a high-level layer (in X or in the WM) that can completely hide my actual keyboard state from apps, and simulate the keystrokes that actually get passed down to apps. (Something WM-independent would be great, but I could live with a WM-specific solution.)

For bonus points (I can live without this), make it possible to switch behaviour depending on the app that currently has keyboard focus:

Alt-C             Ctrl-Shift-C on gnome-terminal or konsole
                  Ctrl-C in other apps

I imagine some WM integration would be needed for this.

joeytwiddle
  • 1,957
  • Have you seen this: https://askubuntu.com/questions/10008/how-to-make-keyboard-work-like-osx-system-wide – George Udosen Dec 23 '18 at 23:08
  • Thank you very much @GeorgeUdosen, somehow I had not found that question! It does cover most of my requirements. So if nobody can tackle my app-specific bonus soon, then I think we can close this as a duplicate. (FWIW I am using KDE this month.) – joeytwiddle Dec 24 '18 at 04:01

0 Answers0