Linux can send fn key and disable touchpad

linuxtouchpad

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 .

Best Answer

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

Related Question