aboutsummaryrefslogtreecommitdiff
path: root/src/structs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/structs.rs')
-rw-r--r--src/structs.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/structs.rs b/src/structs.rs
index dd2c0cfe9..060c2b060 100644
--- a/src/structs.rs
+++ b/src/structs.rs
@@ -1,3 +1,5 @@
1use crate::events::Event;
2
1macro_rules! impl_bytes { 3macro_rules! impl_bytes {
2 ($t:ident) => { 4 ($t:ident) => {
3 impl $t { 5 impl $t {
@@ -157,3 +159,10 @@ pub struct EventMask {
157 pub events: [u8; 24], 159 pub events: [u8; 24],
158} 160}
159impl_bytes!(EventMask); 161impl_bytes!(EventMask);
162
163impl EventMask {
164 pub fn unset(&mut self, evt: Event) {
165 let evt = evt as u8 as usize;
166 self.events[evt / 8] &= !(1 << (evt % 8));
167 }
168}