summaryrefslogtreecommitdiff
path: root/platform/windows/display_server_windows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows/display_server_windows.cpp')
-rw-r--r--platform/windows/display_server_windows.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index fe7d91dc18..d2889a3442 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -1719,6 +1719,8 @@ DisplayServer::CursorShape DisplayServerWindows::cursor_get_shape() const {
void DisplayServerWindows::cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
_THREAD_SAFE_METHOD_
+ ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
+
if (p_cursor.is_valid()) {
RBMap<CursorShape, Vector<Variant>>::Element *cursor_c = cursors_cache.find(p_shape);
@@ -3668,10 +3670,18 @@ void DisplayServerWindows::_process_key_events() {
}
k->set_window_id(ke.window_id);
- k->set_shift_pressed(ke.shift);
- k->set_alt_pressed(ke.alt);
- k->set_ctrl_pressed(ke.control);
- k->set_meta_pressed(ke.meta);
+ if (keycode != Key::SHIFT) {
+ k->set_shift_pressed(ke.shift);
+ }
+ if (keycode != Key::ALT) {
+ k->set_alt_pressed(ke.alt);
+ }
+ if (keycode != Key::CTRL) {
+ k->set_ctrl_pressed(ke.control);
+ }
+ if (keycode != Key::META) {
+ k->set_meta_pressed(ke.meta);
+ }
k->set_pressed(true);
k->set_keycode(keycode);
k->set_physical_keycode(physical_keycode);
@@ -3693,11 +3703,6 @@ void DisplayServerWindows::_process_key_events() {
k.instantiate();
k->set_window_id(ke.window_id);
- k->set_shift_pressed(ke.shift);
- k->set_alt_pressed(ke.alt);
- k->set_ctrl_pressed(ke.control);
- k->set_meta_pressed(ke.meta);
-
k->set_pressed(ke.uMsg == WM_KEYDOWN);
Key keycode = KeyMappingWindows::get_keysym(ke.wParam);
@@ -3719,6 +3724,18 @@ void DisplayServerWindows::_process_key_events() {
}
}
+ if (keycode != Key::SHIFT) {
+ k->set_shift_pressed(ke.shift);
+ }
+ if (keycode != Key::ALT) {
+ k->set_alt_pressed(ke.alt);
+ }
+ if (keycode != Key::CTRL) {
+ k->set_ctrl_pressed(ke.control);
+ }
+ if (keycode != Key::META) {
+ k->set_meta_pressed(ke.meta);
+ }
k->set_keycode(keycode);
k->set_physical_keycode(physical_keycode);
k->set_key_label(key_label);