application cursor key mode in the vt100 emulator

Ian Piumarta ian.piumarta at inria.fr
Wed Feb 19 14:13:38 UTC 2003


Folks,

Speaking of telnet clients and state machines, here's a changeset to keep
"vi" users happy.  It fixes the enabling of "application cursor keys" mode
that was preventing the cursor keys from working properly in vi.

Ian
-------------- next part --------------
'From Squeak3.2 of 15 January 2002 [latest update: #4881] on 18 February 2003 at 11:07:36 pm'!

!VT102Emulator methodsFor: 'control sequences-DEC' stamp: 'ikp 2/18/2003 23:01'!
decsmSingle: param
	"DEC private Set Mode"

	param == 1	ifTrue: [self trace:		'DECCKM		(cursor key mode: application)'. ^self setCursorKeysApplication].
	param == 2	ifTrue: [self trace:		'DECANM	(ansi mode: ANSI)'.  ^self setMode: #ansi].
	param == 3	ifTrue: [self trace:		'DECCOLM	(column mode: 132)'. ^window setWidth: 132].
	param == 4	ifTrue: [self trace:		'DECSCLM	(scroll mode: smooth)'.  ^window setSmoothScroll: true].
	param == 5	ifTrue: [self trace:		'DECSCNM	(screen mode: reverse)'.  ^window rv: true].
	param == 6	ifTrue: [self trace:		'DECOM		(origin mode: relative)'. ^window setRelativeOrigin: true; activePosition: 1 at 1].
	param == 7	ifTrue: [self trace:		'DECAWM	(autowrap mode: on)'. ^window setAutoWrap: true].
	param == 8	ifTrue: [^self trace:		'DECARM	(autorepeat mode: on)'].
	param == 18	ifTrue: [^self trace:		'DECPFF		(print FF: on)'].
	param == 19	ifTrue: [^self trace:		'DECPEX		(print extent: screen)'].
	"Emacs somtimes sends this.  Ho hum..."
	param == 25	ifTrue: [^window setShowCursor: true].

	self debug: 'DECSM' with: param.! !

!VT102Emulator methodsFor: 'private' stamp: 'ikp 2/18/2003 23:04'!
setCursorKeysApplication

	| esc |
	esc _ Character escape asString.
	keyMap
		at: 128+28 put: (esc,'OD') asByteArray;		"left"
		at: 128+29 put: (esc,'OC') asByteArray;		"right" 
		at: 128+30 put: (esc,'OA') asByteArray;		"up"
		at: 128+31 put: (esc,'OB') asByteArray.		"down" ! !



More information about the Squeak-dev mailing list