@@ -373,7 +373,7 @@ GMTEEditor >> brushButtons: anObject [
373
373
374
374
{
375
375
#category : #building ,
376
- #' squeak_changestamp' : ' mcjj 7/10 /2024 16 :51'
376
+ #' squeak_changestamp' : ' mcjj 7/11 /2024 15 :51'
377
377
}
378
378
GMTEEditor >> buildWith: builder [
379
379
" builds the editor with ToolBuilder"
@@ -394,6 +394,8 @@ GMTEEditor >> buildWith: builder [
394
394
closeAction: #onClose ;
395
395
minimumExtent: GMTEEditor editorMinimumExtent).
396
396
397
+ newMorph addKeyboardCaptureFilter: self .
398
+
397
399
self commandBar: (newMorph submorphNamed: ' command bar' ).
398
400
" self commandBar vResizing: #rigid."
399
401
self tileStore: (newMorph submorphNamed: ' tile store' ).
@@ -422,8 +424,7 @@ GMTEEditor >> buildWith: builder [
422
424
423
425
self
424
426
initializeDefaultTileMapMatrix;
425
- associatedMorph: newMorph;
426
- setupInputHandlingFor: newMorph.
427
+ associatedMorph: newMorph.
427
428
428
429
^ newMorph
429
430
]
@@ -968,15 +969,6 @@ GMTEEditor >> disableSingleLayerButtons [
968
969
GMTEEditor singleLayerActionNames do: [:aString | (self associatedMorph submorphNamed: aString) enabled: false ]
969
970
]
970
971
971
- {
972
- #category : #' input handling' ,
973
- #' squeak_changestamp' : ' mcjj 7/10/2024 16:47'
974
- }
975
- GMTEEditor >> dropKeyboardFocus: anEvent [
976
-
977
- anEvent hand releaseKeyboardFocus: self associatedMorph
978
- ]
979
-
980
972
{
981
973
#category : #' as yet unclassified' ,
982
974
#' squeak_changestamp' : ' TW 6/25/2024 17:51'
@@ -1032,6 +1024,36 @@ GMTEEditor >> exportMenu [
1032
1024
builder open: aMenuSpec
1033
1025
]
1034
1026
1027
+ {
1028
+ #category : #' input handling' ,
1029
+ #' squeak_changestamp' : ' mcjj 7/11/2024 15:57'
1030
+ }
1031
+ GMTEEditor >> filterEvent: aKeyboardEvent for: anObject [
1032
+ | key |
1033
+
1034
+ aKeyboardEvent isKeystroke
1035
+ ifFalse: [^ aKeyboardEvent].
1036
+
1037
+ key := aKeyboardEvent key.
1038
+
1039
+ aKeyboardEvent commandKeyPressed ifTrue: [
1040
+ aKeyboardEvent shiftPressed
1041
+ ifTrue: [
1042
+ key caseOf: {
1043
+ [$Z ] - > [self redo].
1044
+ } otherwise: [^ aKeyboardEvent " no hit" ].
1045
+ ^ aKeyboardEvent ignore " hit" ]
1046
+ ifFalse: [
1047
+ key caseOf: {
1048
+ [$Z ] - > [self undo].
1049
+ [$Y ] - > [self redo].
1050
+ [$R ] - > [self rotateSelectedTile].
1051
+ } otherwise: [^ aKeyboardEvent " no hit" ].
1052
+ ^ aKeyboardEvent ignore " hit" ]].
1053
+
1054
+ ^ aKeyboardEvent " no hit"
1055
+ ]
1056
+
1035
1057
{
1036
1058
#category : #accessing ,
1037
1059
#' squeak_changestamp' : ' TW 7/9/2024 17:14'
@@ -1106,15 +1128,6 @@ GMTEEditor >> getGridWidthAsString [
1106
1128
^ self getGridWidth asString
1107
1129
]
1108
1130
1109
- {
1110
- #category : #' input handling' ,
1111
- #' squeak_changestamp' : ' mcjj 7/10/2024 16:46'
1112
- }
1113
- GMTEEditor >> getKeyboardFocus: anEvent [
1114
-
1115
- anEvent hand newKeyboardFocus: self associatedMorph
1116
- ]
1117
-
1118
1131
{
1119
1132
#category : #' layer manipulation' ,
1120
1133
#' squeak_changestamp' : ' TW 6/23/2024 21:50'
@@ -1182,18 +1195,6 @@ GMTEEditor >> getTileRatioAsString [
1182
1195
^ self getTileRatio asString
1183
1196
]
1184
1197
1185
- {
1186
- #category : #' input handling' ,
1187
- #' squeak_changestamp' : ' mcjj 7/10/2024 16:49'
1188
- }
1189
- GMTEEditor >> handleKeyStroke: anEvent [
1190
-
1191
- | keyValue |
1192
- keyValue := anEvent key.
1193
- Transcript show: keyValue
1194
- " keyValue = $A"
1195
- ]
1196
-
1197
1198
{
1198
1199
#category : #' menu button functions' ,
1199
1200
#' squeak_changestamp' : ' TW 6/23/2024 20:09'
@@ -2016,20 +2017,6 @@ GMTEEditor >> settingsMenu [
2016
2017
builder open: aMenuSpec
2017
2018
]
2018
2019
2019
- {
2020
- #category : #' input handling' ,
2021
- #' squeak_changestamp' : ' mcjj 7/10/2024 16:49'
2022
- }
2023
- GMTEEditor >> setupInputHandlingFor: aMorph [
2024
-
2025
- aMorph
2026
- on: #mouseMove send: #getKeyboardFocus: to: self ;
2027
- on: #mouseLeave send: #dropKeyboardFocus: to: self ;
2028
- on: #keyStroke send: #handleKeyStroke: to: self .
2029
-
2030
- aMorph eventHandler wantsEveryMouseMove: true
2031
- ]
2032
-
2033
2020
{
2034
2021
#category : #' layer manipulation' ,
2035
2022
#' squeak_changestamp' : ' jj 6/22/2024 21:43'
0 commit comments