modifiers: Support Control and Alt
Control and Alt are special in that they aren't expected to switch levels, and so don't need to change what characters are output. Use in layouts by adding `modifier: Control` or `modifier: Alt` in place of `text: "foo"`. The latching of the modifier will force the keyboard to emit raw key presses and prevent it from outputting text.
This commit is contained in:
@ -990,6 +990,18 @@ mod seat {
|
||||
)
|
||||
.apply()
|
||||
},
|
||||
Action::ApplyModifier(modifier) => {
|
||||
// FIXME: key id is unneeded with stateless locks
|
||||
let key_id = KeyState::get_id(rckey);
|
||||
let gets_locked = !submission.is_modifier_active(modifier.clone());
|
||||
match gets_locked {
|
||||
true => submission.handle_add_modifier(
|
||||
key_id,
|
||||
modifier, time,
|
||||
),
|
||||
false => submission.handle_drop_modifier(key_id, time),
|
||||
}
|
||||
}
|
||||
// only show when UI is present
|
||||
Action::ShowPreferences => if let Some(ui) = &ui {
|
||||
// only show when layout manager is available
|
||||
@ -1016,10 +1028,6 @@ mod seat {
|
||||
}
|
||||
}
|
||||
},
|
||||
Action::SetModifier(_) => log_print!(
|
||||
logging::Level::Bug,
|
||||
"Modifiers unsupported",
|
||||
),
|
||||
};
|
||||
|
||||
let pointer = ::util::Pointer(rckey.clone());
|
||||
|
||||
Reference in New Issue
Block a user