How to Create Custom Keyboard Shortcuts for Raspberry Pi

Barry_IA

Distinguished
Jun 17, 2009
4
0
18,510
jordantsap: Some things to try –



At the top of /etc/xdg/openbox/lxde-pi-rc.xml it says not to modify that file (in that location) but to copy it to $HOME/.config/openbox, so:

At your home directory (/home/pi or whatever)

cd .config (notice the leading dot – it’s a hidden directory)

sudo mkdir openbox (I needed to create this subdir on my RPi 400)

cd openbox

sudo cp /etc/xdg/openbox/lxde-pi-rc.xml lxde-pi-rc.xml



You should now be able to ls $HOME/.config/openbox/lxde-pi-rc.xml and see the working copy there.



sudo nano $HOME/.config/openbox/lxde-pi-rc.xml to edit.



Some caveats:

Watch your indent spacing; don’t tab – copy a section and edit it might be easier.



If your new text is red it’s in the wrong section. I originally put my keybinding at the end of the file so I could find it easier. Found out later the end is commented for examples.



So I put my keybinding in, rebooted so it would take effect, and it worked. Yeah! Oddly when I brought it up from a cold boot it didn’t – did a different function. Found out this other function was listed later so it was overwriting mine; no idea why it worked right the other day. I commented the ‘duplicate’ – the ‘#’ does not work for this filetype; at the beginning of the section you need <!-- and at the end --> . (Hopefully still works tomorrow!!)