diff options
author | Joe Wilm <joe@jwilm.com> | 2016-07-29 18:27:26 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-07-29 18:27:26 -0700 |
commit | 90e343b36d9c18a627f8868022611cdb2d342ef0 (patch) | |
tree | a913a5aadb9aa8795fb854c0b4efa8d5b95c5b62 /src/input.rs | |
parent | 90d66e63fc0db621c3ca251da8ad3dbbb1fdb15a (diff) | |
download | alacritty-90e343b36d9c18a627f8868022611cdb2d342ef0.tar.gz alacritty-90e343b36d9c18a627f8868022611cdb2d342ef0.zip |
Early return in input handling
Don't need to handle modifier keys beyond updating state
Diffstat (limited to 'src/input.rs')
-rw-r--r-- | src/input.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/input.rs b/src/input.rs index 55594e19..ecd5fdef 100644 --- a/src/input.rs +++ b/src/input.rs @@ -272,14 +272,14 @@ impl Processor { // Handle state updates match key { - VirtualKeyCode::LAlt => self.mods.update(state, modifier::ALT_LEFT), - VirtualKeyCode::RAlt => self.mods.update(state, modifier::ALT_RIGHT), - VirtualKeyCode::LShift => self.mods.update(state, modifier::SHIFT_LEFT), - VirtualKeyCode::RShift => self.mods.update(state, modifier::SHIFT_RIGHT), - VirtualKeyCode::LControl => self.mods.update(state, modifier::CONTROL_LEFT), - VirtualKeyCode::RControl => self.mods.update(state, modifier::CONTROL_RIGHT), - VirtualKeyCode::LWin => self.mods.update(state, modifier::META_LEFT), - VirtualKeyCode::RWin => self.mods.update(state, modifier::META_RIGHT), + VirtualKeyCode::LAlt => return self.mods.update(state, modifier::ALT_LEFT), + VirtualKeyCode::RAlt => return self.mods.update(state, modifier::ALT_RIGHT), + VirtualKeyCode::LShift => return self.mods.update(state, modifier::SHIFT_LEFT), + VirtualKeyCode::RShift => return self.mods.update(state, modifier::SHIFT_RIGHT), + VirtualKeyCode::LControl => return self.mods.update(state, modifier::CONTROL_LEFT), + VirtualKeyCode::RControl => return self.mods.update(state, modifier::CONTROL_RIGHT), + VirtualKeyCode::LWin => return self.mods.update(state, modifier::META_LEFT), + VirtualKeyCode::RWin => return self.mods.update(state, modifier::META_RIGHT), _ => () } |