= The udev keymap tool =
== Introduction ==
This udev extension configures computer model specific key mappings. This is
particularly necessary for the non-standard extra keys found on many laptops,
such as "brightness up", "next song", "www browser", or "suspend". Often these
are accessed with the Fn key.
Every key produces a "scan code", which is highly vendor/model specific for the
nonstandard keys. This tool maintains mappings for these scan codes to standard
"key codes", which denote the "meaning" of the key. The key codes are defined
in /usr/include/linux/input.h.
If some of your keys on your keyboard are not working at all, or produce the
wrong effect, then a very likely cause of this is that the scan code -> key
code mapping is incorrect on your computer.
== Structure ==
udev-keymap consists of the following parts:
keymaps/*:: mappings of scan codes to key code names
95-keymap.rules:: udev rules for mapping system vendor/product names and
input module names to one of the keymaps above
keymap:: manipulate an evdev input device:
* write a key map file into a device (used by udev rules)
* dump current scan → key code mapping
* interactively display scan and key codes of pressed keys
findkeyboards:: display evdev input devices which belong to actual keyboards,
i. e. those suitable for the keymap program
fdi2rules.py:: convert hal keymap FDIs into udev rules and key map files
(Please note that this is far from perfect, since the mapping between fdi and
udev rules is not straightforward, and impossible in some cases.)
== Fixing broken keys ==
In order to make a broken key work on your system and send it back to upstream
for inclusion you need to do the following steps:
1. Find the keyboard device.
Run /usr/lib/udev/findkeyboards. This should always give you an "AT
keyboard" and possibly a "module". Some laptops (notably Thinkpads, Sonys, and
Acers) have multimedia/function keys on a separate input device instead of the
primary keyboard. The keyboard device should have a name like "input/event3".
In the following commands, the name will be written as "input/eventX" (replace
X with the appropriate number).
2. Find broken scan codes:
sudo /usr/lib/udev/keymap -i input/eventX
Press all multimedia/function keys and check if the key name that gets printed
out is plausible. If it is unknown or wrong, write down the scan code (looks
like "0x1E") and the intended functionality of this key. Look in
/usr/include/linux/input.h for an available KEY_XXXXX constant which most
closely approximates this functionality and write it down as the new key code.
For example, you might press a key labeled "web browser" which currently
produces "unknown". Note down this:
0x1E www # Fn+F2 web browser
Repeat that for all other keys. Write the resulting list into a file. Look at
/usr/lib/udev/keymaps/ for existing key map files and make sure that you use the
same structure.
If the key only ever works once and then your keyboard (or the entire desktop)
gets stuck for a long time, then it is likely that the BIOS fails to send a
corresponding "key release" event after the key press event. Please note down
this case as well, as it can be worked around in
/usr/lib/udev/keymaps/95-keyboard-force-release.rules .
3. Find out your system vendor and product:
cat /sys/class/dmi/id/sys_vendor
cat /sys/class/dmi/id/product_name
4. Generate a device dump with "udevadm info --export-db > /tmp/udev-db.txt".
6. Send the system vendor/product names, the key mapping from step 2,
and /tmp/udev-db.txt from step 4 to the linux-hotplug@vger.kernel.org mailing
list, so that they can be included in the next release.
For local testing, copy your map file to /usr/lib/udev/keymaps/ with an appropriate
name, and add an appropriate udev rule to /usr/lib/udev/rules.d/95-keymap.rules:
* If you selected an "AT keyboard", add the rule to the section after
'LABEL="keyboard_vendorcheck"'.
* If you selected a "module", add the rule to the top section where the
"ThinkPad Extra Buttons" are.
== Author ==
keymap is written and maintained by Martin Pitt <martin.pitt@ubuntu.com>.
没有合适的资源?快使用搜索试试~ 我知道了~
libudev库源码,有需要的可以下载编译。
共210个文件
c:50个
rules:21个
h:14个
需积分: 5 43 下载量 31 浏览量
2022-06-14
08:52:32
上传
评论 1
收藏 593KB ZIP 举报
温馨提示
libudev库源码,有需要的可以下载编译。做usb驱动的时候非常有用,不管是什么样的平台和系统硬件,只要一次编译即可用。
资源详情
资源评论
资源推荐
收起资源包目录
libudev库源码,有需要的可以下载编译。 (210个子文件)
inventec-symphony_6.0_7.0 22B
configure.ac 10KB
acer 649B
acer-aspire_5720 163B
acer-aspire_5920g 78B
acer-aspire_6920 86B
acer-aspire_8930 157B
acer-travelmate_c300 110B
Makefile.am 21KB
Makefile.am 4KB
Makefile.am 3KB
asus 40B
udev-rules.c 113KB
udevd.c 64KB
libudev-device.c 60KB
udev-event.c 41KB
cdrom_id.c 39KB
scsi_serial.c 38KB
libudev-enumerate.c 33KB
libudev-monitor.c 32KB
ata_id.c 29KB
gudevdevice.c 26KB
scsi_id.c 22KB
udevadm-info.c 22KB
udev-builtin-usb_id.c 18KB
test-libudev.c 18KB
udev-builtin-path_id.c 17KB
gudevclient.c 16KB
libudev-util.c 15KB
udev-node.c 15KB
libudev-queue-private.c 15KB
udev-ctrl.c 14KB
keymap.c 14KB
libudev-queue.c 14KB
sd-daemon.c 14KB
libudev.c 13KB
collect.c 13KB
gudevenumerator.c 13KB
udevadm-monitor.c 11KB
accelerometer.c 11KB
libudev-list.c 10KB
udevadm-trigger.c 10KB
udev-builtin-input_id.c 9KB
udevadm-settle.c 9KB
udev-builtin-hwdb.c 7KB
libudev-device-private.c 7KB
udev-builtin-blkid.c 7KB
libudev-util-private.c 7KB
udevadm-control.c 6KB
udevadm-test.c 6KB
create_floppy_devices.c 6KB
udev-builtin-firmware.c 6KB
udev-watch.c 5KB
udevadm.c 5KB
udev-builtin-kmod.c 4KB
udev-builtin.c 4KB
test-udev.c 4KB
udevadm-test-builtin.c 4KB
libudev-selinux-private.c 3KB
v4l_id.c 3KB
probe_smartmedia.c 3KB
mtd_probe.c 1KB
ChangeLog 223KB
common-volume-keys 45B
compaq-e_evo 54B
udev.conf 44B
COPYING 26KB
COPYING 26KB
COPYING 18KB
dell 1KB
dell-latitude-xt2 115B
dell-touchpad 5B
dell-xps 5B
everex-xt5000 139B
findkeyboards 3KB
fujitsu-amilo_li_2732 152B
fujitsu-amilo_pa_2548 41B
fujitsu-amilo_pro_edition_v3505 101B
fujitsu-amilo_pro_v3205 82B
fujitsu-amilo_si_1520 84B
fujitsu-esprimo_mobile_v5 70B
fujitsu-esprimo_mobile_v6 38B
rule_generator.functions 3KB
genius-slimstar-320 720B
.gitignore 402B
.gitignore 259B
.gitignore 233B
.gitignore 139B
.gitignore 88B
.gitignore 47B
.gitignore 29B
.gitignore 18B
.gitignore 5B
sd-daemon.h 11KB
libudev-private.h 11KB
libudev.h 9KB
udev.h 8KB
gudevdevice.h 6KB
gudevenumerator.h 5KB
gudevclient.h 4KB
共 210 条
- 1
- 2
- 3
打工人靓仔
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0