aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 4e90b21..b4703a2 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -10,6 +10,7 @@ use std::path::Path;
pub struct Config {
pub deletion_keybindings: DeletionToolKeybindings,
pub icon_keybindings: IconToolKeybindings,
+ pub polygon_keybindings: PolygonRoomToolKeybindings,
pub room_keybindings: RoomToolKeybindings,
pub wall_keybindings: WallToolKeybindings,
}
@@ -38,6 +39,14 @@ pub struct IconToolKeybindings {
}
#[derive(Serialize, Deserialize)]
+pub struct PolygonRoomToolKeybindings {
+ pub activation: Button,
+ pub place_node: Button,
+ pub finish: Button,
+ pub abort: Button,
+}
+
+#[derive(Serialize, Deserialize)]
pub struct RoomToolKeybindings {
pub activation: Button,
pub start_draw: Button,
@@ -98,6 +107,12 @@ impl Default for Config {
rotate_counterclockwise: Button::Keyboard(KeyboardKey::Minus),
place: Button::Mouse(MouseButton::Left),
},
+ polygon_keybindings: PolygonRoomToolKeybindings {
+ activation: Button::Keyboard(KeyboardKey::P),
+ place_node: Button::Mouse(MouseButton::Left),
+ finish: Button::Keyboard(KeyboardKey::Enter),
+ abort: Button::Mouse(MouseButton::Right),
+ },
room_keybindings: RoomToolKeybindings {
activation: Button::Keyboard(KeyboardKey::R),
start_draw: Button::Mouse(MouseButton::Left),
@@ -124,6 +139,11 @@ impl ToolKeybindings for IconToolKeybindings {
self.activation
}
}
+impl ToolKeybindings for PolygonRoomToolKeybindings {
+ fn activation_key(&self) -> Button {
+ self.activation
+ }
+}
impl ToolKeybindings for RoomToolKeybindings {
fn activation_key(&self) -> Button {
self.activation