mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-18 07:20:08 +00:00
Merge pull request #9605 from german77/mouse_mapping
yuzu: Read mouse scroll
This commit is contained in:
commit
0e8f98a441
3 changed files with 10 additions and 1 deletions
|
@ -76,7 +76,7 @@ void MappingFactory::RegisterButton(const MappingData& data) {
|
||||||
break;
|
break;
|
||||||
case EngineInputType::Analog:
|
case EngineInputType::Analog:
|
||||||
// Ignore mouse axis when mapping buttons
|
// Ignore mouse axis when mapping buttons
|
||||||
if (data.engine == "mouse") {
|
if (data.engine == "mouse" && data.index != 4) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new_input.Set("axis", data.index);
|
new_input.Set("axis", data.index);
|
||||||
|
|
|
@ -1466,6 +1466,12 @@ void ConfigureInputPlayer::mousePressEvent(QMouseEvent* event) {
|
||||||
input_subsystem->GetMouse()->PressButton(0, 0, 0, 0, button);
|
input_subsystem->GetMouse()->PressButton(0, 0, 0, 0, button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfigureInputPlayer::wheelEvent(QWheelEvent* event) {
|
||||||
|
const int x = event->angleDelta().x();
|
||||||
|
const int y = event->angleDelta().y();
|
||||||
|
input_subsystem->GetMouse()->MouseWheelChange(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigureInputPlayer::keyPressEvent(QKeyEvent* event) {
|
void ConfigureInputPlayer::keyPressEvent(QKeyEvent* event) {
|
||||||
if (!input_setter || !event) {
|
if (!input_setter || !event) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -116,6 +116,9 @@ private:
|
||||||
/// Handle mouse button press events.
|
/// Handle mouse button press events.
|
||||||
void mousePressEvent(QMouseEvent* event) override;
|
void mousePressEvent(QMouseEvent* event) override;
|
||||||
|
|
||||||
|
/// Handle mouse wheel move events.
|
||||||
|
void wheelEvent(QWheelEvent* event) override;
|
||||||
|
|
||||||
/// Handle key press events.
|
/// Handle key press events.
|
||||||
void keyPressEvent(QKeyEvent* event) override;
|
void keyPressEvent(QKeyEvent* event) override;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue