[PATCH spice] inputs: handle SPICE_MSGC_INPUTS_KEY_SCANCODE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Handle SPICE_MSGC_INPUTS_KEY_SCANCODE message, allowing arbitrary
keyboard scancode sequence.
---
 server/inputs_channel.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/server/inputs_channel.c b/server/inputs_channel.c
index e14e995..8df657e 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"
@@ -309,6 +310,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;
 
@@ -561,6 +570,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_SCANCODE);
     reds_register_channel(&g_inputs_channel->base);
 
     if (!(key_modifiers_timer = core->timer_add(key_modifiers_sender, NULL))) {
-- 
1.7.10.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]