1 Star 0 Fork 8

xiaojiuwo/libinput

forked from src-anolis-os/libinput 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0005-tools-print-the-AttrEventCodeEnable-and-AttrInputPro.patch 2.56 KB
一键复制 编辑 原始数据 按行查看 历史
Zhao Hang 提交于 2021-12-27 15:14 . update to libinput-1.16.3-2.el8
From ab7b8fb32294d0923af4132e85c00d7b6c51e1d3 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 10 Nov 2020 13:32:26 +1000
Subject: [PATCH libinput 5/5] tools: print the AttrEventCodeEnable and
AttrInputPropEnable/Disable quirks
Introduced in e3c4ff3 and e882bd02
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 2c50ffab249f21f6dece2fdd0f45a6f2427f44bb)
---
tools/shared.c | 37 +++++++++++++++++++++++++++++++++----
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/tools/shared.c b/tools/shared.c
index af791274..55c48ea1 100644
--- a/tools/shared.c
+++ b/tools/shared.c
@@ -576,15 +576,15 @@ tools_exec_command(const char *prefix, int real_argc, char **real_argv)
}
static void
-sprintf_event_codes(char *buf, size_t sz, struct quirks *quirks)
+sprintf_event_codes(char *buf, size_t sz, struct quirks *quirks, enum quirk q)
{
const struct quirk_tuples *t;
size_t off = 0;
int printed;
const char *name;
- quirks_get_tuples(quirks, QUIRK_ATTR_EVENT_CODE_DISABLE, &t);
- name = quirk_get_name(QUIRK_ATTR_EVENT_CODE_DISABLE);
+ quirks_get_tuples(quirks, q, &t);
+ name = quirk_get_name(q);
printed = snprintf(buf, sz, "%s=", name);
assert(printed != -1);
off += printed;
@@ -600,6 +600,29 @@ sprintf_event_codes(char *buf, size_t sz, struct quirks *quirks)
}
}
+static void
+sprintf_input_props(char *buf, size_t sz, struct quirks *quirks, enum quirk q)
+{
+ const uint32_t *properties;
+ size_t nprops = 0;
+ size_t off = 0;
+ int printed;
+ const char *name;
+
+ quirks_get_uint32_array(quirks, q, &properties, &nprops);
+ name = quirk_get_name(q);
+ printed = snprintf(buf, sz, "%s=", name);
+ assert(printed != -1);
+ off += printed;
+
+ for (size_t i = 0; off < sz && i < nprops; i++) {
+ const char *name = libevdev_property_get_name(properties[i]);
+ printed = snprintf(buf + off, sz - off, "%s;", name);
+ assert(printed != -1);
+ off += printed;
+ }
+}
+
void
tools_list_device_quirks(struct quirks_context *ctx,
struct udev_device *device,
@@ -680,7 +703,13 @@ tools_list_device_quirks(struct quirks_context *ctx,
callback(userdata, buf);
break;
case QUIRK_ATTR_EVENT_CODE_DISABLE:
- sprintf_event_codes(buf, sizeof(buf), quirks);
+ case QUIRK_ATTR_EVENT_CODE_ENABLE:
+ sprintf_event_codes(buf, sizeof(buf), quirks, q);
+ callback(userdata, buf);
+ break;
+ case QUIRK_ATTR_INPUT_PROP_DISABLE:
+ case QUIRK_ATTR_INPUT_PROP_ENABLE:
+ sprintf_input_props(buf, sizeof(buf), quirks, q);
callback(userdata, buf);
break;
default:
--
2.31.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fang-guoyong/libinput.git
git@gitee.com:fang-guoyong/libinput.git
fang-guoyong
libinput
libinput
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385