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.