summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAric Stewart <aric@codeweavers.com>2012-09-26 10:01:31 -0500
committerJeremy White <jwhite@codeweavers.com>2012-09-26 10:22:42 -0500
commit2e5ef9b93de8e769f3050171161b2e18dcb294e2 (patch)
tree57cdde5e7c28e7e793c135c9192cdd190b1e2041
parent591269e398d74d6d30546aefe1732ef973a69157 (diff)
Discard input messages until input channel is ready
Signed-off-by: Aric Stewart <aric@codeweavers.com>
-rw-r--r--inputs.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/inputs.js b/inputs.js
index 57ee626..4d3b28f 100644
--- a/inputs.js
+++ b/inputs.js
@@ -86,7 +86,7 @@ function handle_mousemove(e)
move = new SpiceMsgcMouseMotion(this.sc, e)
msg.build_msg(SPICE_MSGC_INPUTS_MOUSE_MOTION, move);
}
- if (this.sc && this.sc.inputs)
+ if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
{
if (this.sc.inputs.waiting_for_ack < (2 * SPICE_INPUT_MOTION_ACK_BUNCH))
{
@@ -105,7 +105,7 @@ function handle_mousedown(e)
var press = new SpiceMsgcMousePress(this.sc, e)
var msg = new SpiceMiniData();
msg.build_msg(SPICE_MSGC_INPUTS_MOUSE_PRESS, press);
- if (this.sc && this.sc.inputs)
+ if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
this.sc.inputs.send_msg(msg);
e.preventDefault();
@@ -122,7 +122,7 @@ function handle_mouseup(e)
var release = new SpiceMsgcMouseRelease(this.sc, e)
var msg = new SpiceMiniData();
msg.build_msg(SPICE_MSGC_INPUTS_MOUSE_RELEASE, release);
- if (this.sc && this.sc.inputs)
+ if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
this.sc.inputs.send_msg(msg);
e.preventDefault();
@@ -141,11 +141,11 @@ function handle_mousewheel(e)
var msg = new SpiceMiniData();
msg.build_msg(SPICE_MSGC_INPUTS_MOUSE_PRESS, press);
- if (this.sc && this.sc.inputs)
+ if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
this.sc.inputs.send_msg(msg);
msg.build_msg(SPICE_MSGC_INPUTS_MOUSE_RELEASE, release);
- if (this.sc && this.sc.inputs)
+ if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
this.sc.inputs.send_msg(msg);
e.preventDefault();
@@ -157,7 +157,7 @@ function handle_keydown(e)
var msg = new SpiceMiniData();
check_and_update_modifiers(e, key.code, this.sc);
msg.build_msg(SPICE_MSGC_INPUTS_KEY_DOWN, key);
- if (this.sc && this.sc.inputs)
+ if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
this.sc.inputs.send_msg(msg);
e.preventDefault();
@@ -169,7 +169,7 @@ function handle_keyup(e)
var msg = new SpiceMiniData();
check_and_update_modifiers(e, key.code, this.sc);
msg.build_msg(SPICE_MSGC_INPUTS_KEY_UP, key);
- if (this.sc && this.sc.inputs)
+ if (this.sc && this.sc.inputs && this.sc.inputs.state === "ready")
this.sc.inputs.send_msg(msg);
e.preventDefault();
@@ -221,7 +221,7 @@ function check_and_update_modifiers(e, code, sc)
else if (code === (0x80|0xE0B5))
Meta_state = false;
- if (sc && sc.inputs)
+ if (sc && sc.inputs && sc.inputs.state === "ready")
{
if (Shift_state != e.shiftKey)
{