Base keystroke methods

These are the editor methods included in a standard VisualWorks system. Unless otherwise noted, they can be assigned to keystrokes using the TextEditor Keystroke remapping.

acceptKey: aCharEvent

This method tells the text model of the editor controller that its current text is to be considered the most up-to-date version for purposes of canceling, saving or evaluation.

backspaceKey: aCharEvent

If any text is currently selected, that text is cut to the clipboard. If the selection is empty, then the character behind the cursor is removed and the cursor backs up one space.

backWordKey: aCharEvent

If any text is currently selected, then that text and an additional word preceding the selection are removed. If the cursor is at the beginning of a word or in white space, then the entire preceding word is removed. If the cursor is in the middle of a word, then the portion of the word that precedes the cursor is removed.

changeEmphasisKey: aCharEvent

If any text is currently selected, then the font and/or font style is changed. If no text is currently selected, then the font and/or font style is changed for any text that is typed after the current cursor location. Based on the keyValue of aCharEvent, the changes of the font and/or style are as follows:

This method is called by the new font menu items provided by the DevTool extensions in the Text editor pop-up menu.

copyKey: aCharEvent

If any text is currently selected, then the text is copied to the clipboard. If the selection is empty, then the clipboard is cleared.

cursorDownKey: aCharEvent

If any text is currently selected, the selection is deselected, and the cursor is placed to the right side of what was the first character in the previous selection. The cursor will move one line down on the screen from its current position.

cursorLeftKey: aCharEvent

If any text is currently selected, the selection is deselected, and the cursor is placed to the left side of what was the first character in the previous selection. If the selection is empty, the cursor will move one character to the left from its current position.

cursorRightKey: aCharEvent

If any text is currently selected, the selection is deselected, and the cursor is placed to the right side of what was the first character in the previous selection. If the selection is empty, the cursor will move one character to the right from its current position.

cursorUpKey: aCharEvent

If any text is currently selected, the selection is deselected, and the cursor is placed to the left side of what was the first character in the previous selection. The cursor will move one line up on the screen from its current position.

cutKey: aCharEvent

If any text is currently selected, then that text is removed and placed in the clipboard. If the selection is empty, then the clipboard is cleared.

deleteKey: aCharEvent

If "LookPreferences deleteForward" is set to false, then backspaceKey: is called. If "LookPreferences deleteForward" is set to true, then if there is any text selected, that text is removed and placed in the clipboard. If the selection is empty, then the character to the right of the caret is removed.

displayColonEqualKey: aCharEvent

This method replaces the current text selection with the text ':='.

displayCRKey: aCharEvent

This method replaces the current text selection with a carriage return.

displayDateKey: aCharEvent

This method replaces the current text selection with today's date. This is in the form of: 'Month dayOfMonth, Year'. i.e. June 27, 2003.

displayIfFalseKey: aCharEvent

This method replaces the current text selection with the text 'ifFalse:'.

displayIfTrueKey: aCharEvent

This method replaces the current text selection with the text 'ifTrue:'.

encloseKey: aCharEvent

The beginning and end of the current selection are checked to see if the selection is surrounded by any of the following pairs: (),[],<>,{},'' and "". The specific pair searched for is based on the keyValue of aCharEvent. If a searched-for mating pair is found, those characters are removed from the selection. If the searched-for pair is not found, the selection is enclosed with the pair. (i.e. '{frank}' becomes 'frank', and 'bob' can become '<bob>'.)

endKey: aCharEvent

If any text is currently selected, then that text is deselected, and the cursor moves to the right of the last character of what was the last line of what was the previously selected text. If no text is currently selected, then the cursor moves to the right of the last character of the current line of text in the display.

findDialogKey: aCharEvent

This method brings up a dialog that allows the user to look, for a string in the current text. This works the same as if the find... menu item is chosen from the Text editor pop-up menu.

findKey: aCharEvent

If any text is currently selected, this method will look for the next occurrence of that text in the text pane. If no text is currently selected, then the next occurrence of the contents of the paste buffer is searched for. If the searched-for text is found, then it is selected and that selection scrolls into view. If the searched-for text is not found, the user is told this via a dialog box, and the current selection is not changed.

homeKey: aCharEvent

If any text is currently selected, the text is deselected, and the cursor moves to the left of the first character of what was the first line of the previously selected text. If no text is currently selected, then the cursor moves to the left of the first character of the current line of text in the display.

ignoreInputKey: aCharEvent

This method operates as a no-op for keystrokes. If a keystroke is to be purposely ignored, it can be assigned to this method.

leaveBracketsKey: aCharEvent

If the next character in the display is one of the following "close bracket" characters, then the cursor moves to the right of that character: ) ] > } ' ". If the next character is any other character, then the selection remains unchanged.

miniFormatKey: aKeyEvent

If any text is currently selected, all carriage returns are removed from the text. Multiple lines of text become a single, long, word-wrapped line of text.

normalCharacterKey: aCharEvent

If any text is currently selected, the text is replaced with keyValue of aCharEvent. If no text is currently selected, then the keyValue is inserted at the current cursor point.

pageDownKey: aCharEvent

If any text is currently selected the that text is deselected. The view of the text then scrolls down one page on the screen.

pageUpKey: aCharEvent

If any text is currently selected, the that text is deselected. The view of the text then scrolls up one page on the screen.

pasteKey: aCharEvent

If any text is currently selected, then the contents of the clipboard are pasted over the selection. If no text is currently selected, then the contents of the clipboard are inserted into the text at the current cursor point.

replaceDialogKey: aCharEvent

This method brings up a dialog that allows the user to enter a string to be found in the current text. The user has the option of replacing the found text with another string entered into the dialog box. This works the same as if the replace... menu item is chosen from the Text editor pop-up menu. If the searched-for text is not found, the user is told this via a dialog box and the current selection is not changed.

replaceKey: aCharEvent

If any text is currently selected, the next occurrence of the text of the undo selection is looked for in the text pane. If the searched-for text is found, it is replaced with the text of the undo selection. It is selected and the new selection will scroll into view. If the searched-for text is not found, the user is told this via a dialog box and the current selection is not changed.

selectCurrentTypeInKey: aCharEvent

This method makes the most recently typed text the current selection.

undoKey: aCharEvent

This method undoes (backs out) the last change made to the text.

dispatchOn: aCharacter to: aKeyboardMethod

This utility method allows aCharacter to be configured in this text editor object to invoke aKeyboardMethod. Since this is a utility method, it cannot be assigned to a keystroke via the TextEditor Keystroke remapping.

insertAndSelect: aString at: anInteger

This utility method inserts the passed string into the text starting at the passed character location. The newly inserted text then becomes the current selection. Since this is a utility method, it cannot be assigned to a keystroke via the TextEditor Keystroke remapping.

readKeyboard

This utility method does most of the work behind intercepting keystrokes and dispatching them to the appropriate keystroke functions. Since this is a utility method, it cannot be assigned to a keystroke via the TextEditor Keystroke remapping.


[ < Keystroke Methods Documentation ] [ ControlWORKS added keystroke methods > ]

[ Main ] [ Table of Contents ] [ Contact info ] [ Index ]

[ Home ]

This work is licensed under a Creative Commons License.

Creative Commons License