Fix wxKeyEvent::GetKeyCode() for non-US keyboard layouts

Use the key code corresponding to the key in the US keyboard layout for
the key down/up events even when not actually using US layout, as this
is much more useful than simply returning 0 as was done before.

It also is compatible with the behaviour of the other ports.

Closes #17643.

Closes #23379.

See #23410.
This commit is contained in:
Ivan Sorokin 2023-03-31 02:43:28 +03:00 committed by Vadim Zeitlin
parent 24a96a78d2
commit 2c0f6a2aa0
5 changed files with 247 additions and 6 deletions

View file

@ -5013,6 +5013,25 @@ if test "$wxUSE_FSWATCHER" = "yes"; then
fi
fi
dnl ---------------------------------------------------------------------------
dnl xkbcommon library for key code translations in wxGTK
dnl ---------------------------------------------------------------------------
if test "$wxUSE_GTK" = 1; then
if test "$USE_WIN32" != 1 -a "$USE_DARWIN" != 1; then
PKG_CHECK_MODULES(XKBCOMMON, [xkbcommon],
[
CFLAGS="$XKBCOMMON_CFLAGS $CFLAGS"
CXXFLAGS="$XKBCOMMON_CFLAGS $CXXFLAGS"
GUI_TK_LIBRARY="$GUI_TK_LIBRARY $XKBCOMMON_LIBS"
AC_DEFINE(HAVE_XKBCOMMON)
],
[
AC_MSG_WARN([libxkbcommon not found, key codes in key events may be incorrect])
]
)
fi
fi
dnl ---------------------------------------------------------------------------
dnl Secret storage
dnl ---------------------------------------------------------------------------