Implement scancode indexing
The mapping from scancodes to the indexes used in xrdp_keymap is not well designed and contains an implicit dependency on keycode values. This mapping is alse slightly different from the index used for the 'keys' map in the xrdp_wm structure. This commit introduces support for mapping scancodes directly to 'scancode indexes' suitable for indexing into both structures. Some renaming is also done; [MS-RDPBCGR] uses the terms scancode and keyCode interchangeably. An effort is made to use key_code for a raw value from a TS_KEYBOARD_EVENT, and scancode for a value which is produced by the scancode module.
This commit is contained in:
@@ -31,7 +31,7 @@ START_TEST(test_scancode__evdev_all_values_returned)
|
||||
iter = 0;
|
||||
while ((scancode = scancode_get_next(&iter)) != 0)
|
||||
{
|
||||
unsigned short keycode = scancode_to_keycode(scancode);
|
||||
unsigned short keycode = scancode_to_x11_keycode(scancode);
|
||||
ck_assert_int_ne(keycode, 0);
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ START_TEST(test_scancode__evdev_bad_values_mapped_to_0)
|
||||
{
|
||||
if (!valid[scancode])
|
||||
{
|
||||
ck_assert_int_eq(scancode_to_keycode(scancode), 0);
|
||||
ck_assert_int_eq(scancode_to_x11_keycode(scancode), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ START_TEST(test_scancode__base_all_values_returned)
|
||||
iter = 0;
|
||||
while ((scancode = scancode_get_next(&iter)) != 0)
|
||||
{
|
||||
unsigned short keycode = scancode_to_keycode(scancode);
|
||||
unsigned short keycode = scancode_to_x11_keycode(scancode);
|
||||
ck_assert_int_ne(keycode, 0);
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ START_TEST(test_scancode__base_bad_values_mapped_to_0)
|
||||
{
|
||||
if (!valid[scancode])
|
||||
{
|
||||
ck_assert_int_eq(scancode_to_keycode(scancode), 0);
|
||||
ck_assert_int_eq(scancode_to_x11_keycode(scancode), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user