Merge branch 'make-shift-modifier-available' into 'main'

input: Add the `Shift`-modifier

See merge request World/Phosh/squeekboard!696
This commit is contained in:
Marge Bot
2024-11-05 19:37:02 +00:00
3 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,7 @@ pub enum Modifier {
/// Control and Alt are the only modifiers /// Control and Alt are the only modifiers
/// which doesn't interfere with levels, /// which doesn't interfere with levels,
/// so it's simple to implement as levels are deprecated in squeekboard. /// so it's simple to implement as levels are deprecated in squeekboard.
Shift,
Control, Control,
Alt, Alt,
Mod4, Mod4,

View File

@ -420,6 +420,9 @@ fn create_action<H: logging::Handler>(
}).collect(), }).collect(),
}, },
SubmitData::Modifier(modifier) => match modifier { SubmitData::Modifier(modifier) => match modifier {
Modifier::Shift => action::Action::ApplyModifier(
action::Modifier::Shift,
),
Modifier::Control => action::Action::ApplyModifier( Modifier::Control => action::Action::ApplyModifier(
action::Modifier::Control, action::Modifier::Control,
), ),

View File

@ -238,6 +238,7 @@ impl Submission {
fn update_modifiers(&mut self) { fn update_modifiers(&mut self) {
let raw_modifiers = self.modifiers_active.iter() let raw_modifiers = self.modifiers_active.iter()
.map(|(_id, m)| match m { .map(|(_id, m)| match m {
Modifier::Shift => Modifiers::SHIFT,
Modifier::Control => Modifiers::CONTROL, Modifier::Control => Modifiers::CONTROL,
Modifier::Alt => Modifiers::MOD1, Modifier::Alt => Modifiers::MOD1,
Modifier::Mod4 => Modifiers::MOD4, Modifier::Mod4 => Modifiers::MOD4,