commit 25d9ddc158612cb155743d475a195aa51158f247
Author: jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Fri Apr 16 21:25:43 2021 -0600
Commit: jtothebell <j.to.the.bell@gmail.com>
CommitDate: Fri Apr 16 21:25:43 2021 -0600
fix mouse clicking on desktop
---
platform/SDL2Desktop/source/SDL2Host.cpp | 6 +++---
source/Input.cpp | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/platform/SDL2Desktop/source/SDL2Host.cpp b/platform/SDL2Desktop/source/SDL2Host.cpp
index 4c931fc..9458d03 100644
--- a/platform/SDL2Desktop/source/SDL2Host.cpp
+++ b/platform/SDL2Desktop/source/SDL2Host.cpp
@@ -102,13 +102,13 @@ InputState_t Host::scanInput(){
mouseY /= scaleY;
uint8_t picoMouseState = 0;
if (sdlMouseBtnState & SDL_BUTTON(SDL_BUTTON_LEFT)) {
- picoMouseState &= 1;
+ picoMouseState |= 1;
}
if (sdlMouseBtnState & SDL_BUTTON(SDL_BUTTON_MIDDLE)) {
- picoMouseState &= 4;
+ picoMouseState |= 4;
}
if (sdlMouseBtnState & SDL_BUTTON(SDL_BUTTON_RIGHT)) {
- picoMouseState &= 2;
+ picoMouseState |= 2;
}
const Uint8* keystate = SDL_GetKeyboardState(NULL);
diff --git a/source/Input.cpp b/source/Input.cpp
index a4d4d95..f5e3643 100644
--- a/source/Input.cpp
+++ b/source/Input.cpp
@@ -53,7 +53,7 @@ void Input::SetState(uint8_t kdown, uint8_t kheld){
void Input::SetMouse(int16_t mouseX, int16_t mouseY, uint8_t mouseBtnState){
_mouseX = mouseX;
_mouseY = mouseY;
- _mouseBtnState = _mouseBtnState;
+ _mouseBtnState = mouseBtnState;
}
uint8_t Input::btn(){