Permalink
Browse files

Address feedback

  • Loading branch information...
hrydgard committed Jan 6, 2019
1 parent 5a1fa60 commit 5362e675c414f75cfadbc77279b33cd89448e989
Showing with 7 additions and 5 deletions.
  1. +7 −3 Qt/QtMain.cpp
  2. +0 −2 UI/GameSettingsScreen.cpp
@@ -357,12 +357,16 @@ bool MainUI::event(QEvent *e)
case QEvent::KeyPress:
{
auto qtKeycode = ((QKeyEvent*)e)->key();
int nativeKeycode = KeyMapRawQttoNative.find(qtKeycode)->second;
NativeKey(KeyInput(DEVICE_ID_KEYBOARD, nativeKeycode, KEY_DOWN));
auto iter = KeyMapRawQttoNative.find(qtKeycode);
int nativeKeycode = 0;
if (iter != KeyMapRawQttoNative.end()) {
nativeKeycode = iter->second;
NativeKey(KeyInput(DEVICE_ID_KEYBOARD, nativeKeycode, KEY_DOWN));
}

// Also get the unicode value.
QString text = ((QKeyEvent*)e)->text();
std::string str = text.toStdString();

// Now, we don't want CHAR events for non-printable characters. Not quite sure how we'll best
// do that, but here's one attempt....
switch (nativeKeycode) {
@@ -803,8 +803,6 @@ void GameSettingsScreen::CreateViews() {
// so until then, this is Windows/Desktop only.
#if !defined(MOBILE_DEVICE) // TODO: Add all platforms where KEY_CHAR support is added
systemSettings->Add(new PopupTextInputChoice(&g_Config.sNickName, sy->T("Change Nickname"), "", 32, screenManager()));
// #elif defined(USING_QT_UI)
// systemSettings->Add(new Choice(sy->T("Change Nickname")))->OnClick.Handle(this, &GameSettingsScreen::OnChangeNickname);
#elif defined(__ANDROID__)
systemSettings->Add(new ChoiceWithValueDisplay(&g_Config.sNickName, sy->T("Change Nickname"), (const char *)nullptr))->OnClick.Handle(this, &GameSettingsScreen::OnChangeNickname);
#endif

0 comments on commit 5362e67

Please sign in to comment.