Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to support Qt keyboard input directly. Fixes #11653 #11720

Merged
merged 2 commits into from
Jan 6, 2019

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Jan 6, 2019

Fixes #11653 by avoiding the native dialog which can't be spawned from the main thread.

@hrydgard hrydgard added the Qt Issue on Qt but not all ports. label Jan 6, 2019
@hrydgard hrydgard added this to the v1.8.0 milestone Jan 6, 2019
@hrydgard hrydgard changed the title Try to support Qt keyboard input directly. Partially fixes #11653 Try to support Qt keyboard input directly. Fixes #11653 Jan 6, 2019
Copy link
Collaborator

@unknownbrackets unknownbrackets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the commented code, not really concerned about the spaces or unchecked map lookup...

-[Unknown]

#elif defined(USING_QT_UI)
systemSettings->Add(new Choice(sy->T("Change Nickname")))->OnClick.Handle(this, &GameSettingsScreen::OnChangeNickname);
// #elif defined(USING_QT_UI)
// systemSettings->Add(new Choice(sy->T("Change Nickname")))->OnClick.Handle(this, &GameSettingsScreen::OnChangeNickname);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should just delete rather than leaving in commented code, git remembers forever after all.

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you're right.

Qt/QtMain.cpp Outdated
NativeKey(KeyInput(DEVICE_ID_KEYBOARD, KeyMapRawQttoNative.find(((QKeyEvent*)e)->key())->second, KEY_DOWN));
{
auto qtKeycode = ((QKeyEvent*)e)->key();
int nativeKeycode = KeyMapRawQttoNative.find(qtKeycode)->second;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, another tab/space battleground.

I realize this was here before, but I wonder now: is KeyMapRawQttoNative guaranteed to have all keys in it?

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed it too but was too lazy to do anything about it since it was already there. I'll change it.

Qt/QtMain.cpp Show resolved Hide resolved
@unknownbrackets unknownbrackets merged commit 28cc87c into master Jan 6, 2019
@hrydgard hrydgard deleted the qt-textedit-fixes branch January 6, 2019 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Qt Issue on Qt but not all ports.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants