'From etoys2.2 of 24 September 2007 [latest update: #1760] on 6 November 2007 at 10:24:52 pm'! "Change Set: showSourceAgain-sw Date: 6 November 2007 Author: Scott Wallace Pop up the show-source menu on ctrl-comma as well as on alt-comma, trying to contend with both settings of the swapControlAndAltKeys pref."! !PasteUpMorph methodsFor: '*green' stamp: 'sw 11/6/2007 20:50'! keystrokeInWorld: evt "A keystroke was hit when no keyboard focus was set, so it is sent here to the world instead." | aChar isCmd ascii | aChar _ evt keyCharacter. (ascii _ aChar asciiValue) = 27 ifTrue: "escape key -- either put up a menu, or simply quietly gobble it" [^ Preferences escapeKeyProducesMenu ifTrue: [self putUpWorldMenuFromEscapeKey]]. ((ascii = 44) and: [(evt commandKeyPressed or: [evt controlKeyPressed])]) "show-source on XO" ifTrue: [^ self showSourceKeyHit]. (evt controlKeyPressed not and: [(#(1 4 8 28 29 30 31 32 47) includes: ascii) "home, end, backspace, arrow keys, space, slash." and: [self keyboardNavigationHandler notNil]]) ifTrue: [self keyboardNavigationHandler navigateFromKeystroke: aChar]. isCmd _ evt commandKeyPressed and: [Preferences cmdKeysInText]. (evt commandKeyPressed and: [Preferences eToyFriendly]) ifTrue: [(aChar == $W) ifTrue: [^ self putUpWorldMenu: evt]]. (isCmd and: [Preferences honorDesktopCmdKeys]) ifTrue: [^ self dispatchCommandKeyInWorld: aChar event: evt]. "It was unhandled. Remember the keystroke." self lastKeystroke: evt keyString. self triggerEvent: #keyStroke! ! !PluggableListMorph methodsFor: '*green' stamp: 'sw 11/6/2007 22:24'! modifierKeyPressed: aChar "The user typed a character into the list pane, while holding down a modifier key." | args | (aChar = $, and: [ActiveEvent commandKeyPressed or: [ActiveEvent controlKeyPressed]]) ifTrue: [^ ActiveWorld showSourceKeyHit]. (aChar asciiValue = 92 and: [ActiveEvent commandKeyPressed]) ifTrue: ["cycle windows" ^ SystemWindow rotateWindows]. keystrokeActionSelector isNil ifTrue: [^nil]. args := keystrokeActionSelector numArgs. args = 1 ifTrue: [^model perform: keystrokeActionSelector with: aChar]. args = 2 ifTrue: [^model perform: keystrokeActionSelector with: aChar with: self]. ^self error: 'keystrokeActionSelector must be a 1- or 2-keyword symbol'! !