diff -urN rdesktop-1.1.0.org/Makefile rdesktop-1.1.0/Makefile --- rdesktop-1.1.0.org/Makefile Mon Oct 7 18:24:27 2002 +++ rdesktop-1.1.0/Makefile Mon Oct 7 18:26:41 2002 @@ -6,8 +6,9 @@ # Configuration defaults -CC = cc -CFLAGS = -O2 +OPT = -fexpensive-optimizations -ffast-math -mcpu=i686 -malign-functions=2 -malign-jumps=2 -malign-loops=2 -fomit-frame-pointer +CC = gcc +CFLAGS = -O3 $(OPT) INCLUDES = -I/usr/X11R6/include LDLIBS = -L/usr/X11R6/lib -lX11 diff -urN rdesktop-1.1.0.org/configure rdesktop-1.1.0/configure --- rdesktop-1.1.0.org/configure Mon Oct 7 18:24:27 2002 +++ rdesktop-1.1.0/configure Mon Oct 7 18:27:16 2002 @@ -6,7 +6,7 @@ # echo "# Generated by $0 $*" >Makeconf -[ -n "$CFLAGS" ] && echo "CFLAGS = $CFLAGS" >>Makeconf +[ -n "$CFLAGS" ] && echo "CFLAGS = $CFLAGS \$(OPT)" >>Makeconf for arg in $*; do optarg=`echo $arg | sed 's/[-a-z]*=//'` diff -urN rdesktop-1.1.0.org/constants.h rdesktop-1.1.0/constants.h --- rdesktop-1.1.0.org/constants.h Fri Sep 14 12:38:39 2001 +++ rdesktop-1.1.0/constants.h Mon Oct 7 18:27:53 2002 @@ -157,6 +157,10 @@ #define MOUSE_FLAG_BUTTON1 0x1000 #define MOUSE_FLAG_BUTTON2 0x2000 #define MOUSE_FLAG_BUTTON3 0x4000 +/* normal wheel +#define MOUSE_FLAG_BUTTON4 0x0210 +*/ +#define MOUSE_FLAG_BUTTON4 0x0240 /* accelated wheel ? */ #define MOUSE_FLAG_DOWN 0x8000 /* Raster operation masks */ diff -urN rdesktop-1.1.0.org/rdesktop.c rdesktop-1.1.0/rdesktop.c --- rdesktop-1.1.0.org/rdesktop.c Mon Oct 7 18:24:27 2002 +++ rdesktop-1.1.0/rdesktop.c Mon Oct 7 18:32:15 2002 @@ -250,11 +250,17 @@ } else { - width = 800; - height = 600; + width = 1024; + height = 768; } } + /* if LANG variable is ko or ko_KR.eucKR */ + if ( ! strncmp((char *) getenv ("LANG"),"ko",2)) + { + keylayout = 0x412; + } + strcpy(title, "rdesktop - "); strncat(title, server, sizeof(title) - sizeof("rdesktop - ")); diff -urN rdesktop-1.1.0.org/secure.c rdesktop-1.1.0/secure.c --- rdesktop-1.1.0.org/secure.c Sat Sep 15 18:37:12 2001 +++ rdesktop-1.1.0/secure.c Mon Oct 7 18:32:56 2002 @@ -414,6 +414,7 @@ out_uint16_le(s, height); out_uint16_le(s, 0xca01); out_uint16_le(s, 0xaa03); + if (keylayout==0x412) keylayout |= 0xe0010000; /* M$ hangul IME */ out_uint32_le(s, keylayout); out_uint32_le(s, 419); /* client build? we are 419 compatible :-) */ diff -urN rdesktop-1.1.0.org/xwin.c rdesktop-1.1.0/xwin.c --- rdesktop-1.1.0.org/xwin.c Sat Sep 15 23:30:44 2001 +++ rdesktop-1.1.0/xwin.c Mon Oct 7 18:40:26 2002 @@ -360,6 +360,10 @@ return 0xff; /* real scancode is 5c */ case 0x75: /* menu key */ return 0x5d | 0x80; + case 0x79: /* hanja key */ + return 0xf1; + case 0x7a: /* korean/english key */ + return 0xf2; } return 0; @@ -376,6 +380,10 @@ return MOUSE_FLAG_BUTTON3; case Button3: /* right */ return MOUSE_FLAG_BUTTON2; + case Button4: /* wheel up */ + return MOUSE_FLAG_BUTTON4; + case Button5: /* wheel down */ + return 0x0210; /* wrong */ } return 0; @@ -403,8 +411,28 @@ if (scancode == 0) break; - rdp_send_input(ev_time, RDP_INPUT_SCANCODE, 0, - scancode, 0); + if (scancode == 0xff) + { + /* Window keys equivalent to ctrl-esc */ + rdp_send_input(ev_time, RDP_INPUT_SCANCODE, + 0,0x1d, 0); /* ctrl down */ + rdp_send_input(ev_time, RDP_INPUT_SCANCODE, + 0,1, 0); /* esc down */ + break; + } + + if (scancode & 0x80) + rdp_send_input(ev_time, RDP_INPUT_SCANCODE, + KBD_FLAG_EXT, scancode & 0x7f, 0); + else + rdp_send_input(ev_time, RDP_INPUT_SCANCODE, 0, + scancode, 0); + + /* Handle caps lock and num lock */ + if (scancode==0x3a || scancode==0x45) + rdp_send_input(ev_time, RDP_INPUT_SCANCODE, + KBD_FLAG_DOWN | KBD_FLAG_UP, scancode, 0); + break; case KeyRelease: @@ -412,12 +440,36 @@ if (scancode == 0) break; - rdp_send_input(ev_time, RDP_INPUT_SCANCODE, - KBD_FLAG_DOWN | KBD_FLAG_UP, - scancode, 0); + if (scancode == 0xff) + { + /* Window keys equivalent to ctrl-esc */ + rdp_send_input(ev_time, RDP_INPUT_SCANCODE, + KBD_FLAG_DOWN | KBD_FLAG_UP, + 0x1, 0); /* esc up */ + rdp_send_input(ev_time, RDP_INPUT_SCANCODE, + KBD_FLAG_DOWN | KBD_FLAG_UP, + 0x1d, 0); /* ctrl up */ + break; + } + + if (scancode & 0x80) + rdp_send_input(ev_time, RDP_INPUT_SCANCODE, + KBD_FLAG_EXT | KBD_FLAG_DOWN | KBD_FLAG_UP, + scancode & 0x7f, 0); + else + rdp_send_input(ev_time, RDP_INPUT_SCANCODE, + KBD_FLAG_DOWN | KBD_FLAG_UP, scancode, 0); + break; case ButtonPress: + if (event.xbutton.button == Button5) + { + event.type = KeyPress; + event.xkey.keycode = 0x68; + XPutBackEvent(display, &event); + break; + } button = xwin_translate_mouse(event.xbutton.button); if (button == 0) break; @@ -429,6 +481,13 @@ break; case ButtonRelease: + if (event.xbutton.button == Button5) + { + event.type = KeyRelease; + event.xkey.keycode = 0x68; + XPutBackEvent(display, &event); + break; + } button = xwin_translate_mouse(event.xbutton.button); if (button == 0) break;