billentyuzet
Különbségek
A kiválasztott változat és az aktuális verzió közötti különbségek a következők.
| Előző változat mindkét oldalonElőző változatKövetkező változat | Előző változat | ||
| billentyuzet [2018/10/03 13:31] – külső szerkesztés 127.0.0.1 | billentyuzet [2021/05/20 20:04] (aktuális) – daevidt | ||
|---|---|---|---|
| Sor 22: | Sor 22: | ||
| ↳ AT Translated Set 2 keyboard | ↳ AT Translated Set 2 keyboard | ||
| #xinput test 10 | #xinput test 10 | ||
| + | |||
| + | |||
| + | ==== udev ==== | ||
| + | |||
| + | A scankódokat evtest segítségével ki kell nyerni: | ||
| + | |||
| + | Event: time 1621536973.327504, | ||
| + | Event: time 1621536973.473735, | ||
| + | Event: time 1621536973.473735, | ||
| + | |||
| + | Az eszköz azonosítót kideríteni: | ||
| + | |||
| + | * lsusb segítségével, | ||
| + | * vagy dmesg-ből: | ||
| + | |||
| + | [271866.624518] input: VR BOX Keyboard as / | ||
| + | 1.4: | ||
| + | [271866.624820] input: VR BOX Consumer Control as / | ||
| + | 1.4: | ||
| + | [271866.625187] hid-generic 0005: | ||
| + | |||
| + | 1.4: | ||
| + | |||
| + | Elkészíteni a **hwdb** fájlt: | ||
| + | |||
| + | * segítség a ''/ | ||
| + | * létrehozunk egy új fájlt pl ''/ | ||
| + | |||
| + | Az új fájl a következő formájú sorokból áll: | ||
| + | |||
| + | evdev: | ||
| + | KEYBOARD_KEY_< | ||
| + | |||
| + | A '' | ||
| + | |||
| + | < | ||
| + | evdev: | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ==== evdev ==== | ||
| + | | ||
| + | It sits below the process that handles input events, in between the kernel and that process. | ||
| + | |||
| + | kernel → libevdev → xf86-input-evdev → X server → X client | ||
| + | |||
| + | For Weston/ | ||
| + | |||
| + | kernel → libevdev → libinput → Wayland compositor → Wayland client | ||
| + | |||
| + | Since version 1.16 the xorg-xserver obtained support for libinput: | ||
| + | |||
| + | kernel → libevdev → libinput → xf86-input-libinput → X server → X client | ||
| + | | ||
| + | ==== Linux input ecosystem ==== | ||
| + | 1 October 2010 | ||
| + | |||
| + | from: | ||
| + | |||
| + | Over the past couple of days, I’ve been trying to figure out how input in Linux works on modern systems. There are lots of small pieces at various levels, and it’s hard to understand how they all interact. Things are not helped by the fact that things have changed quite a bit over the past couple of years as HAL – which I helped write – has been giving way to udev, and existing literature is largely out of date. This is my attempt at understanding how things work today, in the Ubuntu Lucid release. | ||
| + | |||
| + | === Kernel === | ||
| + | In the Linux kernel’s input system, there are two pieces: the device driver and the event driver. The device driver talks to the hardware, obviously. Today, for most USB devices this is handled by the usbhid driver. The event drivers handle how to expose the events generated by the device driver to userspace. Today this is primarily done through evdev, which creates character devices (typically named / | ||
| + | |||
| + | A great tool to use for getting information about evdev devices and events is evtest. | ||
| + | |||
| + | A somewhat outdated but still relevant description of the kernel input system can be found in the kernel’s Documentation/ | ||
| + | |||
| + | === udev === | ||
| + | When a device is connected, the kernel creates an entry in sysfs for it and generates a hotplug event. That hotplug event is processed by udev, which applies some policy, attaches additional properties to the device, and ultimately creates a device node for you somewhere in /dev. | ||
| + | |||
| + | For input devices, the rules in / | ||
| + | |||
| + | For more information on input_id see the original announcement email to the hotplug list. | ||
| + | |||
| + | === X === | ||
| + | X has a udev config backend which queries udev for the various input devices. It does this at startup and also watches for hotplugged devices. X looks at the different ID_INPUT_* properties to determine whether it’s a keyboard, a mouse, a touchpad, a joystick, or some other device. This information can be used in / | ||
| + | |||
| + | Xorg has a handful of its own drivers to handle input devices, including evdev, synaptics, and joystick. And here is where things start to get confusing. | ||
| + | |||
| + | Linux has this great generic event interface in evdev, which means that very few drivers are needed to interact with hardware, since they’re not speaking device-specific protocols. Of the few needed on Linux nearly all of them speak evdev, including the three I listed above. | ||
| + | |||
| + | The evdev driver provides basic keyboard and mouse functionality, | ||
| + | |||
| + | The synaptics driver is the most confusing of all. It also speaks evdev to the kernel. On Linux it does not talk to the hardware directly, and is in no way Synaptics(tm) hardware-specific. The synaptics driver is simply a separate driver from evdev which adds a lot of features expected of touchpad hardware, for example two-finger scrolling. It should probably be renamed the “touchpad” module, except that on non-Linux OSes it can still speak the Synaptics protocol. | ||
| + | |||
| + | The joystick driver similarly handles joysticky things, but speaks evdev to the kernel rather than some device-specific protocol. | ||
| + | |||
| + | X only has concepts of keyboards and pointers, the latter of which includes mice, touchpads, joysticks, wacom tablets, etc. X also has the concept of the core keyboard and pointer, which is how events are most often delivered to applications. By default all devices send core events, but certain setups might want to make devices non-core. | ||
| + | |||
| + | If you want to receive events for non-core devices, you need to use the XInput or XInput2 extensions for that. XInput exposes core-like events (like DeviceMotionNotify and DeviceButtonPress), | ||
| + | |||
| + | |||
| + | | ||
billentyuzet.1538573496.txt.gz · Utolsó módosítás: 2018/10/03 13:31 szerkesztette: 127.0.0.1
