18

I'm using Ubuntu on a Samsung Chromebook. As some of you may know, the keyboard used in ChromeOS based netbooks is a bit awkward: amongst other things, it doesn't have a Del key*. If I were going to use this netbook to its original purpose, browsing, I guess it wouldn't be a problem, but I need to program with it, and I miss a lot of keys, specially the Delete one, but also Page Up, Page Down, home and End.

So I've been looking for a way to remap Alt+Backspace to Page Up, Alt+left arrow to Home, Alt+down to Page Down, and so on...

I have found a lot of explanations on how to remap one key, but I don't know how I can remap a key combination to a single key. Has anyone tried to do something like this?

Thanks a lot.

*I mean, the key that deletes a character to the right. We call it "Supr" in Spain, I am not sure how it's in english-speaking countries.

3
  • 1
    Backspace is the key that deletes a character to the right here, so that's probably what you mean. ;)
    – Icedrake
    Dec 10, 2011 at 17:34
  • 4
    Backspace deletes the character to the left of the cursor, not to the right...
    – JanC
    Dec 11, 2011 at 19:16
  • Backspace deletes a character to the left, Delete deletes a character to the right. And yes, "Supr" is short for "Suprimir", which means "Delete".
    – wjandrea
    May 5, 2019 at 13:58

1 Answer 1

11

You can use xbindkeys to grab the keys and xvkbd to send keys.

Create a file .xbindkeysrc in your home directory and paste this text:

"xvkbd -xsendevent -text '\[Delete]'"
  Alt + BackSpace

"xvkbd -xsendevent -text '\[Home]'"
  Alt + Left

"xvkbd -xsendevent -text '\[Page_Down]'"
  Alt + Down

Then start xbindkeys and it should work. Probably you want to map more keys, then after you edited the .xbindkeysrc you can run pkill -HUP xbindkeys to send a HUP signal to xbindkeys (or kill xbindkeys and start it again).

To see the key names that xbindkeys sees, you can run xbindkeys -mk (man xbindkeys has more info).

To see the key names that xvkbd knows, have a look in /usr/include/X11/keysymdef.h (maybe someone else knows a better method?).

xbindkeys only runs until your X session ends, so you probably want to put it in your startup (auto-start) programs.

3
  • This kind of works, but the window loses and regains focus every time it sends an event. Is there anyway to fix this?
    – Farzher
    Nov 23, 2013 at 4:10
  • 5
    Doesn't work for me. No keys are sent. Jul 23, 2016 at 5:03
  • Didn't work for me on Ubuntu 22.04 running X11 Mar 18, 2023 at 12:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .