diff options
author | Matias Linares <matiaslina@openmailbox.org> | 2016-09-04 14:01:37 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@openmailbox.org> | 2016-09-04 14:01:37 -0300 |
commit | 5bcdb566c69523edb1ceb857cbf6d0a676cc318d (patch) | |
tree | d3506fee02510999128fdfb5ec6a84ca99c9962b /src/socket/mod.rs | |
parent | 67306a1f063f15bc8127cdc2f72f971f2d06dd69 (diff) | |
download | dotwm-5bcdb566c69523edb1ceb857cbf6d0a676cc318d.tar.gz |
Add Mouse drag support.
This concludes the first 'release' :p.
Diffstat (limited to 'src/socket/mod.rs')
-rw-r--r-- | src/socket/mod.rs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/socket/mod.rs b/src/socket/mod.rs index c29db2b..6ee1c09 100644 --- a/src/socket/mod.rs +++ b/src/socket/mod.rs @@ -11,7 +11,8 @@ use command::*; #[derive(Debug,PartialEq)] pub enum FnType { - Bind, + BindKey, + BindButton, Exec, } @@ -25,11 +26,20 @@ pub struct ParsedCmd<'a> { impl<'a> ParsedCmd<'a> { pub fn handle(self, wm: &mut DotWM, bindings: &mut BindingHash) { - if self.f == FnType::Bind { - let modifier: u32 = self.modifiers.iter() - .fold(0, |acc, x| acc | x ); - add_binding(wm, bindings, - self.key, modifier, self.func, &self.args); + match self.f { + FnType::BindKey => { + let modifier: u32 = self.modifiers.iter() + .fold(0, |acc, x| acc | x ); + add_binding(wm, bindings, + self.key, modifier, self.func, &self.args); + }, + FnType::BindButton => { + let modifier: u32 = self.modifiers.iter() + .fold(0, |acc, x| acc | x); + add_button_binding(wm, bindings, self.key, + modifier, self.func, &self.args); + }, + _ => {}, } } } |