Skip to content

Commit

Permalink
Merge pull request #232 from StaffEngineer/fix-keyboard
Browse files Browse the repository at this point in the history
Fix action from shortcut
  • Loading branch information
Dimchikkk authored Dec 6, 2023
2 parents c7e9fb8 + bbc2eec commit 6ead7e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ license = "MIT OR Apache-2.0"
description = "App for brainstorming & sharing ideas 🦀 Learning Project"
repository = "https://github.com/StaffEngineer/velo.git"
readme = "Readme.md"
version = "0.9.2"
version = "0.9.3"
edition = "2021"

exclude = ["assets/fonts/*", "velo.gif", "velo.png"]
Expand Down
6 changes: 5 additions & 1 deletion src/ui_plugin/systems/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn keyboard_input_system(
mut app_state: ResMut<AppState>,
mut ui_state: ResMut<UiState>,
mut events: EventWriter<AddRect<(String, Color)>>,
input: Res<Input<KeyCode>>,
mut input: ResMut<Input<KeyCode>>,
windows: Query<&Window, With<PrimaryWindow>>,
mut editable_text_query: Query<
(&EditableText, &mut CosmicEdit, &mut CosmicEditHistory),
Expand Down Expand Up @@ -143,6 +143,7 @@ pub fn keyboard_input_system(
},
image: None,
});
input.release_all()
} else if command && input.just_pressed(KeyCode::R) {
events.send(AddRect {
node: JsonNode {
Expand All @@ -161,6 +162,7 @@ pub fn keyboard_input_system(
},
image: None,
});
input.release_all()
} else if command && input.just_pressed(KeyCode::O) {
events.send(AddRect {
node: JsonNode {
Expand All @@ -179,6 +181,7 @@ pub fn keyboard_input_system(
},
image: None,
});
input.release_all()
} else if input.just_pressed(KeyCode::Delete) {
if let Some(id) = ui_state.entity_to_edit {
for (entity, node) in velo_node_query.iter() {
Expand All @@ -187,6 +190,7 @@ pub fn keyboard_input_system(
}
}
}
input.release_all()
} else {
for (editable_text, mut cosmic_edit, mut cosmit_edit_history) in
&mut editable_text_query.iter_mut()
Expand Down

0 comments on commit 6ead7e3

Please sign in to comment.