@@ -99,8 +99,8 @@ pub fn input_mappings(zoom_with_scroll: bool) -> Mapping {
9999 entry!( KeyDown ( MouseLeft ) ; action_dispatch=TransformLayerMessage :: ApplyTransformOperation { final_transform: true } ) ,
100100 entry!( KeyDown ( MouseRight ) ; action_dispatch=TransformLayerMessage :: CancelTransformOperation ) ,
101101 entry!( KeyDown ( Escape ) ; action_dispatch=TransformLayerMessage :: CancelTransformOperation ) ,
102- entry!( KeyDown ( KeyX ) ; action_dispatch=TransformLayerMessage :: ConstrainX ) ,
103- entry!( KeyDown ( KeyY ) ; action_dispatch=TransformLayerMessage :: ConstrainY ) ,
102+ entry!( KeyDownNoRepeat ( KeyX ) ; action_dispatch=TransformLayerMessage :: ConstrainX ) ,
103+ entry!( KeyDownNoRepeat ( KeyY ) ; action_dispatch=TransformLayerMessage :: ConstrainY ) ,
104104 entry!( KeyDown ( Backspace ) ; action_dispatch=TransformLayerMessage :: TypeBackspace ) ,
105105 entry!( KeyDown ( Minus ) ; action_dispatch=TransformLayerMessage :: TypeNegate ) ,
106106 entry!( KeyDown ( Comma ) ; action_dispatch=TransformLayerMessage :: TypeDecimalPoint ) ,
@@ -230,9 +230,9 @@ pub fn input_mappings(zoom_with_scroll: bool) -> Mapping {
230230 entry!( KeyDown ( MouseLeft ) ; action_dispatch=PathToolMessage :: MouseDown { extend_selection: Shift , lasso_select: Control , handle_drag_from_anchor: Alt , drag_restore_handle: Control , segment_editing_modifier: Control } ) ,
231231 entry!( KeyDown ( MouseRight ) ; action_dispatch=PathToolMessage :: RightClick ) ,
232232 entry!( KeyDown ( Escape ) ; action_dispatch=PathToolMessage :: Escape ) ,
233- entry!( KeyDown ( KeyG ) ; action_dispatch=PathToolMessage :: GRS { key: KeyG } ) ,
234- entry!( KeyDown ( KeyR ) ; action_dispatch=PathToolMessage :: GRS { key: KeyR } ) ,
235- entry!( KeyDown ( KeyS ) ; action_dispatch=PathToolMessage :: GRS { key: KeyS } ) ,
233+ entry!( KeyDownNoRepeat ( KeyG ) ; action_dispatch=PathToolMessage :: GRS { key: KeyG } ) ,
234+ entry!( KeyDownNoRepeat ( KeyR ) ; action_dispatch=PathToolMessage :: GRS { key: KeyR } ) ,
235+ entry!( KeyDownNoRepeat ( KeyS ) ; action_dispatch=PathToolMessage :: GRS { key: KeyS } ) ,
236236 entry!( PointerMove ; refresh_keys=[ KeyC , Space , Control , Shift , Alt , KeyQ , KeyW ] , action_dispatch=PathToolMessage :: PointerMove { toggle_colinear: KeyC , equidistant: Alt , move_anchor_with_handles: Space , snap_angle: Shift , lock_angle: Control , delete_segment: Alt , break_colinear_molding: Alt , segment_editing_modifier: Control } ) ,
237237 entry!( KeyDown ( Delete ) ; action_dispatch=PathToolMessage :: Delete ) ,
238238 entry!( KeyDown ( KeyA ) ; modifiers=[ Accel ] , action_dispatch=PathToolMessage :: SelectAll ) ,
@@ -278,9 +278,9 @@ pub fn input_mappings(zoom_with_scroll: bool) -> Mapping {
278278 entry!( KeyDown ( Enter ) ; action_dispatch=PenToolMessage :: Confirm ) ,
279279 entry!( KeyDown ( Delete ) ; action_dispatch=PenToolMessage :: RemovePreviousHandle ) ,
280280 entry!( KeyDown ( Backspace ) ; action_dispatch=PenToolMessage :: RemovePreviousHandle ) ,
281- entry!( KeyDown ( KeyG ) ; action_dispatch=PenToolMessage :: GRS { grab: KeyG , rotate: KeyR , scale: KeyS } ) ,
282- entry!( KeyDown ( KeyR ) ; action_dispatch=PenToolMessage :: GRS { grab: KeyG , rotate: KeyR , scale: KeyS } ) ,
283- entry!( KeyDown ( KeyS ) ; action_dispatch=PenToolMessage :: GRS { grab: KeyG , rotate: KeyR , scale: KeyS } ) ,
281+ entry!( KeyDownNoRepeat ( KeyG ) ; action_dispatch=PenToolMessage :: GRS { grab: KeyG , rotate: KeyR , scale: KeyS } ) ,
282+ entry!( KeyDownNoRepeat ( KeyR ) ; action_dispatch=PenToolMessage :: GRS { grab: KeyG , rotate: KeyR , scale: KeyS } ) ,
283+ entry!( KeyDownNoRepeat ( KeyS ) ; action_dispatch=PenToolMessage :: GRS { grab: KeyG , rotate: KeyR , scale: KeyS } ) ,
284284 //
285285 // FreehandToolMessage
286286 entry!( PointerMove ; action_dispatch=FreehandToolMessage :: PointerMove ) ,
@@ -315,37 +315,36 @@ pub fn input_mappings(zoom_with_scroll: bool) -> Mapping {
315315 entry!( KeyDown ( Escape ) ; action_dispatch=BrushToolMessage :: Abort ) ,
316316 //
317317 // ToolMessage
318- entry!( KeyDown ( KeyV ) ; action_dispatch=ToolMessage :: ActivateToolSelect ) ,
319- entry!( KeyDown ( KeyZ ) ; action_dispatch=ToolMessage :: ActivateToolNavigate ) ,
320- entry!( KeyDown ( KeyI ) ; action_dispatch=ToolMessage :: ActivateToolEyedropper ) ,
321- entry!( KeyDown ( KeyT ) ; action_dispatch=ToolMessage :: ActivateToolText ) ,
322- entry!( KeyDown ( KeyF ) ; action_dispatch=ToolMessage :: ActivateToolFill ) ,
323- entry!( KeyDown ( KeyH ) ; action_dispatch=ToolMessage :: ActivateToolGradient ) ,
324- entry!( KeyDown ( KeyA ) ; action_dispatch=ToolMessage :: ActivateToolPath ) ,
325- entry!( KeyDown ( KeyP ) ; action_dispatch=ToolMessage :: ActivateToolPen ) ,
326- entry!( KeyDown ( KeyN ) ; action_dispatch=ToolMessage :: ActivateToolFreehand ) ,
327- entry!( KeyDown ( KeyL ) ; action_dispatch=ToolMessage :: ActivateToolShapeLine ) ,
328- entry!( KeyDown ( KeyM ) ; action_dispatch=ToolMessage :: ActivateToolShapeRectangle ) ,
329- entry!( KeyDown ( KeyE ) ; action_dispatch=ToolMessage :: ActivateToolShapeEllipse ) ,
330- entry!( KeyDown ( KeyY ) ; action_dispatch=ToolMessage :: ActivateToolShape ) ,
331- entry!( KeyDown ( KeyB ) ; action_dispatch=ToolMessage :: ActivateToolBrush ) ,
318+ entry!( KeyDownNoRepeat ( KeyV ) ; action_dispatch=ToolMessage :: ActivateToolSelect ) ,
319+ entry!( KeyDownNoRepeat ( KeyZ ) ; action_dispatch=ToolMessage :: ActivateToolNavigate ) ,
320+ entry!( KeyDownNoRepeat ( KeyI ) ; action_dispatch=ToolMessage :: ActivateToolEyedropper ) ,
321+ entry!( KeyDownNoRepeat ( KeyT ) ; action_dispatch=ToolMessage :: ActivateToolText ) ,
322+ entry!( KeyDownNoRepeat ( KeyF ) ; action_dispatch=ToolMessage :: ActivateToolFill ) ,
323+ entry!( KeyDownNoRepeat ( KeyH ) ; action_dispatch=ToolMessage :: ActivateToolGradient ) ,
324+ entry!( KeyDownNoRepeat ( KeyA ) ; action_dispatch=ToolMessage :: ActivateToolPath ) ,
325+ entry!( KeyDownNoRepeat ( KeyP ) ; action_dispatch=ToolMessage :: ActivateToolPen ) ,
326+ entry!( KeyDownNoRepeat ( KeyN ) ; action_dispatch=ToolMessage :: ActivateToolFreehand ) ,
327+ entry!( KeyDownNoRepeat ( KeyL ) ; action_dispatch=ToolMessage :: ActivateToolShapeLine ) ,
328+ entry!( KeyDownNoRepeat ( KeyM ) ; action_dispatch=ToolMessage :: ActivateToolShapeRectangle ) ,
329+ entry!( KeyDownNoRepeat ( KeyE ) ; action_dispatch=ToolMessage :: ActivateToolShapeEllipse ) ,
330+ entry!( KeyDownNoRepeat ( KeyY ) ; action_dispatch=ToolMessage :: ActivateToolShape ) ,
331+ entry!( KeyDownNoRepeat ( KeyB ) ; action_dispatch=ToolMessage :: ActivateToolBrush ) ,
332332 entry!( KeyDown ( KeyD ) ; action_dispatch=ToolMessage :: ResetColors ) ,
333333 entry!( KeyDown ( KeyX ) ; modifiers=[ Shift ] , action_dispatch=ToolMessage :: SwapColors ) ,
334334 entry!( KeyDown ( KeyC ) ; modifiers=[ Alt ] , action_dispatch=ToolMessage :: SelectRandomWorkingColor { primary: true } ) ,
335335 entry!( KeyDown ( KeyC ) ; modifiers=[ Alt , Shift ] , action_dispatch=ToolMessage :: SelectRandomWorkingColor { primary: false } ) ,
336- // TODO: Change to KeyDownNoRepeat when https://github.com/GraphiteEditor/Graphite/issues/2266 is resolved
337- entry!( KeyDown ( Tab ) ; action_dispatch=ToolMessage :: ToggleSelectVsPath ) ,
336+ entry!( KeyDownNoRepeat ( Tab ) ; action_dispatch=ToolMessage :: ToggleSelectVsPath ) ,
338337 //
339338 // DocumentMessage
340339 entry!( DoubleTap ( Space ) ; action_dispatch=DocumentMessage :: GraphViewOverlayToggle ) ,
341340 entry!( KeyDownNoRepeat ( Escape ) ; action_dispatch=DocumentMessage :: Escape ) ,
342341 entry!( KeyDown ( Delete ) ; action_dispatch=DocumentMessage :: DeleteSelectedLayers ) ,
343342 entry!( KeyDown ( Backspace ) ; action_dispatch=DocumentMessage :: DeleteSelectedLayers ) ,
344- entry!( KeyDown ( KeyO ) ; modifiers=[ Alt ] , action_dispatch=DocumentMessage :: ToggleOverlaysVisibility ) ,
345- entry!( KeyDown ( KeyS ) ; modifiers=[ Alt ] , action_dispatch=DocumentMessage :: ToggleSnapping ) ,
343+ entry!( KeyDownNoRepeat ( KeyO ) ; modifiers=[ Alt ] , action_dispatch=DocumentMessage :: ToggleOverlaysVisibility ) ,
344+ entry!( KeyDownNoRepeat ( KeyS ) ; modifiers=[ Alt ] , action_dispatch=DocumentMessage :: ToggleSnapping ) ,
346345 entry!( KeyDown ( KeyH ) ; modifiers=[ Accel ] , action_dispatch=DocumentMessage :: ToggleSelectedVisibility ) ,
347- entry!( KeyDown ( KeyL ) ; modifiers=[ Accel ] , action_dispatch=DocumentMessage :: ToggleSelectedLocked ) ,
348- entry!( KeyDown ( KeyG ) ; modifiers=[ Alt ] , action_dispatch=DocumentMessage :: ToggleGridVisibility ) ,
346+ entry!( KeyDownNoRepeat ( KeyL ) ; modifiers=[ Accel ] , action_dispatch=DocumentMessage :: ToggleSelectedLocked ) ,
347+ entry!( KeyDownNoRepeat ( KeyG ) ; modifiers=[ Alt ] , action_dispatch=DocumentMessage :: ToggleGridVisibility ) ,
349348 entry!( KeyDown ( KeyZ ) ; modifiers=[ Accel , Shift ] , canonical, action_dispatch=DocumentMessage :: Redo ) ,
350349 entry!( KeyDown ( KeyY ) ; modifiers=[ Accel ] , action_dispatch=DocumentMessage :: Redo ) ,
351350 entry!( KeyDown ( KeyZ ) ; modifiers=[ Accel ] , action_dispatch=DocumentMessage :: Undo ) ,
@@ -398,9 +397,9 @@ pub fn input_mappings(zoom_with_scroll: bool) -> Mapping {
398397 entry!( KeyDown ( ArrowRight ) ; action_dispatch=DocumentMessage :: NudgeSelectedLayers { delta_x: NUDGE_AMOUNT , delta_y: 0. , resize: Alt , resize_opposite: Control } ) ,
399398 //
400399 // TransformLayerMessage
401- entry!( KeyDown ( KeyG ) ; action_dispatch=TransformLayerMessage :: BeginGrab ) ,
402- entry!( KeyDown ( KeyR ) ; action_dispatch=TransformLayerMessage :: BeginRotate ) ,
403- entry!( KeyDown ( KeyS ) ; action_dispatch=TransformLayerMessage :: BeginScale ) ,
400+ entry!( KeyDownNoRepeat ( KeyG ) ; action_dispatch=TransformLayerMessage :: BeginGrab ) ,
401+ entry!( KeyDownNoRepeat ( KeyR ) ; action_dispatch=TransformLayerMessage :: BeginRotate ) ,
402+ entry!( KeyDownNoRepeat ( KeyS ) ; action_dispatch=TransformLayerMessage :: BeginScale ) ,
404403 entry!( KeyDown ( Digit0 ) ; action_dispatch=TransformLayerMessage :: TypeDigit { digit: 0 } ) ,
405404 entry!( KeyDown ( Digit1 ) ; action_dispatch=TransformLayerMessage :: TypeDigit { digit: 1 } ) ,
406405 entry!( KeyDown ( Digit2 ) ; action_dispatch=TransformLayerMessage :: TypeDigit { digit: 2 } ) ,
@@ -452,16 +451,16 @@ pub fn input_mappings(zoom_with_scroll: bool) -> Mapping {
452451 entry!( KeyDown ( Tab ) ; modifiers=[ Control , Shift ] , action_dispatch=PortfolioMessage :: PrevDocument ) ,
453452 entry!( KeyDown ( KeyW ) ; modifiers=[ Accel ] , action_dispatch=PortfolioMessage :: CloseActiveDocumentWithConfirmation ) ,
454453 entry!( KeyDown ( KeyW ) ; modifiers=[ Accel , Alt ] , action_dispatch=PortfolioMessage :: CloseAllDocumentsWithConfirmation ) ,
455- entry!( KeyDown ( KeyO ) ; modifiers=[ Accel ] , action_dispatch=IngestMessage :: Open ) ,
456- entry!( KeyDown ( KeyI ) ; modifiers=[ Accel ] , action_dispatch=IngestMessage :: Import ) ,
457- entry!( KeyDown ( KeyR ) ; modifiers=[ Alt ] , action_dispatch=PortfolioMessage :: ToggleRulers ) ,
454+ entry!( KeyDownNoRepeat ( KeyO ) ; modifiers=[ Accel ] , action_dispatch=IngestMessage :: Open ) ,
455+ entry!( KeyDownNoRepeat ( KeyI ) ; modifiers=[ Accel ] , action_dispatch=IngestMessage :: Import ) ,
456+ entry!( KeyDownNoRepeat ( KeyR ) ; modifiers=[ Alt ] , action_dispatch=PortfolioMessage :: ToggleRulers ) ,
458457 entry!( KeyDown ( KeyD ) ; modifiers=[ Alt ] , action_dispatch=WorkspaceMessage :: ToggleDataPanelOpen ) ,
459458 entry!( KeyDown ( Enter ) ; modifiers=[ Alt ] , action_dispatch=WorkspaceMessage :: ToggleFocusDocument ) ,
460459 //
461460 // DialogMessage
462- entry!( KeyDown ( KeyE ) ; modifiers=[ Accel ] , action_dispatch=DialogMessage :: RequestExportDialog ) ,
463- entry!( KeyDown ( KeyN ) ; modifiers=[ Accel ] , action_dispatch=DialogMessage :: RequestNewDocumentDialog ) ,
464- entry!( KeyDown ( Comma ) ; modifiers=[ Accel ] , action_dispatch=DialogMessage :: RequestPreferencesDialog ) ,
461+ entry!( KeyDownNoRepeat ( KeyE ) ; modifiers=[ Accel ] , action_dispatch=DialogMessage :: RequestExportDialog ) ,
462+ entry!( KeyDownNoRepeat ( KeyN ) ; modifiers=[ Accel ] , action_dispatch=DialogMessage :: RequestNewDocumentDialog ) ,
463+ entry!( KeyDownNoRepeat ( Comma ) ; modifiers=[ Accel ] , action_dispatch=DialogMessage :: RequestPreferencesDialog ) ,
465464 //
466465 // DebugMessage
467466 entry!( KeyDown ( Digit0 ) ; modifiers=[ Alt ] , action_dispatch=DebugMessage :: MessageOff ) ,
@@ -471,35 +470,33 @@ pub fn input_mappings(zoom_with_scroll: bool) -> Mapping {
471470 entry!( KeyDown ( Space ) ; modifiers=[ Shift ] , action_dispatch=AnimationMessage :: ToggleLivePreview ) ,
472471 entry!( KeyDown ( Home ) ; modifiers=[ Shift ] , action_dispatch=AnimationMessage :: RestartAnimation ) ,
473472 ] ;
474- let ( mut key_up, mut key_down, mut key_up_no_repeat , mut key_down_no_repeat , mut double_click, mut double_tap, mut wheel_scroll, mut pointer_move, mut pointer_shake) = mappings;
473+ let ( mut key_up, mut key_down, mut double_click, mut double_tap, mut wheel_scroll, mut pointer_move, mut pointer_shake) = mappings;
475474
476475 let sort = |list : & mut KeyMappingEntries | list. 0 . sort_by_key ( |entry| std:: cmp:: Reverse ( entry. modifiers . count_ones ( ) ) ) ;
477- // Sort the sublists of `key_up`, `key_down`, `key_up_no_repeat`, and `key_down_no_repeat`
478- for list in [ & mut key_up, & mut key_down, & mut key_up_no_repeat , & mut key_down_no_repeat ] {
476+
477+ for list in [ & mut key_up, & mut key_down] {
479478 for sublist in list {
480479 sort ( sublist) ;
481480 }
482481 }
483- // Sort the sublists of `double_click`
482+
484483 for sublist in & mut double_click {
485484 sort ( sublist)
486485 }
487- // Sort the sublists of `double_tap`
486+
488487 for sublist in & mut double_tap {
489488 sort ( sublist)
490489 }
491- // Sort `wheel_scroll`
490+
492491 sort ( & mut wheel_scroll) ;
493- // Sort `pointer_move`
492+
494493 sort ( & mut pointer_move) ;
495- // Sort `pointer_shake`
494+
496495 sort ( & mut pointer_shake) ;
497496
498497 Mapping {
499498 key_up,
500499 key_down,
501- key_up_no_repeat,
502- key_down_no_repeat,
503500 double_click,
504501 double_tap,
505502 wheel_scroll,
0 commit comments