mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-27 19:16:34 +11:00
Merge pull request #2 from kondrak/windows-rs
added support for Ctrl and Shift keys
This commit is contained in:
commit
cacc5b564b
2 changed files with 9 additions and 1 deletions
|
@ -135,8 +135,12 @@ pub enum Key {
|
||||||
Space,
|
Space,
|
||||||
Tab,
|
Tab,
|
||||||
CapsLock,
|
CapsLock,
|
||||||
|
LeftShift,
|
||||||
|
RightShift,
|
||||||
|
LeftCtrl,
|
||||||
|
RightCtrl,
|
||||||
|
|
||||||
Count = 80,
|
Count = 84,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
|
|
|
@ -106,6 +106,10 @@ fn update_key_state(window: &mut Window, wparam: u32, state: bool) {
|
||||||
0x039 => window.keys[Key::Space as usize] = state,
|
0x039 => window.keys[Key::Space as usize] = state,
|
||||||
0x00F => window.keys[Key::Tab as usize] = state,
|
0x00F => window.keys[Key::Tab as usize] = state,
|
||||||
0x03A => window.keys[Key::CapsLock as usize] = state,
|
0x03A => window.keys[Key::CapsLock as usize] = state,
|
||||||
|
0x02A => window.keys[Key::LeftShift as usize] = state,
|
||||||
|
0x036 => window.keys[Key::RightShift as usize] = state,
|
||||||
|
0x01D => window.keys[Key::LeftCtrl as usize] = state,
|
||||||
|
0x11D => window.keys[Key::RightCtrl as usize] = state,
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue