From 5bcdb566c69523edb1ceb857cbf6d0a676cc318d Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Sun, 4 Sep 2016 14:01:37 -0300 Subject: Add Mouse drag support. This concludes the first 'release' :p. --- src/socket/mod.rs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/socket/mod.rs') 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); + }, + _ => {}, } } } -- cgit v1.2.3-70-g09d2