代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/libinput 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。