mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
Fix get_keyboard_map on Czech (and other) layouts
Now reports proper Unicode name, and doesn't omit keys that don't have a recognised mapping by Panda https://bugs.launchpad.net/panda3d/+bug/1652145
This commit is contained in:
parent
59c3aa3ef6
commit
4393455eba
@ -52,6 +52,7 @@ This issue fixes several bugs that were still found in 1.9.2.
|
|||||||
* Now tries to preserve refresh rate when switching fullscreen on Windows
|
* Now tries to preserve refresh rate when switching fullscreen on Windows
|
||||||
* Fix back-to-front sorting when gl-coordinate-system is changed
|
* Fix back-to-front sorting when gl-coordinate-system is changed
|
||||||
* Now also compiles on older Linux distros (eg. CentOS 5 / manylinux1)
|
* Now also compiles on older Linux distros (eg. CentOS 5 / manylinux1)
|
||||||
|
* get_keyboard_map now includes keys on layouts with special characters
|
||||||
|
|
||||||
------------------------ RELEASE 1.9.2 ------------------------
|
------------------------ RELEASE 1.9.2 ------------------------
|
||||||
|
|
||||||
|
@ -2721,7 +2721,7 @@ ButtonMap *WinGraphicsWindow::
|
|||||||
get_keyboard_map() const {
|
get_keyboard_map() const {
|
||||||
ButtonMap *map = new ButtonMap;
|
ButtonMap *map = new ButtonMap;
|
||||||
|
|
||||||
char text[256];
|
wchar_t text[256];
|
||||||
UINT vsc = 0;
|
UINT vsc = 0;
|
||||||
unsigned short ex_vsc[] = {0x57, 0x58,
|
unsigned short ex_vsc[] = {0x57, 0x58,
|
||||||
0x011c, 0x011d, 0x0135, 0x0137, 0x0138, 0x0145, 0x0147, 0x0148, 0x0149, 0x014b, 0x014d, 0x014f, 0x0150, 0x0151, 0x0152, 0x0153, 0x015b, 0x015c, 0x015d};
|
0x011c, 0x011d, 0x0135, 0x0137, 0x0138, 0x0145, 0x0147, 0x0148, 0x0149, 0x014b, 0x014d, 0x014f, 0x0150, 0x0151, 0x0152, 0x0153, 0x015b, 0x015c, 0x015d};
|
||||||
@ -2759,14 +2759,15 @@ get_keyboard_map() const {
|
|||||||
|
|
||||||
UINT vk = MapVirtualKeyA(vsc, MAPVK_VSC_TO_VK_EX);
|
UINT vk = MapVirtualKeyA(vsc, MAPVK_VSC_TO_VK_EX);
|
||||||
button = lookup_key(vk);
|
button = lookup_key(vk);
|
||||||
if (button == ButtonHandle::none()) {
|
//if (button == ButtonHandle::none()) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
int len = GetKeyNameTextA(lparam, text, 256);
|
int len = GetKeyNameTextW(lparam, text, 256);
|
||||||
string label (text, len);
|
TextEncoder enc;
|
||||||
map->map_button(raw_button, button, label);
|
enc.set_wtext(wstring(text, len));
|
||||||
|
map->map_button(raw_button, button, enc.get_text());
|
||||||
}
|
}
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user