mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 15:07:49 +00:00
v4l-utils: backport lircd2toml.py improvements
Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
parent
ee53cf2834
commit
555694769d
@ -0,0 +1,38 @@
|
||||
From 2e1c2d2b2d69596aea953e241edb3d82764db718 Mon Sep 17 00:00:00 2001
|
||||
From: Sean Young <sean@mess.org>
|
||||
Date: Tue, 31 Dec 2019 18:24:05 +0000
|
||||
Subject: [PATCH] lircd2toml: warn when scancode has duplicate definitions
|
||||
|
||||
In lircd.conf files, it is possible that the same scancode has multiple
|
||||
key definitions. In our rc keymap toml format, one scancode can only
|
||||
have one key definition.
|
||||
|
||||
Possibly we should allow alternate names for scancode for transmitting;
|
||||
however, as a first step, we should warn if there are multiple
|
||||
definitions for the same scancode.
|
||||
|
||||
Signed-off-by: Sean Young <sean@mess.org>
|
||||
---
|
||||
contrib/lircd2toml.py | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/contrib/lircd2toml.py b/contrib/lircd2toml.py
|
||||
index 54ea12fc..ba4b14ec 100755
|
||||
--- a/contrib/lircd2toml.py
|
||||
+++ b/contrib/lircd2toml.py
|
||||
@@ -131,7 +131,11 @@ class LircdParser:
|
||||
for s in a:
|
||||
if s[0] == '#':
|
||||
break
|
||||
- codes[int(s, 0)] = k
|
||||
+ scancode = int(s, 0)
|
||||
+ if scancode in codes:
|
||||
+ self.warning("scancode 0x{:x} has duplicate definition {} and {}".format(scancode, codes[scancode], k))
|
||||
+
|
||||
+ codes[scancode] = k
|
||||
|
||||
def read_raw_codes(self):
|
||||
raw_codes = []
|
||||
--
|
||||
2.20.1
|
||||
|
Loading…
x
Reference in New Issue
Block a user