53 |
return; |
return; |
54 |
} |
} |
55 |
|
|
56 |
DEBUG_KBD("Adding translation, keysym=0x%x, scancode=0x%x, " |
DEBUG_KBD(("Adding translation, keysym=0x%x, scancode=0x%x, " |
57 |
"modifiers=0x%x\n", (unsigned int) keysym, scancode, modifiers); |
"modifiers=0x%x\n", (unsigned int) keysym, scancode, modifiers)); |
58 |
|
|
59 |
keymap[keysym & KEYMAP_MASK].scancode = scancode; |
keymap[keysym & KEYMAP_MASK].scancode = scancode; |
60 |
keymap[keysym & KEYMAP_MASK].modifiers = modifiers; |
keymap[keysym & KEYMAP_MASK].modifiers = modifiers; |
116 |
if (strncmp(line, "map ", 4) == 0) |
if (strncmp(line, "map ", 4) == 0) |
117 |
{ |
{ |
118 |
keylayout = strtol(line + 4, NULL, 16); |
keylayout = strtol(line + 4, NULL, 16); |
119 |
DEBUG_KBD("Keylayout 0x%x\n", keylayout); |
DEBUG_KBD(("Keylayout 0x%x\n", keylayout)); |
120 |
continue; |
continue; |
121 |
} |
} |
122 |
|
|
123 |
/* compose */ |
/* compose */ |
124 |
if (strncmp(line, "enable_compose", 15) == 0) |
if (strncmp(line, "enable_compose", 15) == 0) |
125 |
{ |
{ |
126 |
DEBUG_KBD("Enabling compose handling\n"); |
DEBUG_KBD(("Enabling compose handling\n")); |
127 |
enable_compose = True; |
enable_compose = True; |
128 |
continue; |
continue; |
129 |
} |
} |
242 |
if (tr.scancode != 0) |
if (tr.scancode != 0) |
243 |
{ |
{ |
244 |
DEBUG_KBD |
DEBUG_KBD |
245 |
("Found key translation, scancode=0x%x, modifiers=0x%x\n", |
(("Found key translation, scancode=0x%x, modifiers=0x%x\n", |
246 |
tr.scancode, tr.modifiers); |
tr.scancode, tr.modifiers)); |
247 |
return tr; |
return tr; |
248 |
} |
} |
249 |
|
|
372 |
!= MASK_HAS_BITS(remote_modifier_state, MapNumLockMask)) |
!= MASK_HAS_BITS(remote_modifier_state, MapNumLockMask)) |
373 |
{ |
{ |
374 |
/* The remote modifier state is not correct */ |
/* The remote modifier state is not correct */ |
375 |
DEBUG_KBD("Remote NumLock state is incorrect. Toggling\n"); |
DEBUG_KBD(("Remote NumLock state is incorrect. Toggling\n")); |
376 |
if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask)) |
if (MASK_HAS_BITS(tr.modifiers, MapNumLockMask)) |
377 |
{ |
{ |
378 |
/* Needs this modifier. Toggle */ |
/* Needs this modifier. Toggle */ |
394 |
update_modifier_state(uint16 modifiers, BOOL pressed) |
update_modifier_state(uint16 modifiers, BOOL pressed) |
395 |
{ |
{ |
396 |
|
|
397 |
DEBUG_KBD("Before updating modifier_state:0x%x, pressed=0x%x\n", |
DEBUG_KBD(("Before updating modifier_state:0x%x, pressed=0x%x\n", |
398 |
remote_modifier_state, pressed); |
remote_modifier_state, pressed)); |
399 |
switch (modifiers) |
switch (modifiers) |
400 |
{ |
{ |
401 |
case SCANCODE_CHAR_LSHIFT: |
case SCANCODE_CHAR_LSHIFT: |
436 |
} |
} |
437 |
break; |
break; |
438 |
} |
} |
439 |
DEBUG_KBD("After updating modifier_state:0x%x\n", remote_modifier_state); |
DEBUG_KBD(("After updating modifier_state:0x%x\n", remote_modifier_state)); |
440 |
|
|
441 |
} |
} |
442 |
|
|
448 |
|
|
449 |
if (scancode & SCANCODE_EXTENDED) |
if (scancode & SCANCODE_EXTENDED) |
450 |
{ |
{ |
451 |
DEBUG_KBD("Sending extended scancode=0x%x, flags=0x%x\n", |
DEBUG_KBD(("Sending extended scancode=0x%x, flags=0x%x\n", |
452 |
scancode & ~SCANCODE_EXTENDED, flags); |
scancode & ~SCANCODE_EXTENDED, flags)); |
453 |
rdp_send_input(time, RDP_INPUT_SCANCODE, flags | KBD_FLAG_EXT, |
rdp_send_input(time, RDP_INPUT_SCANCODE, flags | KBD_FLAG_EXT, |
454 |
scancode & ~SCANCODE_EXTENDED, 0); |
scancode & ~SCANCODE_EXTENDED, 0); |
455 |
} |
} |
456 |
else |
else |
457 |
{ |
{ |
458 |
DEBUG_KBD("Sending scancode=0x%x, flags=0x%x\n", scancode, flags); |
DEBUG_KBD(("Sending scancode=0x%x, flags=0x%x\n", scancode, flags); |
459 |
rdp_send_input(time, RDP_INPUT_SCANCODE, flags, scancode, 0); |
rdp_send_input(time, RDP_INPUT_SCANCODE, flags, scancode, 0)); |
460 |
} |
} |
461 |
} |
} |