5

My laptop is Thinkpad T440. Because of Lenovo designing, Home/End key is on header, in the line with F1-F12 keys. For my convinient, I want to make some custom shortcut key to map with Home/End key. (ex: Alt+PageUp -> Home, Alt+PageDown -> End).

I tried with xdotool, but it was not worked :(

   name: Homepress
   command: xdotool key --clearmodifiers Home
   shortcut key: Alt+Page Up
   --
   name: Endpress
   command: xdotool key --clearmodifiers End
   shortcut key: Alt+Page Down

What should I do ?

Noted that I don't want to print any special chracters from keyboard with custom shortcut key, I just want to replace "Home/End" key with another key/shortcut.

  • 2
    Possible duplicate of How can I map a character to a key combination? – sbergeron Nov 25 '15 at 4:51
  • 2
    @sbergeron it is different with my case, I want to define new combination key for "Home/End" key on keyboard, not a character like your article. This like on ubuntu we can use combined key: Alt+F2 mapped with Super key. – Ngoc Luong Nov 25 '15 at 7:18
  • For your information; it does work on my system. Maybe you should check with the command xev + Return, then press Home and see what is the keysim on your system and try to use that instead. – Jacob Vlijm Nov 30 '15 at 7:54
  • 1
    OP, did you fix your problem? I have the same issue. – BringBackCommodore64 Mar 1 '18 at 19:15
1

I solved this with xbindkeys.

Install it:

sudo apt-get install xbindkeys xdotool

then create a default config:

xbindkeys --defaults > ~/.xbindkeysrc

Add this to .xbindkeysrc:

"xdotool key --clearmodifiers Home"
    Release + Alt + Prior

"xdotool key --clearmodifiers End"
    Release + Alt + Next

restart xbindkeys

An alternative is using AutoKey: AutoKey screenshot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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