drop unused press prefix+suffix and release suffix
parent
9a477c48cc
commit
28d2a7cca9
|
|
@ -37,8 +37,7 @@ pub struct Device {
|
|||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct GUI {
|
||||
pub buttons: Buttons,
|
||||
pub press: PreSufFix,
|
||||
pub release: PreSufFix,
|
||||
pub release_prefix: String,
|
||||
pub format: Option<String>,
|
||||
pub user: String,
|
||||
pub feedback: GUIFeedback,
|
||||
|
|
@ -49,12 +48,6 @@ pub struct GUIFeedback {
|
|||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct PreSufFix {
|
||||
pub prefix: String,
|
||||
pub suffix: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct Buttons {
|
||||
pub up: String,
|
||||
|
|
@ -128,14 +121,7 @@ fn build_config_std() -> Config {
|
|||
l: env::var("INPUT_GUI_BUTTON_L").unwrap_or(String::from("q")),
|
||||
r: env::var("INPUT_GUI_BUTTON_R").unwrap_or(String::from("e")),
|
||||
},
|
||||
press: PreSufFix{
|
||||
prefix: env::var("INPUT_GUI_PRESS_PREFIX").unwrap_or(String::from("")),
|
||||
suffix: env::var("INPUT_GUI_PRESS_SUFFIX").unwrap_or(String::from("")),
|
||||
},
|
||||
release: PreSufFix{
|
||||
prefix: env::var("INPUT_GUI_RELEASE_PREFIX").unwrap_or(String::from("")),
|
||||
suffix: env::var("INPUT_GUI_RELEASE_SUFFIX").unwrap_or(String::from("")),
|
||||
},
|
||||
release_prefix: env::var("INPUT_GUI_RELEASE_PREFIX").unwrap_or(String::from("")),
|
||||
user: env::var("INPUT_GUI_USER").unwrap_or(String::from("me")),
|
||||
format: match env::var("INPUT_GUI_FORMAT") {
|
||||
Ok(x) => Some(x),
|
||||
|
|
|
|||
16
src/gui.rs
16
src/gui.rs
|
|
@ -113,6 +113,9 @@ impl Main {
|
|||
}
|
||||
}
|
||||
|
||||
fn send_say(&mut self, text: String) {
|
||||
}
|
||||
|
||||
fn exchange(&mut self) {
|
||||
self.exchange_send();
|
||||
self.exchange_recv();
|
||||
|
|
@ -134,15 +137,9 @@ impl Main {
|
|||
for key_code in self.keys_newly_down.iter() {
|
||||
match self.key_code_to_string(key_code) {
|
||||
Some(x) => {
|
||||
for c in self.flags.cfg.press.prefix.chars() {
|
||||
s.push(c);
|
||||
}
|
||||
for c in x.chars() {
|
||||
s.push(c);
|
||||
}
|
||||
for c in self.flags.cfg.press.suffix.chars() {
|
||||
s.push(c);
|
||||
}
|
||||
self.keys_already_down.push(*key_code);
|
||||
},
|
||||
None => {},
|
||||
|
|
@ -154,13 +151,10 @@ impl Main {
|
|||
match self.key_code_to_string(key_code) {
|
||||
Some(x) => {
|
||||
for c in x.chars() {
|
||||
for c in self.flags.cfg.release.prefix.chars() {
|
||||
for c in self.flags.cfg.release_prefix.chars() {
|
||||
t.push(c);
|
||||
}
|
||||
t.push(c);
|
||||
for c in self.flags.cfg.release.suffix.chars() {
|
||||
t.push(c);
|
||||
}
|
||||
}
|
||||
},
|
||||
None => {},
|
||||
|
|
@ -249,8 +243,8 @@ impl Application for Main {
|
|||
self.input_text_entry_value = payload;
|
||||
},
|
||||
Message::InputTextEntrySubmitSay => {
|
||||
self.send_say(self.input_text_entry_value.clone());
|
||||
self.input_text_entry_value = String::from("");
|
||||
eprintln!("TODO");
|
||||
},
|
||||
Message::InputTextEntrySubmitSend => {
|
||||
self.input_text_entry_value = String::from("");
|
||||
|
|
|
|||
Loading…
Reference in New Issue