aboutsummaryrefslogtreecommitdiff
path: root/src/editor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/editor.rs')
-rw-r--r--src/editor.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/editor.rs b/src/editor.rs
index 2cf2e41..abbc401 100644
--- a/src/editor.rs
+++ b/src/editor.rs
@@ -112,18 +112,21 @@ impl Editor {
transform: &Transform,
snapper: &Snapper,
mouse_blocked: bool,
+ keyboard_captured: bool,
) {
// Handle keybindings for tool change
- for (&tool_type, (_, activation_key)) in self.tools.iter() {
- if activation_key.is_pressed(rl, false) {
- // Don't do anything if the tool does not change.
- if tool_type == self.active {
+ if !keyboard_captured {
+ for (&tool_type, (_, activation_key)) in self.tools.iter() {
+ if activation_key.is_pressed(rl, false) {
+ // Don't do anything if the tool does not change.
+ if tool_type == self.active {
+ break;
+ }
+
+ // Activate the tool of which the key binding has been pressed.
+ self.set_active(tool_type);
break;
}
-
- // Activate the tool of which the key binding has been pressed.
- self.set_active(tool_type);
- break;
}
}