[BUG][FIX] Some control keys broken
Bob Arning
arning at charm.net
Wed Nov 10 00:03:12 UTC 1999
I found that, in 2.6, ctrl-l no longer shifted lines left. A fix is enclosed.
Cheers,
Bob
'From Squeak2.6 of 15 October 1999 [latest update: #1578] on 9 November 1999 at 6:59:37 pm'!
"Change Set: fixControlKeys
Date: 9 November 1999
Author: Bob Arning
The recent addition of page up and page down to ParagraphEditor class>>specialShiftCmdKeys highlighted a problem. Since ParagraphEditor>>dispatchOnCharacter:with: tested #specialShiftCmdKeys before normal control keys, those control keys whose ascii values were also in #specialShiftCmdKeys were non-functional. This change set reorders the tests so that old functionality is regained and no new functionality is lost (gee, I hope that's true)."!
!ParagraphEditor methodsFor: 'typing support' stamp: 'RAA 11/9/1999 18:52'!
dispatchOnCharacter: char with: typeAheadStream
"Carry out the action associated with this character, if any.
Type-ahead is passed so some routines can flush or use it."
| honorCommandKeys |
((honorCommandKeys _ Preferences cmdKeysInText) and: [char = Character enter])
ifTrue: [^ self dispatchOnEnterWith: typeAheadStream].
"RAA - do this before examining #specialShiftCmdKeys so things like ctrl-l work as intended"
"the control key can be used to invoke shift-cmd shortcuts"
(honorCommandKeys and: [sensor controlKeyPressed])
ifTrue:
[^ self perform: (ShiftCmdActions at: char asciiValue + 1) with: typeAheadStream].
"backspace, and escape keys (ascii 8 and 27) are command keys"
((honorCommandKeys and: [sensor commandKeyPressed]) or: [self class specialShiftCmdKeys includes: char asciiValue]) ifTrue:
[^ sensor leftShiftDown
ifTrue:
[self perform: (ShiftCmdActions at: char asciiValue + 1) with: typeAheadStream]
ifFalse:
[self perform: (CmdActions at: char asciiValue + 1) with: typeAheadStream]].
^ self perform: #normalCharacter: with: typeAheadStream! !
More information about the Squeak-dev
mailing list
|