41 |
static int min_keycode; |
static int min_keycode; |
42 |
static uint16 remote_modifier_state = 0; |
static uint16 remote_modifier_state = 0; |
43 |
|
|
44 |
|
static void update_modifier_state(uint16 modifiers, BOOL pressed); |
45 |
|
|
46 |
static void |
static void |
47 |
add_to_keymap(char *keyname, uint8 scancode, uint16 modifiers, char *mapname) |
add_to_keymap(char *keyname, uint8 scancode, uint16 modifiers, char *mapname) |
48 |
{ |
{ |
309 |
case XK_Multi_key: |
case XK_Multi_key: |
310 |
return True; |
return True; |
311 |
break; |
break; |
312 |
|
case XK_Num_Lock: |
313 |
|
return True; |
314 |
|
break; |
315 |
default: |
default: |
316 |
break; |
break; |
317 |
} |
} |
377 |
!= MASK_HAS_BITS(remote_modifier_state, MapNumLockMask)) |
!= MASK_HAS_BITS(remote_modifier_state, MapNumLockMask)) |
378 |
{ |
{ |
379 |
/* The remote modifier state is not correct */ |
/* The remote modifier state is not correct */ |
380 |
DEBUG_KBD(("Remote NumLock state is incorrect. Toggling\n")); |
uint16 new_remote_state = 0; |
381 |
|
|
382 |
if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask)) |
if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask)) |
383 |
{ |
{ |
384 |
/* Needs this modifier. Toggle */ |
DEBUG_KBD(("Remote NumLock state is incorrect, activating NumLock.\n")); |
385 |
rdp_send_scancode(ev_time, RDP_KEYPRESS, SCANCODE_CHAR_NUMLOCK); |
new_remote_state |= KBD_FLAG_NUMLOCK; |
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_NUMLOCK); |
|
386 |
} |
} |
387 |
else |
else |
388 |
{ |
{ |
389 |
/* Should not use this modifier. Toggle */ |
DEBUG_KBD(("Remote NumLock state is incorrect, deactivating NumLock.\n")); |
|
rdp_send_scancode(ev_time, RDP_KEYPRESS, SCANCODE_CHAR_NUMLOCK); |
|
|
rdp_send_scancode(ev_time, RDP_KEYRELEASE, SCANCODE_CHAR_NUMLOCK); |
|
390 |
} |
} |
|
} |
|
391 |
|
|
392 |
|
rdp_send_input(0, RDP_INPUT_SYNCHRONIZE, 0, new_remote_state, 0); |
393 |
|
update_modifier_state(SCANCODE_CHAR_NUMLOCK, True); |
394 |
|
} |
395 |
} |
} |
396 |
|
|
397 |
|
|