Skip to content

Commit

Permalink
Add w shortcut for window closing. Note that we must escape ! with !!…
Browse files Browse the repository at this point in the history
… here due to how .st file (chunk) parsing works.
  • Loading branch information
marceltaeumel committed Nov 1, 2023
1 parent 238f2a7 commit 37dbb4a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions SwaImageConfiguration.st
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,28 @@ Utilities setAuthorInitials: 'hpi'. "changed at end"
"-=-=-=-=-="
"w shortcut to delete windows - experimental for SWA WiSe 23/24"

(Smalltalk at: #SystemWindow) compile: 'filterEvent: aKeyboardEvent for: anObject
"Provide keyboard shortcuts."
aKeyboardEvent isKeystroke
ifFalse: [^ aKeyboardEvent].
aKeyboardEvent hand halo ifNotNil: [ : halo | halo target isSystemWindow ifTrue: [ aKeyboardEvent hand removeHalo ] ].
aKeyboardEvent commandKeyPressed ifTrue: [
aKeyboardEvent keyCharacter caseOf: {
[$\] -> [self class sendTopWindowToBack].
[Character escape] -> [self class deleteTopWindow].
[$w] -> [self class deleteTopWindow].
[$/] -> [self class bringWindowUnderHandToFront].
} otherwise: [^ aKeyboardEvent "no hit"].
^ aKeyboardEvent ignore "hit!!"].
aKeyboardEvent controlKeyPressed ifTrue: [
aKeyboardEvent keyCharacter caseOf: {
[Character escape] -> [self world findWindow: aKeyboardEvent].
} otherwise: [^ aKeyboardEvent "no hit"].
^ aKeyboardEvent ignore "hit!!"].
^ aKeyboardEvent "no hit"'.

"-=-=-=-=-="
"Remove Git Updates from PreferenceWizard as we use a special git version"
Expand Down

0 comments on commit 37dbb4a

Please sign in to comment.