25 |
#define XK_MISCELLANY |
#define XK_MISCELLANY |
26 |
#include <X11/keysymdef.h> |
#include <X11/keysymdef.h> |
27 |
#include "rdesktop.h" |
#include "rdesktop.h" |
28 |
|
#include "scancodes.h" |
29 |
|
|
30 |
extern int width; |
extern int width; |
31 |
extern int height; |
extern int height; |
32 |
extern BOOL sendmotion; |
extern BOOL sendmotion; |
33 |
extern BOOL fullscreen; |
extern BOOL fullscreen; |
34 |
|
extern BOOL grab_keyboard; |
35 |
|
|
36 |
Display *display = NULL; |
Display *display = NULL; |
37 |
static int x_socket; |
static int x_socket; |
349 |
|
|
350 |
input_mask = |
input_mask = |
351 |
KeyPressMask | KeyReleaseMask | ButtonPressMask | |
KeyPressMask | KeyReleaseMask | ButtonPressMask | |
352 |
ButtonReleaseMask | EnterWindowMask | LeaveWindowMask; |
ButtonReleaseMask; |
353 |
|
if (grab_keyboard) |
354 |
|
input_mask |= EnterWindowMask | LeaveWindowMask; |
355 |
if (sendmotion) |
if (sendmotion) |
356 |
input_mask |= PointerMotionMask; |
input_mask |= PointerMotionMask; |
357 |
|
|
522 |
xevent.xmotion.y); |
xevent.xmotion.y); |
523 |
break; |
break; |
524 |
|
|
525 |
|
case FocusIn: |
526 |
|
/* fall through */ |
527 |
case EnterNotify: |
case EnterNotify: |
528 |
XGrabKeyboard(display, wnd, True, |
if (grab_keyboard) |
529 |
GrabModeAsync, GrabModeAsync, |
XGrabKeyboard(display, wnd, True, |
530 |
CurrentTime); |
GrabModeAsync, GrabModeAsync, |
531 |
|
CurrentTime); |
532 |
break; |
break; |
533 |
|
|
534 |
|
case FocusOut: |
535 |
|
/* reset keys */ |
536 |
|
rdp_send_input(ev_time, RDP_INPUT_SCANCODE, |
537 |
|
KBD_FLAG_DOWN | KBD_FLAG_UP, |
538 |
|
SCANCODE_CHAR_LCTRL, 0); |
539 |
|
rdp_send_input(ev_time, RDP_INPUT_SCANCODE, |
540 |
|
KBD_FLAG_DOWN | KBD_FLAG_UP, |
541 |
|
SCANCODE_CHAR_LALT, 0); |
542 |
|
/* fall through */ |
543 |
case LeaveNotify: |
case LeaveNotify: |
544 |
XUngrabKeyboard(display, CurrentTime); |
if (grab_keyboard) |
545 |
|
XUngrabKeyboard(display, CurrentTime); |
546 |
break; |
break; |
547 |
|
|
548 |
case Expose: |
case Expose: |