Merge remote-tracking branch 'upstream/master' into center

This commit is contained in:
Dorota Czaplejewicz
2020-02-05 10:32:01 +00:00
24 changed files with 310 additions and 87 deletions

View File

@ -15,6 +15,7 @@ use std::vec::Vec;
use xkbcommon::xkb;
use ::action;
use ::keyboard::{
KeyState, PressType,
generate_keymap, generate_keycodes, FormattingError
@ -264,6 +265,9 @@ enum Action {
SetView(String),
#[serde(rename="show_prefs")]
ShowPrefs,
/// Remove last character
#[serde(rename="erase")]
Erase,
}
#[derive(Debug, Clone, Deserialize, PartialEq)]
@ -386,13 +390,16 @@ impl Layout {
)
}).collect()
},
action::Action::Erase => vec![
*keymap.get("BackSpace")
.expect(&format!("BackSpace missing from keymap")),
],
_ => Vec::new(),
};
(
name.into(),
KeyState {
pressed: PressType::Released,
locked: false,
keycodes,
action,
}
@ -574,6 +581,7 @@ fn create_action<H: logging::Handler>(
SubmitData::Action(
Action::ShowPrefs
) => ::action::Action::ShowPreferences,
SubmitData::Action(Action::Erase) => action::Action::Erase,
SubmitData::Keysym(keysym) => ::action::Action::Submit {
text: None,
keys: vec!(::action::KeySym(
@ -605,7 +613,7 @@ fn create_action<H: logging::Handler>(
false => format!("U{:04X}", codepoint as u32),
})
}).collect(),
}
},
}
}