|
|
@ -18,16 +18,14 @@ impl From<KeyModifiers> for crossterm::event::KeyModifiers {
|
|
|
|
|
|
|
|
|
|
|
|
let mut result = CKeyModifiers::NONE;
|
|
|
|
let mut result = CKeyModifiers::NONE;
|
|
|
|
|
|
|
|
|
|
|
|
if key_modifiers & KeyModifiers::SHIFT != KeyModifiers::NONE {
|
|
|
|
if key_modifiers.contains(KeyModifiers::SHIFT) {
|
|
|
|
result &= CKeyModifiers::SHIFT;
|
|
|
|
result.insert(CKeyModifiers::SHIFT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if key_modifiers.contains(KeyModifiers::CONTROL) {
|
|
|
|
if key_modifiers & KeyModifiers::CONTROL != KeyModifiers::NONE {
|
|
|
|
result.insert(CKeyModifiers::CONTROL);
|
|
|
|
result &= CKeyModifiers::CONTROL;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if key_modifiers.contains(KeyModifiers::ALT) {
|
|
|
|
if key_modifiers & KeyModifiers::ALT != KeyModifiers::NONE {
|
|
|
|
result.insert(CKeyModifiers::ALT);
|
|
|
|
result &= CKeyModifiers::ALT;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
result
|
|
|
|
result
|
|
|
@ -41,16 +39,14 @@ impl From<crossterm::event::KeyModifiers> for KeyModifiers {
|
|
|
|
|
|
|
|
|
|
|
|
let mut result = KeyModifiers::NONE;
|
|
|
|
let mut result = KeyModifiers::NONE;
|
|
|
|
|
|
|
|
|
|
|
|
if val & CKeyModifiers::SHIFT != CKeyModifiers::NONE {
|
|
|
|
if val.contains(CKeyModifiers::SHIFT) {
|
|
|
|
result &= KeyModifiers::SHIFT;
|
|
|
|
result.insert(KeyModifiers::SHIFT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if val.contains(CKeyModifiers::CONTROL) {
|
|
|
|
if val & CKeyModifiers::CONTROL != CKeyModifiers::NONE {
|
|
|
|
result.insert(KeyModifiers::CONTROL);
|
|
|
|
result &= KeyModifiers::CONTROL;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if val.contains(CKeyModifiers::ALT) {
|
|
|
|
if val & CKeyModifiers::ALT != CKeyModifiers::NONE {
|
|
|
|
result.insert(KeyModifiers::ALT);
|
|
|
|
result &= KeyModifiers::ALT;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
result
|
|
|
|
result
|
|
|
|