aboutsummaryrefslogtreecommitdiff
path: root/ui/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/input.c')
-rw-r--r--ui/input.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ui/input.c b/ui/input.c
index 4e821f8..3e2d324 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -353,6 +353,20 @@ void qemu_input_event_send(QemuConsole *src, InputEvent *evt)
assert(!(evt->type == INPUT_EVENT_KIND_KEY &&
evt->u.key.data->key->type == KEY_VALUE_KIND_NUMBER));
+
+ /*
+ * 'sysrq' was mistakenly added to hack around the fact that
+ * the ps2 driver was not generating correct scancodes sequences
+ * when 'alt+print' was pressed. This flaw is now fixed and the
+ * 'sysrq' key serves no further purpose. We normalize it to
+ * 'print', so that downstream receivers of the event don't
+ * neeed to deal with this mistake
+ */
+ if (evt->type == INPUT_EVENT_KIND_KEY &&
+ evt->u.key.data->key->u.qcode.data == Q_KEY_CODE_SYSRQ) {
+ evt->u.key.data->key->u.qcode.data = Q_KEY_CODE_PRINT;
+ }
+
if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
return;
}