Merge pull request #27563 from hbiyik/piers-fix-lost-keyboard-events

Fix wayland keymapping is not possible when the key id is unconventional
This commit is contained in:
Stephan Sundermann 2025-12-09 22:11:02 +01:00 committed by GitHub
commit ae71c9c501
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -158,11 +158,11 @@ void CInputProcessorKeyboard::ConvertAndSendKey(std::uint32_t scancode, bool pre
}
const XBMCKey xbmcKey{m_keymap->XBMCKeyForKeycode(xkbCode)};
if (xbmcKey == XBMCKey::XBMCK_UNKNOWN && utf32 == 0)
if (xbmcKey == XBMCKey::XBMCK_LAST)
{
// Such an event would carry no useful information in it and thus can be safely dropped here
// This prevents starting an unnecessary timer for key presses
CLog::Log(LOGDEBUG, "Unknown key event ignored (scancode: {})", scancode);
CLog::Log(LOGDEBUG, LOGWINDOWING, "Key event ignored (scancode: {})", scancode);
return;
}

View File

@ -212,9 +212,9 @@ constexpr auto XkbKeycodeXBMCMappings = make_map<xkb_keycode_t, XBMCKey>({
{XKB_KEY_WEBOS_CHANNEL_UP, XBMCK_PAGEUP},
{XKB_KEY_WEBOS_INFO, XBMCK_INFO},
{XKB_KEY_WEBOS_TVGUIDE, XBMCK_GUIDE},
{XKB_KEY_WEBOS_CURSOR_HIDE, XBMCK_UNKNOWN},
{XKB_KEY_WEBOS_CURSOR_SHOW, XBMCK_UNKNOWN},
{XKB_KEY_WEBOS_INVALID, XBMCK_UNKNOWN},
{XKB_KEY_WEBOS_CURSOR_HIDE, XBMCK_LAST},
{XKB_KEY_WEBOS_CURSOR_SHOW, XBMCK_LAST},
{XKB_KEY_WEBOS_INVALID, XBMCK_LAST},
#endif
});