Edit selected text layer by hitting Enter (#1000)

* Allow text editing when pressing Enter on a single selected text layer

* Updated LayerDataType import

* Extract the logic to set the edit layer into a function

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Shouvik Ghosh
2023-01-31 09:19:50 -08:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent 52e49bcf75
commit e784c69cae
3 changed files with 62 additions and 18 deletions
@@ -52,7 +52,7 @@ pub fn default_mapping() -> Mapping {
entry!(PointerMove; refresh_keys=[Control, Shift, Alt], action_dispatch=SelectToolMessage::PointerMove { axis_align: Shift, snap_angle: Control, center: Alt, duplicate: Alt }),
entry!(KeyDown(Lmb); action_dispatch=SelectToolMessage::DragStart { add_to_selection: Shift }),
entry!(KeyUp(Lmb); action_dispatch=SelectToolMessage::DragStop),
entry!(KeyDown(Enter); action_dispatch=SelectToolMessage::DragStop),
entry!(KeyDown(Enter); action_dispatch=SelectToolMessage::Enter),
entry!(DoubleClick; action_dispatch=SelectToolMessage::EditLayer),
entry!(KeyDown(Rmb); action_dispatch=SelectToolMessage::Abort),
entry!(KeyDown(Escape); action_dispatch=SelectToolMessage::Abort),