I want to map my Fn + Left (XF86audioprev) and Fn + Right (XF86audionext) keys to function as the "Home" (Num_Lock + 7) and "End" (Num_Lock + 1) keys.

I tried using xbindkeys with xte. At the beginning nothing happened when I pressed the buttons so I tried different things. I discovered that the xte commands where executed too early so I added a delay like suggested in another thread. I tried using 3 as the key to map and it works. This is what is written in the "/home/me/.xbindkeysrc" file:

#HomeFNLeft
"xte 'usleep 100000' 'key Num_Lock' 'key KP_Home' 'key Num_Lock'"
    m:0x0 + c:12 + Release
    3 

This works perfectly but when I change the key to the Fn+Left this fails

#HomeFNLeft
"xte 'usleep 100000' 'key Num_Lock' 'key KP_Home' 'key Num_Lock'"
    m:0x0 + c:173
    XF86AudioPrev 

The configuration above doesn't work. I don't know why. Is there an incompatibility between the media keys and xbindkeys? Thank you and hope you can help me.

My specs:

*OS: Ubuntu 16.04

*kernel: 4.8.0-58-generic

*Laptop Model: ASUS ROG Strix GL753VD

share|improve this question

I had the exactly same problem Finally i've solved it, so it works now, but not very well. I wrote

# my Shift Home
"xte 'usleep 200000' 'keydown Shift_L' 'key Home' 'keyup Shift_L'"
Control+Shift + Left | m:0x5 + c:113

# my Home
"xte 'usleep 200000' 'key Home'"
Control + Left | m:0x4 + c:113

# my Shift End
"xte 'usleep 200000' 'keydown Shift_L' 'key End' 'keyup Shift_L'"
Control+Shift + Right | m:0x5 + c:114

# my End
"xte 'usleep 200000' 'key End'"
Control + Right | m:0x4 + c:114

But it this way it works only with pretty fast presses, so it might be not very comfortable - try to play with sleep-time. It seems like keyboard is busy some time after Left/Right was pressed, so it can't read keys and ignore Home/Right from xte if sleep time is too short. P.S. sorry for my english, i'm not native speaker.

share|improve this answer
    
I tried this, and played with the sleep time, but the behaviour was very erratic (sometimes it acknowledged the press, sometimes it didn't) – MsKK Sep 4 '17 at 19:21
    
Sleep time is used between presses of the Ctrl key and the arrow key, so try to press Ctrl and then arrow just after. I assume the time between presses should be more than some system time of key press processing but less than our 200000). I got unstable behavior only with small sleep times, so if with something like 1e6 it's still not ok then the situation is somehow different from mine. On my laptop with 1e6 all works fine, but it's strange to see the effect of a press in a second after press itself. But if you are talking about lag between press and its effect then it ok for this method – Yura Polyachenko Sep 5 '17 at 20:54
    
It's not lag. I suppose it is a different issue, but thanks for your input. – MsKK Sep 15 '17 at 14:57
    
you should use the Release modifier. E.g. Release + Control+Shift + Left - manpages.ubuntu.com/manpages/xenial/man1/… – andras.tim yesterday

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.