Windows creates Alt event instead of Menu event. (to match other platforms) (#551)

* Removed VirtualKeyCode::LMenu + VirtualKeyCode::RMenu, Windows now generates VirtualKeyCode::LAlt + VirtualKeyCode::RAlt instead.

* CHANGELOG nits
This commit is contained in:
Lucas Kent 2018-06-14 03:24:33 +10:00 committed by Francesca Frangipane
parent 23c384bd30
commit f083dae328
4 changed files with 4 additions and 6 deletions

View file

@ -1,5 +1,7 @@
# Unreleased # Unreleased
- **Breaking:** Removed `VirtualKeyCode::LMenu` and `VirtualKeyCode::RMenu`; Windows now generates `VirtualKeyCode::LAlt` and `VirtualKeyCode::RAlt` instead.
# Version 0.15.1 (2018-06-13) # Version 0.15.1 (2018-06-13)
- On X11, the `Moved` event is no longer sent when the window is resized without changing position. - On X11, the `Moved` event is no longer sent when the window is resized without changing position.

View file

@ -383,7 +383,6 @@ pub enum VirtualKeyCode {
LAlt, LAlt,
LBracket, LBracket,
LControl, LControl,
LMenu,
LShift, LShift,
LWin, LWin,
Mail, Mail,
@ -408,7 +407,6 @@ pub enum VirtualKeyCode {
RAlt, RAlt,
RBracket, RBracket,
RControl, RControl,
RMenu,
RShift, RShift,
RWin, RWin,
Semicolon, Semicolon,

View file

@ -247,7 +247,6 @@ fn keysym_to_vkey(keysym: u32) -> Option<VirtualKeyCode> {
keysyms::XKB_KEY_Alt_L => Some(VirtualKeyCode::LAlt), keysyms::XKB_KEY_Alt_L => Some(VirtualKeyCode::LAlt),
// => Some(VirtualKeyCode::LBracket), // => Some(VirtualKeyCode::LBracket),
keysyms::XKB_KEY_Control_L => Some(VirtualKeyCode::LControl), keysyms::XKB_KEY_Control_L => Some(VirtualKeyCode::LControl),
// => Some(VirtualKeyCode::LMenu),
keysyms::XKB_KEY_Shift_L => Some(VirtualKeyCode::LShift), keysyms::XKB_KEY_Shift_L => Some(VirtualKeyCode::LShift),
// => Some(VirtualKeyCode::LWin), // => Some(VirtualKeyCode::LWin),
// => Some(VirtualKeyCode::Mail), // => Some(VirtualKeyCode::Mail),
@ -270,7 +269,6 @@ fn keysym_to_vkey(keysym: u32) -> Option<VirtualKeyCode> {
keysyms::XKB_KEY_Alt_R => Some(VirtualKeyCode::RAlt), keysyms::XKB_KEY_Alt_R => Some(VirtualKeyCode::RAlt),
// => Some(VirtualKeyCode::RBracket), // => Some(VirtualKeyCode::RBracket),
keysyms::XKB_KEY_Control_R => Some(VirtualKeyCode::RControl), keysyms::XKB_KEY_Control_R => Some(VirtualKeyCode::RControl),
// => Some(VirtualKeyCode::RMenu),
keysyms::XKB_KEY_Shift_R => Some(VirtualKeyCode::RShift), keysyms::XKB_KEY_Shift_R => Some(VirtualKeyCode::RShift),
// => Some(VirtualKeyCode::RWin), // => Some(VirtualKeyCode::RWin),
keysyms::XKB_KEY_semicolon => Some(VirtualKeyCode::Semicolon), keysyms::XKB_KEY_semicolon => Some(VirtualKeyCode::Semicolon),

View file

@ -45,8 +45,8 @@ pub fn vkey_to_winit_vkey(vkey: c_int) -> Option<VirtualKeyCode> {
winuser::VK_RSHIFT => Some(VirtualKeyCode::RShift), winuser::VK_RSHIFT => Some(VirtualKeyCode::RShift),
winuser::VK_LCONTROL => Some(VirtualKeyCode::LControl), winuser::VK_LCONTROL => Some(VirtualKeyCode::LControl),
winuser::VK_RCONTROL => Some(VirtualKeyCode::RControl), winuser::VK_RCONTROL => Some(VirtualKeyCode::RControl),
winuser::VK_LMENU => Some(VirtualKeyCode::LMenu), winuser::VK_LMENU => Some(VirtualKeyCode::LAlt),
winuser::VK_RMENU => Some(VirtualKeyCode::RMenu), winuser::VK_RMENU => Some(VirtualKeyCode::RAlt),
winuser::VK_PAUSE => Some(VirtualKeyCode::Pause), winuser::VK_PAUSE => Some(VirtualKeyCode::Pause),
winuser::VK_CAPITAL => Some(VirtualKeyCode::Capital), winuser::VK_CAPITAL => Some(VirtualKeyCode::Capital),
winuser::VK_KANA => Some(VirtualKeyCode::Kana), winuser::VK_KANA => Some(VirtualKeyCode::Kana),