summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2014-12-10 17:22:57 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2014-12-15 12:02:21 +0100
commit9f2145ac456f43ee52705beb58161c567773d816 (patch)
tree78c5f787e1528ed83385efb4661cd641df740d33
parent69f3f86ff79360d208f6f31e4914fbe3f0a14f61 (diff)
downloadspice-9f2145ac456f43ee52705beb58161c567773d816.tar.gz
spice-9f2145ac456f43ee52705beb58161c567773d816.tar.xz
spice-9f2145ac456f43ee52705beb58161c567773d816.zip
inputs: Fix key_up/key_down mismatch
When handling a KEY_UP message, the various variables were called 'key_down', and they were called 'key_up' when handling KEY_DOWN messages. This commit makes the naming consistent.
-rw-r--r--server/inputs_channel.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/inputs_channel.c b/server/inputs_channel.c
index 395b81fc..3c646268 100644
--- a/server/inputs_channel.c
+++ b/server/inputs_channel.c
@@ -331,16 +331,16 @@ static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, ui
spice_assert(g_inputs_channel == inputs_channel);
switch (type) {
case SPICE_MSGC_INPUTS_KEY_DOWN: {
- SpiceMsgcKeyDown *key_up = (SpiceMsgcKeyDown *)buf;
- if (key_up->code == CAPS_LOCK_SCAN_CODE || key_up->code == NUM_LOCK_SCAN_CODE ||
- key_up->code == SCROLL_LOCK_SCAN_CODE) {
+ SpiceMsgcKeyDown *key_down = (SpiceMsgcKeyDown *)buf;
+ if (key_down->code == CAPS_LOCK_SCAN_CODE || key_down->code == NUM_LOCK_SCAN_CODE ||
+ key_down->code == SCROLL_LOCK_SCAN_CODE) {
activate_modifiers_watch();
}
}
case SPICE_MSGC_INPUTS_KEY_UP: {
- SpiceMsgcKeyDown *key_down = (SpiceMsgcKeyDown *)buf;
+ SpiceMsgcKeyUp *key_up = (SpiceMsgcKeyUp *)buf;
for (i = 0; i < 4; i++) {
- uint8_t code = (key_down->code >> (i * 8)) & 0xff;
+ uint8_t code = (key_up->code >> (i * 8)) & 0xff;
if (code == 0) {
break;
}