Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
1b82d5bb
There was an error fetching the commit references. Please try again later.
Commit
1b82d5bb
authored
3 years ago
by
german77
Committed by
Narr the Reg
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
yuzu: Update overlay applet
parent
510c7d29
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/yuzu/util/overlay_dialog.cpp
+15
-12
15 additions, 12 deletions
src/yuzu/util/overlay_dialog.cpp
src/yuzu/util/overlay_dialog.h
+6
-4
6 additions, 4 deletions
src/yuzu/util/overlay_dialog.h
with
21 additions
and
16 deletions
src/yuzu/util/overlay_dialog.cpp
+
15
−
12
View file @
1b82d5bb
...
...
@@ -6,7 +6,8 @@
#include
<QScreen>
#include
"core/core.h"
#include
"core/frontend/input_interpreter.h"
#include
"core/hid/hid_types.h"
#include
"core/hid/input_interpreter.h"
#include
"ui_overlay_dialog.h"
#include
"yuzu/util/overlay_dialog.h"
...
...
@@ -179,9 +180,9 @@ void OverlayDialog::MoveAndResizeWindow() {
QDialog
::
resize
(
width
,
height
);
}
template
<
HID
Button
...
T
>
template
<
Core
::
HID
::
Npad
Button
...
T
>
void
OverlayDialog
::
HandleButtonPressedOnce
()
{
const
auto
f
=
[
this
](
HID
Button
button
)
{
const
auto
f
=
[
this
](
Core
::
HID
::
Npad
Button
button
)
{
if
(
input_interpreter
->
IsButtonPressedOnce
(
button
))
{
TranslateButtonPress
(
button
);
}
...
...
@@ -190,7 +191,7 @@ void OverlayDialog::HandleButtonPressedOnce() {
(
f
(
T
),
...);
}
void
OverlayDialog
::
TranslateButtonPress
(
HID
Button
button
)
{
void
OverlayDialog
::
TranslateButtonPress
(
Core
::
HID
::
Npad
Button
button
)
{
QPushButton
*
left_button
=
use_rich_text
?
ui
->
button_cancel_rich
:
ui
->
button_cancel
;
QPushButton
*
right_button
=
use_rich_text
?
ui
->
button_ok_rich
:
ui
->
button_ok_label
;
...
...
@@ -198,20 +199,20 @@ void OverlayDialog::TranslateButtonPress(HIDButton button) {
// TODO (Morph): focusPrevious/NextChild() doesn't work well with the rich text dialog, fix it
switch
(
button
)
{
case
HID
Button
::
A
:
case
HID
Button
::
B
:
case
Core
::
HID
::
Npad
Button
::
A
:
case
Core
::
HID
::
Npad
Button
::
B
:
if
(
left_button
->
hasFocus
())
{
left_button
->
click
();
}
else
if
(
right_button
->
hasFocus
())
{
right_button
->
click
();
}
break
;
case
HID
Button
::
D
Left
:
case
HID
Button
::
L
StickLeft
:
case
Core
::
HID
::
Npad
Button
::
Left
:
case
Core
::
HID
::
Npad
Button
::
StickL
L
eft
:
focusPreviousChild
();
break
;
case
HID
Button
::
D
Right
:
case
HID
Button
::
L
StickRight
:
case
Core
::
HID
::
Npad
Button
::
Right
:
case
Core
::
HID
::
Npad
Button
::
Stick
L
Right
:
focusNextChild
();
break
;
default
:
...
...
@@ -241,8 +242,10 @@ void OverlayDialog::InputThread() {
while
(
input_thread_running
)
{
input_interpreter
->
PollInput
();
HandleButtonPressedOnce
<
HIDButton
::
A
,
HIDButton
::
B
,
HIDButton
::
DLeft
,
HIDButton
::
DRight
,
HIDButton
::
LStickLeft
,
HIDButton
::
LStickRight
>
();
HandleButtonPressedOnce
<
Core
::
HID
::
NpadButton
::
A
,
Core
::
HID
::
NpadButton
::
B
,
Core
::
HID
::
NpadButton
::
Left
,
Core
::
HID
::
NpadButton
::
Right
,
Core
::
HID
::
NpadButton
::
StickLLeft
,
Core
::
HID
::
NpadButton
::
StickLRight
>
();
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
50
));
}
...
...
This diff is collapsed.
Click to expand it.
src/yuzu/util/overlay_dialog.h
+
6
−
4
View file @
1b82d5bb
...
...
@@ -13,14 +13,16 @@
#include
"common/common_types.h"
enum
class
HIDButton
:
u8
;
class
InputInterpreter
;
namespace
Core
{
class
System
;
}
namespace
Core
::
HID
{
enum
class
NpadButton
:
u64
;
}
namespace
Ui
{
class
OverlayDialog
;
}
...
...
@@ -79,7 +81,7 @@ private:
*
* @tparam HIDButton The list of buttons that can be converted into keyboard input.
*/
template
<
HID
Button
...
T
>
template
<
Core
::
HID
::
Npad
Button
...
T
>
void
HandleButtonPressedOnce
();
/**
...
...
@@ -87,7 +89,7 @@ private:
*
* @param button The button press to process.
*/
void
TranslateButtonPress
(
HID
Button
button
);
void
TranslateButtonPress
(
Core
::
HID
::
Npad
Button
button
);
void
StartInputThread
();
void
StopInputThread
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment