summaryrefslogtreecommitdiff
path: root/platform/uwp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-03-25 16:56:12 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-06-20 11:54:24 -0400
commit0ce49800acf464c2242c3f7e021b4ab8f49ec366 (patch)
treeba1b10099dfbaf9798a16f619493a49a37701dbc /platform/uwp
parente919d894f84ea86ee43a3e1b8a675b9fec28f01c (diff)
Use mouse and joypad enums instead of plain integers
Also MIDIMessage
Diffstat (limited to 'platform/uwp')
-rw-r--r--platform/uwp/app.cpp6
-rw-r--r--platform/uwp/os_uwp.cpp4
-rw-r--r--platform/uwp/os_uwp.h4
3 files changed, 6 insertions, 8 deletions
diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp
index 570c41a8b3..1da17ffc5d 100644
--- a/platform/uwp/app.cpp
+++ b/platform/uwp/app.cpp
@@ -145,7 +145,7 @@ void App::SetWindow(CoreWindow ^ p_window) {
Main::setup2();
}
-static int _get_button(Windows::UI::Input::PointerPoint ^ pt) {
+static MouseButton _get_button(Windows::UI::Input::PointerPoint ^ pt) {
using namespace Windows::UI::Input;
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
@@ -177,7 +177,7 @@ static int _get_button(Windows::UI::Input::PointerPoint ^ pt) {
}
#endif
- return 0;
+ return MOUSE_BUTTON_NONE;
};
static bool _is_touch(Windows::UI::Input::PointerPoint ^ pointerPoint) {
@@ -241,7 +241,7 @@ static int _get_finger(uint32_t p_touch_id) {
void App::pointer_event(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args, bool p_pressed, bool p_is_wheel) {
Windows::UI::Input::PointerPoint ^ point = args->CurrentPoint;
Windows::Foundation::Point pos = _get_pixel_position(window, point->Position, os);
- int but = _get_button(point);
+ MouseButton but = _get_button(point);
if (_is_touch(point)) {
Ref<InputEventScreenTouch> screen_touch;
screen_touch.instantiate();
diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp
index b0f6bbd330..e26e204f5f 100644
--- a/platform/uwp/os_uwp.cpp
+++ b/platform/uwp/os_uwp.cpp
@@ -126,8 +126,6 @@ void OS_UWP::set_keep_screen_on(bool p_enabled) {
}
void OS_UWP::initialize_core() {
- last_button_state = 0;
-
//RedirectIOToConsole();
FileAccess::make_default<FileAccessWindows>(FileAccess::ACCESS_RESOURCES);
@@ -423,7 +421,7 @@ Point2 OS_UWP::get_mouse_position() const {
return Point2(old_x, old_y);
}
-int OS_UWP::get_mouse_button_state() const {
+MouseButton OS_UWP::get_mouse_button_state() const {
return last_button_state;
}
diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h
index a4d3d6d52a..3a735889b0 100644
--- a/platform/uwp/os_uwp.h
+++ b/platform/uwp/os_uwp.h
@@ -106,7 +106,7 @@ private:
bool control_mem;
bool meta_mem;
bool force_quit;
- uint32_t last_button_state;
+ MouseButton last_button_state = MOUSE_BUTTON_NONE;
CursorShape cursor_shape;
@@ -173,7 +173,7 @@ public:
MouseMode get_mouse_mode() const;
virtual Point2 get_mouse_position() const;
- virtual int get_mouse_button_state() const;
+ virtual MouseButton get_mouse_button_state() const;
virtual void set_window_title(const String &p_title);
virtual void set_video_mode(const VideoMode &p_video_mode, int p_screen = 0);