[ENH] Delete key under Windows

Thomas Kuehne kuehne at informatik.uni-kl.de
Mon Jul 31 11:09:49 UTC 2000


Hi,

the (unshifted) delete key (usually labelled 'Del') does not seem to have a function assigned to it (I am using version 2.7 under Windows).

I did not like pressing shift + the delete key each time I wanted to delete a character right to the cursor. Adding the delete key to the command key map solved the problem for me.

For those interested, please perform
ParagraphEditor initializeCmdKeyShortcuts
after you filed in the attachment.

P.S.: I also made the system browser show all methods after a class has been selected, i.e., selecting message category '-- all --' as a default. One simply has to replace all occurrences of assigning 0 to messageCategoryListIndex with assigning 1 to the same variable.

Cheers,

    Thomas

--
Dr. Thomas Kuehne
+49  631  205 4654, http://www-agce.informatik.uni-kl.de/~kuehne
The difficulty in doing research is to find the right  questions
so that all the answers come easily. -- TK
-------------- next part --------------
'From Squeak2.7 of 5 January 2000 [latest update: #1782] on 30 July 2000 at 12:45:45 pm'!

!ParagraphEditor class methodsFor: 'keyboard shortcut tables' stamp: 'TK 7/30/2000 12:43'!
initializeCmdKeyShortcuts
	"Initialize the (unshifted) command-key shortcut table."
	"NOTE: if you don't know what your keyboard generates, use Sensor 
	kbdTest "
	"ParagraphEditor initialize"
	| cmdMap cmds |
	cmdMap _ Array new: 256.
	"use temp in case of a crash"
	cmdMap atAllPut: #noop:.
	cmdMap at: 1 + 1 put: #cursorHome:.
	"home key"
	cmdMap at: 4 + 1 put: #cursorEnd:.
	"end key"
	cmdMap at: 8 + 1 put: #backspace:.
	"ctrl-H or delete key"
	cmdMap at: 11 + 1 put: #cursorPageUp:.
	"page up key"
	cmdMap at: 12 + 1 put: #cursorPageDown:.
	"page down key"
	cmdMap at: 13 + 1 put: #crWithIndent:.
	"cmd-Return"
	cmdMap at: 27 + 1 put: #selectCurrentTypeIn:.
	"escape key"
	cmdMap at: 28 + 1 put: #cursorLeft:.
	"left arrow key"
	cmdMap at: 29 + 1 put: #cursorRight:.
	"right arrow key"
	cmdMap at: 30 + 1 put: #cursorUp:.
	"up arrow key"
	cmdMap at: 31 + 1 put: #cursorDown:.
	"down arrow key"
     cmdMap at: 127 + 1 put: #forwardDelete:.
	"del key"
	'0123456789-=' do: [:char | cmdMap at: char asciiValue + 1 put: #changeEmphasis:].
	'([{''"<' do: [:char | cmdMap at: char asciiValue + 1 put: #enclose:].
	cmdMap at: $, asciiValue + 1 put: #shiftEnclose:.
	cmds _ #($a selectAll: $b browseIt: $c copySelection: $d doIt: $e exchange: $f find: $g findAgain: $h setSearchString: $i inspectIt: $j doAgainOnce: $k offerFontMenu: $l cancel: $m implementorsOfIt: $n sendersOfIt: $o spawnIt: $p printIt: $q querySymbol: $r recognizer: $s save: $t tempCommand: $u align: $v paste: $w backWord: $x cut: $y swapChars: $z undo: ).
	1
		to: cmds size
		by: 2
		do: [:i | cmdMap at: (cmds at: i) asciiValue + 1 put: (cmds at: i + 1)].
	CmdActions _ cmdMap! !



More information about the Squeak-dev mailing list