mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
Merge pull request #28 from haganbmj/unicode-character-entry
fix: correct unicode text entry behavior (fixes twanvl#121)
This commit is contained in:
@@ -9,6 +9,13 @@ Features:
|
|||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
version 2.2.2 (Unofficial), 2022-07-19
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
* Correct unicode text entry behavior. (twanvl#121)
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
version 2.2.1 (Unofficial), 2022-07-19
|
version 2.2.1 (Unofficial), 2022-07-19
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
project(magicseteditor VERSION 2.2.1)
|
project(magicseteditor VERSION 2.2.2)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
|||||||
@@ -266,8 +266,10 @@ void SymbolPartList::onChar(wxKeyEvent& ev) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// See gui/value/text.cpp
|
// See gui/value/text.cpp
|
||||||
#ifdef __WXMSW__
|
#if defined UNICODE
|
||||||
|
if (ev.GetUnicodeKey() >= WXK_SPACE) {
|
||||||
|
#elif defined __WXMSW__
|
||||||
if (ev.GetKeyCode() >= _(' ') && ev.GetKeyCode() == (int)ev.GetRawKeyCode()) {
|
if (ev.GetKeyCode() >= _(' ') && ev.GetKeyCode() == (int)ev.GetRawKeyCode()) {
|
||||||
#else
|
#else
|
||||||
if (ev.GetKeyCode() >= _(' ') /*&& ev.GetKeyCode() == (int)ev.GetRawKeyCode()*/) {
|
if (ev.GetKeyCode() >= _(' ') /*&& ev.GetKeyCode() == (int)ev.GetRawKeyCode()*/) {
|
||||||
|
|||||||
@@ -482,8 +482,15 @@ bool TextValueEditor::onChar(wxKeyEvent& ev) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
#ifdef __WXMSW__
|
#if defined UNICODE
|
||||||
|
// I think in theory this works because the UnicodeKey is intended to be only character values.
|
||||||
|
// See the following link for pretty much an exact example of this type of handling.
|
||||||
|
// https://docs.wxwidgets.org/3.0/classwx_key_event.html#a3dccc5a254770931e5d8066ef47e7fb0
|
||||||
|
// Most of the special keys (<32) are handled in the case structure above anyways.
|
||||||
|
// I tried to replicate the Numpad issue mentioned below, but couldn't - so unclear if that's still relevant.
|
||||||
|
if (ev.GetUnicodeKey() >= WXK_SPACE) {
|
||||||
|
#elif defined __WXMSW__
|
||||||
if (ev.GetKeyCode() >= _(' ') && ev.GetKeyCode() == (int)ev.GetRawKeyCode()) {
|
if (ev.GetKeyCode() >= _(' ') && ev.GetKeyCode() == (int)ev.GetRawKeyCode()) {
|
||||||
// This check is need, otherwise pressing a key, say "0" on the numpad produces "a0"
|
// This check is need, otherwise pressing a key, say "0" on the numpad produces "a0"
|
||||||
// (don't ask me why)
|
// (don't ask me why)
|
||||||
|
|||||||
Reference in New Issue
Block a user