/// On windows, AltGr == Ctrl + Alt
///
/// Due to this equivalence, the system generates a fake Ctrl key-press (and key-release) preceeding
/// every AltGr key-press (and key-release). We check if the current event is a Ctrl event and if
/// the next event is a right Alt (AltGr) event. If this is the case, the current event must be the
/// fake Ctrl event.
On windows, AltGr == Ctrl + Alt
Due to this equivalence, the system generates a fake Ctrl key-press (and key-release) preceeding
every AltGr key-press (and key-release). We check if the current event is a Ctrl event and if
the next event is a right Alt (AltGr) event. If this is the case, the current event must be the
fake Ctrl event.
On windows AltGr == Ctrl + Alt Due to this equivalence the system generates a fake Ctrl key - press ( and key - release ) preceeding every AltGr key - press ( and key - release ) . We check if the current event is a Ctrl event and if the next event is a right Alt ( AltGr ) event . If this is the case the current event must be the fake Ctrl event .
fn is_current_fake(
    curr_info: &PartialKeyEventInfo,
    next_msg: winuser::MSG,
    layout: &Layout,
) -> bool {
    let curr_is_ctrl = matches!(curr_info.logical_key, PartialLogicalKey::This(Key::Control));
    if layout.has_alt_graph {
        let next_code = ex_scancode_from_lparam(next_msg.lParam);
        let next_is_altgr = next_code == 0xE038; // 0xE038 is right alt
        if curr_is_ctrl && next_is_altgr {
            return true;
        }
    }
    false
}
fn is_current_fake ( curr_info : & PartialKeyEventInfo , next_msg : winuser :: MSG , layout : & Layout , ) -> bool { let curr_is_ctrl = matches ! ( curr_info logical_key PartialLogicalKey This ( Key Control ) ) ; if layout . has_alt_graph { let next_code = ex_scancode_from_lparam ( next_msg . lParam ) ; let next_is_altgr = next_code == 0xE038 ; // 0xE038 is right alt if curr_is_ctrl && next_is_altgr { return true ; } } false }
On windows, AltGr == Ctrl + Alt
Due to this equivalence, the system generates a fake Ctrl key-press (and key-release) preceeding
every AltGr key-press (and key-release).
On windows AltGr == Ctrl + Alt Due to this equivalence the system generates a fake Ctrl key - press ( and key - release ) preceeding every AltGr key - press ( and key - release ) .
curr_info
&PartialKeyEventInfo
next_msg
winuser::MSG
layout
&Layout