TerminalView.st
changeset 950 9e5834388a79
parent 948 b93aba7db15d
child 951 a9e48f549763
equal deleted inserted replaced
949:1a6071a5c370 950:9e5834388a79
   236     ].
   236     ].
   237     (rawKey startsWith:'Alt') ifTrue:[
   237     (rawKey startsWith:'Alt') ifTrue:[
   238         ^ self
   238         ^ self
   239     ].
   239     ].
   240     (rawKey startsWith:'Cmd') ifTrue:[
   240     (rawKey startsWith:'Cmd') ifTrue:[
   241         ^ self
   241         ^ super keyPress:aKey x:x y:y
   242     ].
   242     ].
   243 
   243 
   244     Transcript show:'unhandled: '; showCR:rawKey.
   244     Transcript show:'unhandled: '; showCR:rawKey.
   245 
   245 
   246 "/    super keyPress:aKey x:x y:y
   246     "Modified: / 12.6.1998 / 22:16:50 / cg"
   247 
       
   248     "Modified: / 10.6.1998 / 17:51:21 / cg"
       
   249 !
   247 !
   250 
   248 
   251 shellTerminated
   249 shellTerminated
   252     self closeDownShell.
   250     self closeDownShell.
   253     shellTerminateAction notNil ifTrue:[
   251     shellTerminateAction notNil ifTrue:[
   486     "/ not translated.
   484     "/ not translated.
   487     kbdMap := device keyboardMap copy.
   485     kbdMap := device keyboardMap copy.
   488 
   486 
   489     ctrlKeys := kbdMap keys select:[:key | key startsWith:'Ctrl'].
   487     ctrlKeys := kbdMap keys select:[:key | key startsWith:'Ctrl'].
   490     ctrlKeys do:[:key | kbdMap removeKey:key].
   488     ctrlKeys do:[:key | kbdMap removeKey:key].
       
   489 
   491     cmdKeys := kbdMap keys select:[:key | key startsWith:'Cmd'].
   490     cmdKeys := kbdMap keys select:[:key | key startsWith:'Cmd'].
   492     cmdKeys do:[:key | kbdMap removeKey:key].
   491     cmdKeys do:[:key | 
       
   492         (#(Copy Paste SaveAs Print) includes:(kbdMap at:key)) ifFalse:[
       
   493             kbdMap removeKey:key
       
   494         ]
       
   495     ].
   493 
   496 
   494     kbdMap removeKey:#Delete ifAbsent:[].
   497     kbdMap removeKey:#Delete ifAbsent:[].
   495     kbdMap removeKey:#BackSpace ifAbsent:[].
   498     kbdMap removeKey:#BackSpace ifAbsent:[].
   496 
   499 
   497     "
   500     "
   498      VT52TerminalView openShell
   501      VT52TerminalView openShell
   499     "
   502     "
       
   503 
       
   504     "Modified: / 12.6.1998 / 22:18:23 / cg"
   500 !
   505 !
   501 
   506 
   502 initializeKeyboardSequences
   507 initializeKeyboardSequences
   503     self subclassResponsibility.
   508     self subclassResponsibility.
   504 !
   509 !
   721 
   726 
   722 paste:someText
   727 paste:someText
   723     "paste - redefined to send the chars to the shell instead
   728     "paste - redefined to send the chars to the shell instead
   724      of pasting into the view"
   729      of pasting into the view"
   725 
   730 
   726     someText asString string do:[:aChar |
   731     |s nLines|
   727         inStream nextPut:aChar
   732 
   728     ]
   733     s := someText.
       
   734     s isString ifTrue:[
       
   735         s := s asStringCollection
       
   736     ] ifFalse:[
       
   737         (s isKindOf:StringCollection) ifFalse:[
       
   738             self warn:'selection (' , s class name , ') is not convertable to Text'.
       
   739             ^ self
       
   740         ]
       
   741     ].
       
   742     (nLines := s size) == 0 ifTrue:[^ self].
       
   743     (nLines == 1 and:[(s at:1) size == 0]) ifTrue:[^ self].
       
   744     s keysAndValuesDo:[:idx :line |
       
   745         inStream nextPutAll:line.
       
   746         idx ~~ nLines ifTrue:[
       
   747             inStream nextPut:(Character return).
       
   748         ]
       
   749     ].
       
   750 
       
   751     "Modified: / 12.6.1998 / 22:12:47 / cg"
   729 ! !
   752 ! !
   730 
   753 
   731 !TerminalView class methodsFor:'documentation'!
   754 !TerminalView class methodsFor:'documentation'!
   732 
   755 
   733 version
   756 version
   734     ^ '$Header: /cvs/stx/stx/libwidg2/TerminalView.st,v 1.28 1998-06-12 20:03:26 cg Exp $'
   757     ^ '$Header: /cvs/stx/stx/libwidg2/TerminalView.st,v 1.29 1998-06-12 20:20:29 cg Exp $'
   735 ! !
   758 ! !