diff --git a/src/windows.rs b/src/windows.rs index 8800c96..52fa9ef 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -297,6 +297,23 @@ impl Window { } } + pub fn get_keys(&self) -> Option> { + let mut index: u16 = 0; + let mut keys: Vec = Vec::new(); + + for i in self.keys.iter() { + if *i { + unsafe { + keys.push(mem::transmute(index as u8)); + } + } + + index += 1; + } + + Some(keys) + } + #[inline] pub fn is_key_down(&self, key: Key) -> bool { return self.keys[key as usize];