[gtk-vnc] Change vnc_connection_key_event to use a boolean



commit 096aea057f55da8f50382e9bb691fb4f210eb04b
Author: Daniel P. Berrange <dan berrange com>
Date:   Mon Jul 5 21:42:55 2010 +0100

    Change vnc_connection_key_event to use a boolean
    
    Use a boolean for the down flag in the vnc_connection_key_event#
    API.

 src/vncconnection.c |    6 +++---
 src/vncconnection.h |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/vncconnection.c b/src/vncconnection.c
index 76bb060..a64cab4 100644
--- a/src/vncconnection.c
+++ b/src/vncconnection.c
@@ -1484,7 +1484,7 @@ gboolean vnc_connection_framebuffer_update_request(VncConnection *conn,
 }
 
 
-gboolean vnc_connection_key_event(VncConnection *conn, guint8 down_flag,
+gboolean vnc_connection_key_event(VncConnection *conn, gboolean down_flag,
 				  guint32 key, guint16 scancode)
 {
 	VncConnectionPrivate *priv = conn->priv;
@@ -1494,12 +1494,12 @@ gboolean vnc_connection_key_event(VncConnection *conn, guint8 down_flag,
 	if (priv->has_ext_key_event) {
 		vnc_connection_buffered_write_u8(conn, 255);
 		vnc_connection_buffered_write_u8(conn, 0);
-		vnc_connection_buffered_write_u16(conn, down_flag);
+		vnc_connection_buffered_write_u16(conn, down_flag ? 1 : 0);
 		vnc_connection_buffered_write_u32(conn, key);
 		vnc_connection_buffered_write_u32(conn, scancode);
 	} else {
 		vnc_connection_buffered_write_u8(conn, 4);
-		vnc_connection_buffered_write_u8(conn, down_flag);
+		vnc_connection_buffered_write_u8(conn, down_flag ? 1 : 0);
 		vnc_connection_buffered_write(conn, pad, 2);
 		vnc_connection_buffered_write_u32(conn, key);
 	}
diff --git a/src/vncconnection.h b/src/vncconnection.h
index 9ddb6f4..6f5f7b1 100644
--- a/src/vncconnection.h
+++ b/src/vncconnection.h
@@ -168,7 +168,7 @@ gboolean vnc_connection_client_cut_text(VncConnection *conn,
 gboolean vnc_connection_pointer_event(VncConnection *conn, guint8 button_mask,
 				      guint16 x, guint16 y);
 
-gboolean vnc_connection_key_event(VncConnection *conn, guint8 down_flag,
+gboolean vnc_connection_key_event(VncConnection *conn, gboolean down_flag,
 				  guint32 key, guint16 scancode);
 
 gboolean vnc_connection_framebuffer_update_request(VncConnection *conn,



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