plugins
This commit is contained in:
parent
53e4047e6a
commit
178c344859
4 changed files with 125 additions and 118 deletions
|
|
@ -1,19 +1,12 @@
|
|||
// use bevy::ecs::message::MessageReader;
|
||||
use bevy::app::AppExit;
|
||||
use bevy::input::keyboard::Key;
|
||||
use bevy::prelude::*;
|
||||
use bevy_ratatui::crossterm::event::KeyCode;
|
||||
use bevy_ratatui::event::KeyMessage;
|
||||
|
||||
pub(crate) fn input_system(
|
||||
mut messages: MessageReader<KeyMessage>,
|
||||
mut exit: MessageWriter<AppExit>,
|
||||
pub(crate) fn keyboard_input_system(
|
||||
input: Res<ButtonInput<KeyCode>>,
|
||||
key_input: Res<ButtonInput<Key>>,
|
||||
) {
|
||||
for message in messages.read() {
|
||||
match message.code {
|
||||
KeyCode::Char('q') => {
|
||||
exit.write_default();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue