diff --git a/src/input.rs b/src/input.rs index 778b153f..0fb3e8b6 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1,5 +1,7 @@ //! Cross-platform mouse, keyboard (and gamepads soon) module. +use std::collections::HashSet; + use crate::get_context; use crate::prelude::screen_height; use crate::prelude::screen_width; @@ -156,6 +158,21 @@ pub fn get_last_key_pressed() -> Option { context.keys_pressed.iter().next().cloned() } +pub fn get_keys_pressed() -> HashSet { + let context = get_context(); + context.keys_pressed.clone() +} + +pub fn get_keys_down() -> HashSet { + let context = get_context(); + context.keys_down.clone() +} + +pub fn get_keys_released() -> HashSet { + let context = get_context(); + context.keys_released.clone() +} + /// Clears input queue pub fn clear_input_queue() { let context = get_context();