-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18c2f27
commit ebf35e9
Showing
9 changed files
with
153 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
repository/OpenPonk-Roassal3/OPRSKeyNavigationCanvasInteraction.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Class { | ||
#name : #OPRSKeyNavigationCanvasInteraction, | ||
#superclass : #RSKeyNavigationCanvasInteraction, | ||
#category : #'OpenPonk-Roassal3-Interactions' | ||
} | ||
|
||
{ #category : #events } | ||
OPRSKeyNavigationCanvasInteraction >> processKeyDown: evt [ | ||
|
||
| keyName | | ||
keyName := evt keyName. | ||
keyName = #I ifTrue: [ ^ self ]. | ||
keyName = #O ifTrue: [ ^ self ]. | ||
(#( #+ #PLUS #KP_ADD ) includes: keyName) ifTrue: [ | ||
^ self zoomIn: evt canvas ]. | ||
(#( #- #MINUS #KP_SUBTRACT ) includes: keyName) ifTrue: [ | ||
^ self zoomOut: evt canvas ]. | ||
^ super processKeyDown: evt | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Extension { #name : #HandMorph } | ||
|
||
{ #category : #'*OpenPonk-Spec' } | ||
HandMorph >> sendKeyboardEvent: anEvent [ | ||
|
||
self flag: | ||
'Part of ugly hack to find out if ctrl is currently pressed'. | ||
OPDiagramRemoveFigureCommand lastEvent: anEvent. | ||
self flag: | ||
'Original method below'. | ||
|
||
"Send the event to the morph currently holding the focus, or if none to | ||
the owner of the hand." | ||
^ self | ||
sendEvent: anEvent | ||
focus: self keyboardFocus | ||
clear: [self keyboardFocus: nil] | ||
] | ||
|
||
{ #category : #'*OpenPonk-Spec' } | ||
HandMorph >> sendMouseEvent: anEvent [ | ||
|
||
self flag: | ||
'Part of ugly hack to find out if ctrl is currently pressed'. | ||
OPDiagramRemoveFigureCommand lastEvent: anEvent. | ||
self flag: | ||
'Original method below'. | ||
|
||
"Send the event to the morph currently holding the focus, or if none to the owner of the hand." | ||
^self sendEvent: anEvent focus: self mouseFocus clear:[self mouseFocus: nil] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Extension { #name : #ToggleMenuItemShortcut } | ||
|
||
{ #category : #'*OpenPonk-Spec' } | ||
ToggleMenuItemShortcut class >> keyTextShortcuts [ | ||
^ #('cmd'. 'alt'. 'shift'.'ctrl'. 'meta' '⌘' '⇧' 'delete') | ||
] |