moirai-pal 0.7.0

Platform Abstraction Layer for Moirai async I/O operations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Win32 scan-code LPARAM encoding shared by keyboard-message tests.

use windows::Win32::Foundation::LPARAM;

pub(super) fn key_lparam(scan_code: u8, extended: bool, context: bool) -> LPARAM {
    let mut raw = u64::from(scan_code) << 16;
    if extended {
        raw |= 1 << 24;
    }
    if context {
        raw |= 1 << 29;
    }
    LPARAM(raw as isize)
}