mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
[Emulator] Handle left click
This commit is contained in:
parent
f9f34d564f
commit
5200c10b27
4 changed files with 90 additions and 47 deletions
|
@ -49,10 +49,12 @@ class HIDService {
|
|||
u32 oldButtons; // The previous pad state
|
||||
|
||||
s16 circlePadX, circlePadY; // Circlepad state
|
||||
s16 touchScreenX, touchScreenY; // Touchscreen state
|
||||
|
||||
bool accelerometerEnabled;
|
||||
bool eventsInitialized;
|
||||
bool gyroEnabled;
|
||||
bool touchScreenPressed;
|
||||
|
||||
std::array<std::optional<Handle>, 5> events;
|
||||
|
||||
|
@ -116,4 +118,14 @@ public:
|
|||
std::memset(ptr, 0, 0x2b0);
|
||||
}
|
||||
}
|
||||
|
||||
void setTouchScreenPress(u16 x, u16 y) {
|
||||
touchScreenX = x;
|
||||
touchScreenY = y;
|
||||
touchScreenPressed = true;
|
||||
}
|
||||
|
||||
void releaseTouchScreen() {
|
||||
touchScreenPressed = false;
|
||||
}
|
||||
};
|
|
@ -85,9 +85,12 @@ public:
|
|||
|
||||
void signalDSPEvents() { dsp.signalEvents(); }
|
||||
|
||||
// Input function wrappers
|
||||
void pressKey(u32 key) { hid.pressKey(key); }
|
||||
void releaseKey(u32 key) { hid.releaseKey(key); }
|
||||
void setCirclepadX(u16 x) { hid.setCirclepadX(x); }
|
||||
void setCirclepadY(u16 y) { hid.setCirclepadY(y); }
|
||||
void updateInputs(u64 currentTimestamp) { hid.updateInputs(currentTimestamp); }
|
||||
void setTouchScreenPress(u16 x, u16 y) { hid.setTouchScreenPress(x, y); }
|
||||
void releaseTouchScreen() { hid.releaseTouchScreen(); }
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue