summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2012-08-15 21:59:01 +0300
committerMarc-André Lureau <marcandre.lureau@redhat.com>2012-08-27 17:37:24 +0200
commit560d8b013569877f67445449935d98507eb868b0 (patch)
treecafdab42ab16e23dfd343dccde415d15df5cb482
parentbd10d502f8ed078102c2c16e12d6cbd17e724b13 (diff)
downloadspice-560d8b013569877f67445449935d98507eb868b0.tar.gz
spice-560d8b013569877f67445449935d98507eb868b0.tar.xz
spice-560d8b013569877f67445449935d98507eb868b0.zip
inputs: handle SPICE_MSGC_INPUTS_KEY_SCANCODE
Handle SPICE_MSGC_INPUTS_KEY_SCANCODE message, allowing arbitrary keyboard scancode sequence.
-rw-r--r--server/inputs_channel.c10
m---------spice-common0
2 files changed, 10 insertions, 0 deletions
diff --git a/server/inputs_channel.c b/server/inputs_channel.c
index acfbcff3..ada5a423 100644
--- a/server/inputs_channel.c
+++ b/server/inputs_channel.c
@@ -26,6 +26,7 @@
#include <errno.h>
#include <spice/macros.h>
#include <spice/vd_agent.h>
+#include <spice/protocol.h>
#include "common/marshaller.h"
#include "common/messages.h"
@@ -327,6 +328,14 @@ static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, ui
}
break;
}
+ case SPICE_MSGC_INPUTS_KEY_SCANCODE: {
+ uint32_t i;
+ uint8_t *code = (uint8_t *)buf;
+ for (i = 0; i < size; i++) {
+ kbd_push_scan(keyboard, code[i]);
+ }
+ break;
+ }
case SPICE_MSGC_INPUTS_MOUSE_MOTION: {
SpiceMsgcMouseMotion *mouse_motion = (SpiceMsgcMouseMotion *)buf;
@@ -618,6 +627,7 @@ void inputs_init(void)
client_cbs.migrate = inputs_migrate;
red_channel_register_client_cbs(&g_inputs_channel->base, &client_cbs);
+ red_channel_set_cap(&g_inputs_channel->base, SPICE_INPUTS_CAP_KEY_SCANCODE);
reds_register_channel(&g_inputs_channel->base);
if (!(key_modifiers_timer = core->timer_add(key_modifiers_sender, NULL))) {
diff --git a/spice-common b/spice-common
-Subproject 2c55c9d0c6a5752a16f5e22667196b461c85d4c
+Subproject 86e286ba2003c206e700fd70ec67c1cf4ac8d8a