aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2017-10-19 14:11:58 +0100
committerDaniel P. Berrange <berrange@redhat.com>2017-10-19 14:32:11 +0100
commit13b432eb7f6adb1ed271f04f16531a91d7397e9f (patch)
tree89dac72f1f45f01051fbffd368d1441f4a905579
parent56ce5650d2c6ea216b4580df44b9a6dd3bc92c3b (diff)
downloadkeycodemapdb-13b432eb7f6adb1ed271f04f16531a91d7397e9f.zip
keycodemapdb-13b432eb7f6adb1ed271f04f16531a91d7397e9f.tar.gz
keycodemapdb-13b432eb7f6adb1ed271f04f16531a91d7397e9f.tar.bz2
Add hack for mapping qnum 0xb7 to sysrq
Historical versions of QEMU allowed both 0x54 and 0xb7 to trigger a print/sysrq key. Although 0x54 is preferred, we must cope with 0xb7 for backwards compat. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
-rwxr-xr-xtools/keymap-gen6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/keymap-gen b/tools/keymap-gen
index 51f2692..d4594b4 100755
--- a/tools/keymap-gen
+++ b/tools/keymap-gen
@@ -299,6 +299,12 @@ class Database:
self.mapto[self.MAP_QNUM][linux] = qnum
self.mapfrom[self.MAP_QNUM][qnum] = linux
+ # Hack for compatibility with previous mistakes in handling
+ # Print/SysRq. The preferred qnum for Print/SysRq is 0x54,
+ # but QEMU previously allowed 0xb7 too
+ if qnum == 0x54:
+ self.mapfrom[self.MAP_QNUM][0xb7] = self.mapfrom[self.MAP_QNUM][0x54]
+
if linux in self.mapname[self.MAP_QCODE]:
qcodeenum = self.mapname[self.MAP_QCODE][linux]
qcodeenum = "Q_KEY_CODE_" + qcodeenum.upper()