270 |
Screen *screen; |
Screen *screen; |
271 |
uint16 test; |
uint16 test; |
272 |
int i; |
int i; |
273 |
|
XEvent xevent; |
274 |
|
|
275 |
x_socket = ConnectionNumber(display); |
x_socket = ConnectionNumber(display); |
276 |
screen = DefaultScreenOfDisplay(display); |
screen = DefaultScreenOfDisplay(display); |
355 |
|
|
356 |
xkeymap_init2(); |
xkeymap_init2(); |
357 |
|
|
358 |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask; |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | |
359 |
|
VisibilityChangeMask | FocusChangeMask; |
360 |
if (grab_keyboard) |
if (grab_keyboard) |
361 |
input_mask |= EnterWindowMask | LeaveWindowMask; |
input_mask |= EnterWindowMask | LeaveWindowMask; |
362 |
if (sendmotion) |
if (sendmotion) |
377 |
|
|
378 |
XMapWindow(display, wnd); |
XMapWindow(display, wnd); |
379 |
|
|
380 |
|
/* Wait for VisibilityNotify Event */ |
381 |
|
for (;;) { |
382 |
|
XNextEvent(display, &xevent); |
383 |
|
if (xevent.type == VisibilityNotify) |
384 |
|
break; |
385 |
|
} |
386 |
|
|
387 |
|
/* clear the window so that cached data is not viewed upon start... */ |
388 |
|
XSetBackground(display, gc, 0); |
389 |
|
XSetForeground(display, gc, 0); |
390 |
|
FILL_RECTANGLE(0, 0, width, height); |
391 |
|
|
392 |
return True; |
return True; |
393 |
} |
} |
394 |
|
|
433 |
{ |
{ |
434 |
if (enable_compose && (XFilterEvent(&xevent, None) == True)) |
if (enable_compose && (XFilterEvent(&xevent, None) == True)) |
435 |
{ |
{ |
436 |
DEBUG_KBD("Filtering event\n"); |
DEBUG_KBD(("Filtering event\n")); |
437 |
continue; |
continue; |
438 |
} |
} |
439 |
|
|
459 |
else |
else |
460 |
{ |
{ |
461 |
/* Plain old XLookupString */ |
/* Plain old XLookupString */ |
462 |
DEBUG_KBD("No input context, using XLookupString\n"); |
DEBUG_KBD(("No input context, using XLookupString\n")); |
463 |
XLookupString((XKeyEvent *) & xevent, |
XLookupString((XKeyEvent *) & xevent, |
464 |
str, sizeof(str), &keysym, NULL); |
str, sizeof(str), &keysym, NULL); |
465 |
} |
} |
466 |
|
|
467 |
ksname = get_ksname(keysym); |
ksname = get_ksname(keysym); |
468 |
DEBUG_KBD("\nKeyPress for (keysym 0x%lx, %s)\n", keysym, ksname); |
DEBUG_KBD(("\nKeyPress for (keysym 0x%lx, %s)\n", keysym, ksname)); |
469 |
|
|
470 |
if (inhibit_key(keysym)) |
if (inhibit_key(keysym)) |
471 |
{ |
{ |
472 |
DEBUG_KBD("Inhibiting key\n"); |
DEBUG_KBD(("Inhibiting key\n")); |
473 |
break; |
break; |
474 |
} |
} |
475 |
|
|
488 |
sizeof(str), &keysym, NULL); |
sizeof(str), &keysym, NULL); |
489 |
|
|
490 |
ksname = get_ksname(keysym); |
ksname = get_ksname(keysym); |
491 |
DEBUG_KBD("\nKeyRelease for (keysym 0x%lx, %s)\n", keysym, ksname); |
DEBUG_KBD(("\nKeyRelease for (keysym 0x%lx, %s)\n", keysym, |
492 |
|
ksname)); |
493 |
|
|
494 |
if (inhibit_key(keysym)) |
if (inhibit_key(keysym)) |
495 |
break; |
break; |
531 |
|
|
532 |
case FocusOut: |
case FocusOut: |
533 |
/* reset keys */ |
/* reset keys */ |
534 |
rdp_send_input(ev_time, RDP_INPUT_SCANCODE, |
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LCTRL); |
535 |
KBD_FLAG_DOWN | KBD_FLAG_UP, SCANCODE_CHAR_LCTRL, 0); |
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LALT); |
536 |
rdp_send_input(ev_time, RDP_INPUT_SCANCODE, |
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_LSHIFT); |
537 |
KBD_FLAG_DOWN | KBD_FLAG_UP, SCANCODE_CHAR_LALT, 0); |
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RCTRL); |
538 |
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RALT); |
539 |
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_RSHIFT); |
540 |
/* fall through */ |
/* fall through */ |
541 |
case LeaveNotify: |
case LeaveNotify: |
542 |
if (grab_keyboard) |
if (grab_keyboard) |