Clippy fixes (#2011)
* windows: bump winapi version * windows: address dark_mode FIXMEs use now available winapi structures * clippy: fix clippy::upper_case_acronyms warnings * clippy: fix needless_arbitrary_self_type warnings * clippy: fix clone_on_copy warnings * clippy: fix unnecessary_mut_passed warnings * clippy: fix identity_op warnings * clippy: fix misc warnings * prefix rustdoc lints with rustdoc:: the prefix was introduced in Rust 1.52 * windows: silence file_drop_handler is never read warning * clippy: fix from_over_into warnings and a bit of naming simplification * clippy: fix missing_safety_doc warnings * make dummy() functions const
This commit is contained in:
parent
9e72396709
commit
1b3b82a3c1
22 changed files with 119 additions and 143 deletions
|
|
@ -39,8 +39,8 @@ pub fn get_key_mods() -> ModifiersState {
|
|||
bitflags! {
|
||||
#[derive(Default)]
|
||||
pub struct ModifiersStateSide: u32 {
|
||||
const LSHIFT = 0b010 << 0;
|
||||
const RSHIFT = 0b001 << 0;
|
||||
const LSHIFT = 0b010;
|
||||
const RSHIFT = 0b001;
|
||||
|
||||
const LCTRL = 0b010 << 3;
|
||||
const RCTRL = 0b001 << 3;
|
||||
|
|
@ -343,7 +343,7 @@ pub fn handle_extended_keys(
|
|||
extended: bool,
|
||||
) -> Option<(c_int, UINT)> {
|
||||
// Welcome to hell https://blog.molecular-matters.com/2011/09/05/properly-handling-keyboard-input/
|
||||
scancode = if extended { 0xE000 } else { 0x0000 } | scancode;
|
||||
scancode |= if extended { 0xE000 } else { 0x0000 };
|
||||
let vkey = match vkey {
|
||||
winuser::VK_SHIFT => unsafe {
|
||||
winuser::MapVirtualKeyA(scancode, winuser::MAPVK_VSC_TO_VK_EX) as _
|
||||
|
|
@ -369,7 +369,7 @@ pub fn handle_extended_keys(
|
|||
// Don't emit anything for the LeftControl event in the pair...
|
||||
0xE01D if vkey == winuser::VK_PAUSE => return None,
|
||||
// ...and emit the Pause event for the second event in the pair.
|
||||
0x45 if vkey == winuser::VK_PAUSE || vkey == 0xFF as _ => {
|
||||
0x45 if vkey == winuser::VK_PAUSE || vkey == 0xFF => {
|
||||
scancode = 0xE059;
|
||||
winuser::VK_PAUSE
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue