aboutsummaryrefslogtreecommitdiffstats
path: root/vnc.c
diff options
context:
space:
mode:
authorkraxel <kraxel>2006-10-25 15:07:04 +0000
committerkraxel <kraxel>2006-10-25 15:07:04 +0000
commit6caa675a9500d283d31dfb7a5eb87f4950731592 (patch)
tree9201dd2a0a5a0c28954c212b18aa6c8b2f7c6cc6 /vnc.c
parente4309b4efef95f8f7a617c529642c29ccbf46690 (diff)
downloadxenwatch-6caa675a9500d283d31dfb7a5eb87f4950731592.tar.gz
make kbd handling configurable
Diffstat (limited to 'vnc.c')
-rw-r--r--vnc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/vnc.c b/vnc.c
index e563f64..2749012 100644
--- a/vnc.c
+++ b/vnc.c
@@ -289,8 +289,11 @@ static gboolean key_cb(GtkWidget *widget, GdkEventKey *event,
int keydown;
keydown = (8 == event->type);
- if (event->hardware_keycode < linux_us_kbd_size)
+ if (vnc->keysyms)
+ keysym = event->keyval;
+ else if (event->hardware_keycode < linux_us_kbd_size)
keysym = linux_us_kbd[event->hardware_keycode];
+
if (keysym)
SendKeyEvent(vnc->client, keysym, keydown ? TRUE : FALSE);
else
@@ -302,7 +305,8 @@ static gboolean key_cb(GtkWidget *widget, GdkEventKey *event,
/* ------------------------------------------------------------------ */
/* public API functions */
-struct vnc_window* vnc_open(char *hostname, int displayno, int standalone)
+struct vnc_window* vnc_open(char *hostname, int displayno,
+ int standalone, int keysyms)
{
char display[128];
char *argv[] = { "vnc-client", display, NULL };
@@ -315,6 +319,7 @@ struct vnc_window* vnc_open(char *hostname, int displayno, int standalone)
goto err;
memset(vnc,0,sizeof(*vnc));
vnc->standalone = standalone;
+ vnc->keysyms = keysyms;
/* x11 */
vnc->dpy = gdk_x11_display_get_xdisplay(gdk_display_get_default());