gpt4 book ai didi

linux - 如何禁用 yocto 中的某些键盘键

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:14:24 26 4
gpt4 key购买 nike

我想在 yocto 中创建图像时禁用某些键。我知道以用户的速度我们可以使用 xmodmap 实用程序实现这一点,但我想自己实现这个内核。

我检查了 drivers/try/vt/defkeymap.map 文件并根据我的要求进行了修改,但 loadkeys 无法生成 defkeymap.c 文件。它抛出这个错误:

/bin/sh: 1: loadkeys: not found.

我的方向是否正确?或者是否有任何其他选项可以更改默认键码映射?

最佳答案

原始键盘数据是扫描码,键盘驱动程序将其转换为键码 cf https://unix.stackexchange.com/questions/319787/how-does-the-linux-kernel-handle-keyboards-inputs-outputs .为控制台生成自定义键盘布局的方法在 https://wiki.archlinux.org/index.php/Linux_console/Keyboard_configuration#Creating_a_custom_keymap 中。 , 所以你不编辑驱动程序文件,loadkeys 需要在特定目录/文件中进行更改:

As a side note, it is worth noting that such a personal keymap is useful also to redefine the behaviour of keys already treated by the default keymap: when loaded with loadkeys, the directives in the default keymap will be replaced when they conflict with the new directives and conserved otherwise. This way, only changes to the keymap must be specified in the personal keymap.

来源:https://wiki.archlinux.org/index.php/Linux_console/Keyboard_configuration#Creating_a_custom_keymap

如果您想在内核模块级别执行此操作,则必须重写或修补整个键盘模块。

https://unix.stackexchange.com/questions/319787/how-does-the-linux-kernel-handle-keyboards-inputs-outputs是所有级别的许多基本信息(源代码链接,...),包括在内核模块级别解决此问题(编写/修补内核模块)

关于linux - 如何禁用 yocto 中的某些键盘键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55390068/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com