Skip to content

Commit

Permalink
fix: Wrong Keyboard Input on Assignment (Wayland) (#1063)
Browse files Browse the repository at this point in the history
  • Loading branch information
pktiuk authored Oct 23, 2024
1 parent b890e35 commit e0343b2
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions src/simplekeygrabberbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,37 +99,28 @@ bool SimpleKeyGrabberButton::eventFilter(QObject *obj, QEvent *event)
}
#elif defined(WITH_X11)

if (QApplication::platformName() == QStringLiteral("xcb"))
{
finalvirtual = X11KeyCodeToX11KeySym(tempcode); // Obtain group 1 X11 keysym. Removes effects from modifiers.
finalvirtual = X11KeyCodeToX11KeySym(tempcode); // Obtain group 1 X11 keysym. Removes effects from modifiers.

#ifdef WITH_UINPUT

if (handler->getIdentifier() == "uinput")
{
QtKeyMapperBase *x11KeyMapper =
AntKeyMapper::getInstance()->getNativeKeyMapper(); // Find Qt Key corresponding to X11 KeySym.
checkalias = x11KeyMapper->returnQtKey(finalvirtual);
finalvirtual = AntKeyMapper::getInstance()->returnVirtualKey(
checkalias); // Find corresponding Linux input key for the Qt key.
}

if (handler->getIdentifier() == "uinput")
{
QtKeyMapperBase *x11KeyMapper =
AntKeyMapper::getInstance()->getNativeKeyMapper(); // Find Qt Key corresponding to X11 KeySym.
checkalias = x11KeyMapper->returnQtKey(finalvirtual);
finalvirtual = AntKeyMapper::getInstance()->returnVirtualKey(
checkalias); // Find corresponding Linux input key for the Qt key.
} else
#endif

#ifdef WITH_XTEST

if (handler->getIdentifier() == "xtest")
checkalias =
AntKeyMapper::getInstance()->returnQtKey(finalvirtual); // Check for alias against group 1 keysym.

checkalias = AntKeyMapper::getInstance()->returnQtKey(finalvirtual); // Check for alias against group 1 keysym.
else
#endif
} else
{
// Not running on xcb platform.
{ // Not using any known handler.
finalvirtual = tempcode;
checkalias = AntKeyMapper::getInstance()->returnQtKey(finalvirtual);
}

#else
if (QApplication::platformName() == QStringLiteral("xcb"))
{
Expand Down

0 comments on commit e0343b2

Please sign in to comment.