2

I'm currently setting up gestures using Touchegg. Most of them are fairly easy, but I want to bind Fn+F11 which is causing me some trouble.

As far as I understand it FN is not an actual key, but more of a physical switch for my laptop, so it doesn't have an actual "Key" I can use as a modifier in my settings.

Using xev I managed to print out the output of my keypresses, but I'm unsure how to use it in my configuration:

Pressing and releasing F11

FocusOut event, serial 38, synthetic NO, window 0x3e00001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 38, synthetic NO, window 0x3e00001, mode NotifyUngrab, detail NotifyAncestor

Pressing and releasing Fn+F11

KeyPress event, serial 38, synthetic NO, window 0x3e00001,
    root 0x1c9, subw 0x0, time 17878429, (-72,69), root:(799,536),
    state 0x0, keycode 95 (keysym 0xffc8, F11), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x3e00001, root 0x1c9, subw 0x0, time 17878519, (-72,69), root:(799,536), state 0x0, keycode 95 (keysym 0xffc8, F11), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False

Any idea what key combination I should use?

1 Answers1

0

In your case you could create a file named .Xmodmap in your home directory. (Note the "dot" in the beginning).

So I tested with xev the combination of Fn+F11 and got this info:

KeyPress event, serial 42, synthetic NO, window 0x5e00001,
root 0x1b6, subw 0x0, time 4047518, (14,98), root:(5045,739),
state 0x0, keycode 128 (keysym 0x1008ff4a, XF86LaunchA), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

You can see that the keycode of this combination is 128 on my device (yours may be a different one)

Next I want to change that combination to -say XF86AudioMute (or whatever you want) and test it: xmodmap -e "keycode 128 = XF86AudioMute NoSymbol XF86AudioMute"

If I press the combination Fn+F11 my audio toggles. To persist this behaviour add it to the .Xmodmapfile in you home directory. Create it if is doesn't exist:

keycode 128 = XF86AudioMute NoSymbol XF86AudioMute

Instead of using XF86AudioMute you could also use XF86Launch1 or anything else that you can find in this list:

xmodmap -pke

Last not least use your chosen value to connect this event with an executable.

More infos on Xmodmap

An alternative would be Xbindkeys which might also work to tackle your problem. A more elaborate documentation can be found here

kanehekili
  • 6,402
  • 1
    Could you explain how I would figure out that equation? I'm really unclear of what this is supposed to do – Leonardo Petrucci Nov 09 '20 at 10:56
  • See my revised answer. Do you get a XEV output when you press the FN button all by itself? – kanehekili Nov 10 '20 at 23:02
  • So, once I map the keycode, what do I do with XF86Launch1? Does that become an alias for the key combination I can use inside Touchegg? I will try this as soon as I get home and let you know! Thank you :) – Leonardo Petrucci Nov 11 '20 at 12:09
  • Yes. In my case I could use the XF86LaunchA directly, but since your combination of Fn+F11 results to F11 the line should read: keycode 95 = XF86Launch1 NoSymbol XF86Launch1 – kanehekili Nov 11 '20 at 12:40
  • If it worked and solves your problem, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks! – kanehekili Nov 17 '20 at 15:48