5

I am using a laptop with Ubuntu 12.04 and I want to send a Fn+F8 from a script in order to disable my touchpad.

When i type the command xdotool key fn, it prints

(symbol) No such key name 'fn'. Ignoring it.
(symbol) No such key name 'fn'. Ignoring it.

How can I send the Fn key?

----------------------------update June 13 ----------------------------------

So the Fn key can't be sent via program language? By looking at /usr/include/linux/input.h line 614 , I see:

#define KEY_FN 0x1d0

it also don't work by sending signal? Or it isn't the Fn key code?

----------------------------update June 26 ----------------------------------

in rencently, I did some test about Fn+F8 using C . I cat /dev/input/event3 and can see the Fn+F8 code is 240 which is

#define KEY_UNKNOWN     240

and some other code. I'm feeling blue. Maybe the touchpad is handled directly by the hardware as user49740 had said.

but the command can disable touchpad by os

xinput set-prop 'ETPS/2 Elantech Touchpad' 'Device Enabled' 0

however it can't change the touchpad light status. And the Fn+F8 can't enable or disable the touchpad .

3 Answers 3

6

Pressing the Fn key does not send any keycode to the operating system, therefore you cannot fake pressing the Fn key.

However, some Fn+another key combinations send keycodes. For example, the play/pause/next/prev key combos always send keycodes

From a terminal, you can run the xev program, which opens a simple window. You can now press various keys and key combos and the keycodes received by X11 will be shown in the terminal. You can press Fn+F8 and see if xev shows any output

Unfortunately, on most laptops the 'disable touchpad' key combo is handled directly by the hardware, so you must find another way to disable the touchpad.

If you are using a Synaptics touchpad, you should look at synclient or syndaemon. For example, this article says that synclient TouchpadOff=1 turns off the touchpad and synclient TouchpadOff=0 turns it on

7

No. The Fn key is handled by hardware, not the OS.

2
  • so, the Fn key don't work using program language? only by hardware ? But I see C++ source code at line 614 in /linux/input.h . #define KEY_FN 0x1d0 it also don't work by sending signal? Or it isn't the Fn key code?
    – Cyd
    Jun 13, 2012 at 12:13
  • Then, How come that Fn-F8 doesn't work with Linux, on my laptop ?
    – Camion
    May 12, 2018 at 18:50
0

You can send Fn key on Linux by xdotool on follow way:

If you like to send:

xdotool key Fn + Up

You can do it on follow way:

xdotool key XF86MonBrightnessUp

If you like to send:

xdotool key Fn + Down

You can do it on follow way:

xdotool key XF86MonBrightnessDown

I hope this help you by your reseach for sending the rest of possible key combination by xdotools.

You must log in to answer this question.

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