最終更新:2019-04-02 (火) 16:54:48 (1822d)
evdev
Top / evdev
event device, Generic Linux input driver
ftp://www.x.org/pub/X11R7.5/doc/man/man4/evdev.4.html
Event char devices, giving access to raw input device events.
an Xorg input driver for Linux's generic event devices.
マウスとかキーボードとかのイベントを扱うLinuxカーネルのコンポーネント。
kernel.org/doc/Documentation/input/input.txt
- evdev is the generic input event interface. It passes the events generated in the kernel straight to the program, with timestamps.
処理の流れ
Linuxカーネル (デバイスドライバ)
- Linux/dev/input/eventXとして認識される
libevdev
- Linux/dev/input/eventXファイルを読む
evtestとかのアプリケーション
- イベントを受け取る
構造体
- input_event
struct input_event { struct timeval time; unsigned short type; unsigned short code; unsigned int value; };
カーネルモジュール
構造体
- drivers/input/evdev.c
struct evdev { int open; struct input_handle handle; wait_queue_head_t wait; struct evdev_client __rcu *grab; struct list_head client_list; spinlock_t client_lock; /* protects client_list */ struct mutex mutex; struct device dev; struct cdev cdev; bool exist; };
デバイスファイル
処理の流れ
evtest
X Window System
- Linux kernel → libevdev → xf86-input-evdev → X server → X client
Since version 1.16 the xorg-xserver obtained support for libinput:
- Linux kernel → libevdev → libinput → xf86-input-libinput → X server → X client
Weston/Wayland, the stack would look like this:
概要
- evdev is an X.Org input driver for Linux's generic event devices. It therefore supports all input devices that the kernel knows about, including most mice and keyboards.
Supported Hardware
- In general, any input device that the kernel has a driver for can be accessed through the evdev driver. See the Linux kernel documentation for a complete list.
メモ
X.Orgのevdevのxmodmapには互換性がありません
- X.Org 1.5?の新しいevdev入力ドライバは、Ubuntu 8.04 LTSまでのものと異なるキーコードを出力します。もしこれまでに~/.Xmodmapファイルを用いてキーバインドを設定していた場合、アップグレード時に手動で変換するか無効にする必要があります。