Ubuntu – Rebind Control-n Control-p

automationshortcut-keys

I would like to rebind C-n and C-p in all my applications to send Up and Down.
My brain is just stuck with this shortcuts, and I am tired of always seeing new windows and printing dialogs popping up.

I was thinking about xmodmap, but it looks like it can redefine only one keysim not a combination.

Also tried xdotool key Up and xte 'key Up' to bind from keyboard shortcuts. It doesn't work properly and requires sleep 0.2 before the invocation which makes it infeasible.

Any ideas?

Best Answer

Ok, I got it, autokey is the way to go.

sudo add-apt-repository ppa:cdekter/ppa
sudo apt-get update
sudo apt-get install autokey-gtk

Run the GUI and add new phrase with <up> as the script and shortcut Cntrl-p . Also you would like to exclude the emacs window, put ((?<!^emacs).)*$ as filter.

Related Question