From 9874181ccdb7e93e4a5114c2ed12a2c752ccdae4 Mon Sep 17 00:00:00 2001 From: TakWolf Date: Tue, 26 Mar 2019 02:05:07 +0800 Subject: [PATCH] fix command key event left and right reverse on macOS (#810) * fix command key event left and right reverse on macOS https://github.com/tomaka/winit/issues/808 * update changelog --- CHANGELOG.md | 1 + src/platform_impl/macos/event_loop.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d62c34ea..3ea4f9d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ - Removed `serde` implementations from `ControlFlow`. - On Windows, fix `CursorMoved(0, 0)` getting dispatched on window focus. +- On macOS, fix command key event left and right reverse. - On FreeBSD, NetBSD, and OpenBSD, fix build of X11 backend. # Version 0.19.0 (2019-03-06) diff --git a/src/platform_impl/macos/event_loop.rs b/src/platform_impl/macos/event_loop.rs index f7a1642e..8442da6d 100644 --- a/src/platform_impl/macos/event_loop.rs +++ b/src/platform_impl/macos/event_loop.rs @@ -660,8 +660,8 @@ pub fn scancode_to_keycode(code: c_ushort) -> Option { 0x33 => events::VirtualKeyCode::Back, //0x34 => unkown, 0x35 => events::VirtualKeyCode::Escape, - 0x36 => events::VirtualKeyCode::LWin, - 0x37 => events::VirtualKeyCode::RWin, + 0x36 => events::VirtualKeyCode::RWin, + 0x37 => events::VirtualKeyCode::LWin, 0x38 => events::VirtualKeyCode::LShift, //0x39 => Caps lock, 0x3a => events::VirtualKeyCode::LAlt,