From 6159d531b3ad802e4f4e679e154bfc0887bf4305 Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Fri, 20 Dec 2024 08:07:02 -0500 Subject: Re-added vanilla input integration --- src/input/systems.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/input') diff --git a/src/input/systems.rs b/src/input/systems.rs index e851977..8add8b2 100644 --- a/src/input/systems.rs +++ b/src/input/systems.rs @@ -54,13 +54,22 @@ pub fn input_handling( if let Some(key_code) = crossterm_keycode_to_bevy_keycode(event.code) { if let Some(logical_key) = crossterm_keycode_to_bevy_key(event.code) { match event.kind { - KeyEventKind::Press | KeyEventKind::Repeat => { - // input.press(event.code); + KeyEventKind::Press => { key_event_writer.send(KeyboardInput { key_code, logical_key, state: ButtonState::Pressed, window, + repeat: false, + }); + } + KeyEventKind::Repeat => { + key_event_writer.send(KeyboardInput { + key_code, + logical_key, + state: ButtonState::Pressed, + window, + repeat: true, }); } KeyEventKind::Release => { @@ -69,6 +78,7 @@ pub fn input_handling( logical_key, state: ButtonState::Released, window, + repeat: false, }); } } -- cgit v1.2.3