We still had some problems with the shift key getting stuck. The new

code makes sure that we restore "faked" modifiers both after press and
release. It's also shorter.

I've added two new test cases to the doc as well.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1418 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Peter Åstrand 2007-10-08 12:34:05 +00:00
parent 02820036e6
commit 9866572002
2 changed files with 18 additions and 20 deletions

View File

@ -243,3 +243,17 @@ works:
11. Press Shift, then press a key modified by shift, the release
shift, then release the other key. Do this in a speedy fasion.
Make sure the shift state is not stuck down.
12. Test all numpad keys, when not using the -N option.
13. Map a single, un-shifted key (such as F1) to XK_A:
xmodmap -e "keycode 67 = A A"
Perform in Notepad:
* Write some text
* Press F1
* Press b
* Release b
* Release F1
Verify that shift is not stuck down, by clicking on the text.

View File

@ -700,14 +700,6 @@ is_modifier(uint8 scancode)
return False;
}
static void
save_remote_modifiers_if_modifier(uint8 scancode)
{
if (!is_modifier(scancode))
return;
saved_remote_modifier_state = remote_modifier_state;
}
void
xkeymap_send_keys(uint32 keysym, unsigned int keycode, unsigned int state, uint32 ev_time,
@ -722,18 +714,10 @@ xkeymap_send_keys(uint32 keysym, unsigned int keycode, unsigned int state, uint3
if (tr.scancode == 0)
return;
if (pressed)
{
save_remote_modifiers(tr.scancode);
ensure_remote_modifiers(ev_time, tr);
rdp_send_scancode(ev_time, RDP_KEYPRESS, tr.scancode);
}
else
{
rdp_send_scancode(ev_time, RDP_KEYRELEASE, tr.scancode);
restore_remote_modifiers(ev_time, tr.scancode);
save_remote_modifiers_if_modifier(tr.scancode);
}
save_remote_modifiers(tr.scancode);
ensure_remote_modifiers(ev_time, tr);
rdp_send_scancode(ev_time, pressed ? RDP_KEYPRESS : RDP_KEYRELEASE, tr.scancode);
restore_remote_modifiers(ev_time, tr.scancode);
return;
}