This commit is contained in:
OBattler
2023-04-09 04:36:37 +02:00
4 changed files with 34 additions and 12 deletions

View File

@@ -316,6 +316,9 @@ then
pacman -S --needed --noconfirm "$pkg" pacman -S --needed --noconfirm "$pkg"
done done
fi fi
# Clean pacman cache when running under Jenkins to save disk space.
[ "$CI" = "true" ] && rm -rf /var/cache/pacman/pkg
# Generate a new freetype DLL for this architecture. # Generate a new freetype DLL for this architecture.
rm -f "$freetype_dll" rm -f "$freetype_dll"

View File

@@ -18,14 +18,13 @@
#include <QtDebug> #include <QtDebug>
static std::unordered_map<uint32_t, uint16_t> evdev_keycodes = { static std::unordered_map<uint32_t, uint16_t> evdev_keycodes = {
{99, 0x54}, /* SYSRQ */ {184, 0x46}, /* F14 => Scroll Lock (for Apple keyboards) */
{86, 0x56}, /* 102ND */ {86, 0x56}, /* 102ND */
{87, 0x57}, /* F11 */ {87, 0x57}, /* F11 */
{88, 0x58}, /* F12 */ {88, 0x58}, /* F12 */
{117, 0x59}, /* KPEQUAL */ {186, 0x5d}, /* F16 => F13 */
{183, 0x5d}, /* F13 */ {187, 0x5e}, /* F17 => F14 */
{184, 0x5e}, /* F14 */ {188, 0x5f}, /* F18 => F15 */
{185, 0x5f}, /* F15 */
/* Japanese keys. */ /* Japanese keys. */
{95, 0x5c}, /* KPJPCOMMA */ {95, 0x5c}, /* KPJPCOMMA */
@@ -47,9 +46,11 @@ static std::unordered_map<uint32_t, uint16_t> evdev_keycodes = {
{97, 0x11d}, /* RIGHTCTRL */ {97, 0x11d}, /* RIGHTCTRL */
{98, 0x135}, /* KPSLASH */ {98, 0x135}, /* KPSLASH */
{99, 0x137}, /* SYSRQ */ {99, 0x137}, /* SYSRQ */
{183, 0x137}, /* F13 => SysRq (for Apple keyboards) */
{100, 0x138}, /* RIGHTALT */ {100, 0x138}, /* RIGHTALT */
{119, 0x145}, /* PAUSE */ {119, 0x145}, /* PAUSE */
{411, 0x145}, /* BREAK */ {411, 0x145}, /* BREAK */
{185, 0x145}, /* F15 => Pause (for Apple keyboards) */
{102, 0x147}, /* HOME */ {102, 0x147}, /* HOME */
{103, 0x148}, /* UP */ {103, 0x148}, /* UP */
{104, 0x149}, /* PAGEUP */ {104, 0x149}, /* PAGEUP */

View File

@@ -1394,12 +1394,19 @@ MainWindow::keyPressEvent(QKeyEvent *event)
keyboard_input(1, 0x1D); keyboard_input(1, 0x1D);
keyboard_input(1, 0x45); keyboard_input(1, 0x45);
} }
} else } else {
#ifdef Q_OS_MACOS #ifdef Q_OS_MACOS
processMacKeyboardInput(true, event); processMacKeyboardInput(true, event);
#else #else
keyboard_input(1, x11_keycode_to_keysym(event->nativeScanCode())); auto scan = x11_keycode_to_keysym(event->nativeScanCode());
if (scan == 0x145) {
/* Special case for Pause. */
keyboard_input(1, scan & 0xff00);
scan &= 0x00ff;
}
keyboard_input(1, scan);
#endif #endif
}
} }
if ((video_fullscreen > 0) && keyboard_isfsexit()) { if ((video_fullscreen > 0) && keyboard_isfsexit()) {
@@ -1446,7 +1453,13 @@ MainWindow::keyReleaseEvent(QKeyEvent *event)
#ifdef Q_OS_MACOS #ifdef Q_OS_MACOS
processMacKeyboardInput(false, event); processMacKeyboardInput(false, event);
#else #else
keyboard_input(0, x11_keycode_to_keysym(event->nativeScanCode())); auto scan = x11_keycode_to_keysym(event->nativeScanCode());
if (scan == 0x145) {
/* Special case for Pause. */
keyboard_input(0, scan & 0xff00);
scan &= 0x00ff;
}
keyboard_input(0, scan);
#endif #endif
} }

View File

@@ -102,6 +102,7 @@ static std::unordered_map<std::string, uint16_t> xkb_keycodes = {
{"NMLK", 0x45}, {"NMLK", 0x45},
{"SCLK", 0x46}, {"SCLK", 0x46},
{"FK14", 0x46}, /* F14 => Scroll Lock (for Apple keyboards) */
{"KP7", 0x47}, {"KP7", 0x47},
{"KP8", 0x48}, {"KP8", 0x48},
{"KP9", 0x49}, {"KP9", 0x49},
@@ -119,12 +120,13 @@ static std::unordered_map<std::string, uint16_t> xkb_keycodes = {
{"LSGT", 0x56}, {"LSGT", 0x56},
{"FK11", 0x57}, {"FK11", 0x57},
{"FK12", 0x58}, {"FK12", 0x58},
{"FK13", 0x5d}, {"FK16", 0x5d}, /* F16 => F13 */
{"FK14", 0x5e}, {"FK17", 0x5e}, /* F17 => F14 */
{"FK15", 0x5f}, {"FK18", 0x5f}, /* F18 => F15 */
/* Japanese keys. */ /* Japanese keys. */
{"JPCM", 0x5c}, /* evdev KPJPCOMMA */ {"JPCM", 0x5c}, /* Num, */
{"KPDC", 0x5c},
{"HKTG", 0x70}, /* hiragana-katakana toggle */ {"HKTG", 0x70}, /* hiragana-katakana toggle */
{"AB11", 0x73}, /* \_ and Brazilian /? */ {"AB11", 0x73}, /* \_ and Brazilian /? */
{"HZTG", 0x76}, /* hankaku-zenkaku toggle */ {"HZTG", 0x76}, /* hankaku-zenkaku toggle */
@@ -145,8 +147,11 @@ static std::unordered_map<std::string, uint16_t> xkb_keycodes = {
{"KPDV", 0x135}, {"KPDV", 0x135},
{"PRSC", 0x137}, {"PRSC", 0x137},
{"SYRQ", 0x137}, {"SYRQ", 0x137},
{"FK13", 0x137}, /* F13 => SysRq (for Apple keyboards) */
{"RALT", 0x138}, {"RALT", 0x138},
{"ALGR", 0x138},
{"PAUS", 0x145}, {"PAUS", 0x145},
{"FK15", 0x145}, /* F15 => Pause (for Apple keyboards) */
{"BRK", 0x145}, {"BRK", 0x145},
{"HOME", 0x147}, {"HOME", 0x147},
{"UP", 0x148}, {"UP", 0x148},