Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
Backspace is the key that deletes a character to the right here, so that's probably what you mean. ;) –  Icedrake Dec 10 '11 at 17:34
3  
Backspace deletes the character to the left of the cursor, not to the right... –  JanC Dec 11 '11 at 19:16
add comment

1 Answer

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.

share|improve this answer
    
This kind of works, but the window loses and regains focus every time it sends an event. Is there anyway to fix this? –  Stephen Sarcsam Kamenar Nov 23 '13 at 4:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.