mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-02 13:27:52 +00:00
Allow focus on the Qt render widget
By default widgets are set to the focus policy Qt::NoFocus which disallows manually focusing it. Changing the policy to allow clicking the widget to set focus to it allows for keyboard input when not rendering to a popout window. This commit also sets focus to the widget when showing it. Fixes issue #158.
This commit is contained in:
parent
2bbbe68399
commit
9d90b26020
2 changed files with 4 additions and 0 deletions
|
@ -123,6 +123,9 @@ GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this
|
||||||
std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
|
std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
|
||||||
setWindowTitle(QString::fromStdString(window_title));
|
setWindowTitle(QString::fromStdString(window_title));
|
||||||
|
|
||||||
|
// Allow manually setting focus to the widget.
|
||||||
|
setFocusPolicy(Qt::ClickFocus);
|
||||||
|
|
||||||
keyboard_id = KeyMap::NewDeviceId();
|
keyboard_id = KeyMap::NewDeviceId();
|
||||||
ReloadSetKeymaps();
|
ReloadSetKeymaps();
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,7 @@ void GMainWindow::BootGame(std::string filename)
|
||||||
render_window->GetEmuThread().start();
|
render_window->GetEmuThread().start();
|
||||||
|
|
||||||
render_window->show();
|
render_window->show();
|
||||||
|
render_window->setFocus();
|
||||||
OnStartGame();
|
OnStartGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue