--- a/keyboard.rc Wed Jan 24 17:17:42 2001 +0100
+++ b/keyboard.rc Sat Sep 01 13:13:12 2001 +0200
@@ -35,8 +35,13 @@
"/ Cmd-F98: toggle between 4 and 8 col tab setting
"/ Cmd-F96: pipe text through spelling checker and collect its output
"/ Cmd-F97: get next entry from spell-list, search and highlight it
+"/ Cmd-F96: send to spell
"/ Cmd-F95: indents selection-line by 4
"/ Cmd-F94: undents selection-line by 4
+"/ Cmd-F93: indents selection-line by 1
+"/ Cmd-F92: undents selection-line by 1
+"/ Cmd-F91: to-lowercase
+"/ Cmd-F90: to-uppercase
"/
"/ these virtual keys are mapped below to some real keys:
"/ F9: undent by 4
@@ -266,6 +271,96 @@
].
]
'.
+
+"/
+"/ macro to convert selection to lowercase
+"/
+macros at:#F91 put:'
+ "to-lower selected text"
+
+ |line1 line2|
+
+ line1 := self selectionStartLine.
+ line2 := self selectionEndLine.
+ line1 isNil ifTrue:[
+ line1 := self perform:#cursorLine ifNotUnderstood:nil.
+ line1 notNil ifTrue:[
+ line2 := line1
+ ]
+ ].
+ line1 notNil ifTrue:[
+ line1 to:line2 do:[:lineNr |
+ |line col1 col2|
+
+ line := self listAt:lineNr.
+ line size > 0 ifTrue:[
+ lineNr == line1 ifTrue:[
+ col1 := selectionStartCol.
+ ] ifFalse:[
+ col1 := 1.
+ ].
+ lineNr == line2 ifTrue:[
+ col2 := selectionEndCol.
+ ] ifFalse:[
+ col2 := (self listAt:lineNr) size.
+ ].
+
+ col1 to:col2 do:[:col |
+ |ch|
+
+ ch := line at:col.
+ line at:col put:ch asUppercase.
+ ].
+ self withoutRedrawAt:lineNr put:line.
+ self invalidateLine:lineNr.
+ ].
+ ].
+ ]
+ '.
+
+macros at:#F90 put:'
+ "to-lower selected text"
+
+ |line1 line2|
+
+ line1 := self selectionStartLine.
+ line2 := self selectionEndLine.
+ line1 isNil ifTrue:[
+ line1 := self perform:#cursorLine ifNotUnderstood:nil.
+ line1 notNil ifTrue:[
+ line2 := line1
+ ]
+ ].
+ line1 notNil ifTrue:[
+ line1 to:line2 do:[:lineNr |
+ |line col1 col2|
+
+ line := self listAt:lineNr.
+ line size > 0 ifTrue:[
+ lineNr == line1 ifTrue:[
+ col1 := selectionStartCol.
+ ] ifFalse:[
+ col1 := 1.
+ ].
+ lineNr == line2 ifTrue:[
+ col2 := selectionEndCol.
+ ] ifFalse:[
+ col2 := (self listAt:lineNr) size.
+ ].
+
+ col1 to:col2 do:[:col |
+ |ch|
+
+ ch := line at:col.
+ line at:col put:ch asLowercase.
+ ].
+ self withoutRedrawAt:lineNr put:line.
+ self invalidateLine:lineNr.
+ ].
+ ].
+ ]
+ '.
+
!
"*
@@ -573,6 +668,9 @@
map bindValue:#CmdF93 to:#F12.
map bindValue:#CmdF92 to:#F11.
+map bindValue:#CmdF91 to:#F6.
+map bindValue:#CmdF90 to:#F7.
+
map bindValue:#CommentSelection to:#F3.
map bindValue:#UncommentSelection to:#F4.