linux can send fn key and disable touchpad?

4

1

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 .

Cyd

Posted 2012-06-12T07:34:25.937

Reputation: 43

Answers

4

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

user49740

Posted 2012-06-12T07:34:25.937

Reputation: 2 850

7

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

Ignacio Vazquez-Abrams

Posted 2012-06-12T07:34:25.937

Reputation: 100 516

Then, How come that Fn-F8 doesn't work with Linux, on my laptop ? – Camion – 2018-05-12T18:50:26.900

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 – 2012-06-13T12:13:11.117