diff options
author | runge <runge> | 2006-06-03 20:49:09 +0000 |
---|---|---|
committer | runge <runge> | 2006-06-03 20:49:09 +0000 |
commit | 203eee7cfdb70556125f959d3b548fbd1213d8d2 (patch) | |
tree | d1da7e1014d58f2e7c44bda9b23652b4286a8887 /x11vnc/linuxfb.c | |
parent | 8417618289bd95663789bb67d841800f166c57a0 (diff) | |
download | libtdevnc-203eee7cfdb70556125f959d3b548fbd1213d8d2.tar.gz libtdevnc-203eee7cfdb70556125f959d3b548fbd1213d8d2.zip |
x11vnc: -capslock -skip_lockkeys; Alt keys under -rawfb cons.
Diffstat (limited to 'x11vnc/linuxfb.c')
-rw-r--r-- | x11vnc/linuxfb.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/x11vnc/linuxfb.c b/x11vnc/linuxfb.c index 2f4e0be..c190feb 100644 --- a/x11vnc/linuxfb.c +++ b/x11vnc/linuxfb.c @@ -142,7 +142,7 @@ char *console_guess(char *str, int *fd) { } void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { - static int control = 0; + static int control = 0, alt = 0; if (debug_keyboard) fprintf(stderr, "console_key_command: %d %s\n", (int) keysym, down ? "down" : "up"); if (pipeinput_cons_fd < 0) { return; @@ -159,6 +159,16 @@ void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { } return; } + if (keysym == XK_Alt_L || keysym == XK_Alt_R) { + if (! down) { + if (alt > 0) { + alt--; + } + } else { + alt++; + } + return; + } if (!down) { return; } @@ -166,6 +176,7 @@ void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { keysym = 27; } if (control) { + /* shift down to the "control" zone */ if (keysym >= 'a' && keysym <= 'z') { keysym -= ('a' - 1); } else if (keysym >= 'A' && keysym <= 'Z') { @@ -173,10 +184,16 @@ void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { } else { keysym = 0xffff; } + } else if (alt) { + /* shift up to the upper half Latin zone */ + if (keysym >= '!' && keysym <= '~') { + keysym += 128; + } } + if (debug_keyboard) fprintf(stderr, "keysym now: %d\n", (int) keysym); if (keysym == XK_Tab) { keysym = '\t'; - } else if (keysym == XK_Return) { + } else if (keysym == XK_Return || keysym == XK_KP_Enter) { keysym = '\r'; } else if (keysym == XK_BackSpace) { keysym = 8; @@ -196,6 +213,10 @@ void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { keysym = 2; } else if (keysym == XK_Prior || keysym == XK_KP_Prior) { keysym = 2; + } else { + if (keysym >= XK_KP_Multiply && keysym <= XK_KP_Equal) { + keysym -= 0xFF80; + } } #if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(TIOCSTI) if (keysym < 0x100) { |