Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!samsung!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!agate!bionet!raven.alaska.edu!milton!benson From: benson@milton.u.washington.edu (Dan Benson) Newsgroups: comp.lang.smalltalk Subject: Re: Mac Cut/Paste Message-ID: <1991Jun18.212925.2466@milton.u.washington.edu> Date: 18 Jun 91 21:29:25 GMT References: <1991Jun18.133240.22383@msuinfo.cl.msu.edu> Organization: University of Washington, Seattle Lines: 115 In article <1991Jun18.133240.22383@msuinfo.cl.msu.edu> sticken@pleiades.cps.msu.edu writes: >How can I get the normal macintosh cut/paste (C and V) using PP >ST r4? Its pretty annoying to a mac user new to smalltalk to have to keep using >the menu for cut/paste operations. > >Thanks, > ---jon--- Jon, This may not be what you want but I have an extended keyboard on my Mac and I've assigned the Cut, Copy, Paste, and other common functions to the function keys on my keyboard. Below are the modifications to the Paragraph Editor methods required to make this work. It's not perfect but it's handy. Perhaps you can get some idea from this to do what you really want to do. Good luck, Dan Benson -=-=-=-=- 'From Objectworks(r)\Smalltalk, Release 4 of 25 October 1990 on 3 June 1991 at 7:26:02 pm'! !ParagraphEditor methodsFor: 'DANs ADDITIONS'! accept: characterStream key: aChar self accept. ^true! again: characterStream key: aChar self again. ^true! copy: characterStream key: aChar self copySelection. ^nil! doIt: characterStream key: aChar self doIt. ^true! inspectIt: characterStream key: aChar self inspectIt. ^true! printIt: characterStream key: aChar self printIt. ^true! undo: characterStream key: aChar self undo. ^true! ! !ParagraphEditor class methodsFor: 'class initialization'! initializeDispatchTable "Initialize the keyboard dispatch table" "ParagraphEditor initializeDispatchTable." Keyboard := DispatchTable new. Keyboard defaultForCharacters: #normalCharacter:key:. Keyboard defaultForNonCharacters: #ignoreInput:key:. Keyboard bindValue: #backspace:key: to: Cut. Keyboard bindValue: #paste:key: to: Paste. Keyboard bindValue: #backspace:key: to: BS. Keyboard bindValue: #backWord:key: to: Ctrlw. Keyboard bindValue: #displayIfTrue:key: to: Ctrlt. Keyboard bindValue: #displayIfFalse:key: to: Ctrlf. Keyboard bindValue: #displayDate:key: to: Ctrld. Keyboard bindValue: #displayColonEqual:key: to: Ctrlg. "Here are my additions" Keyboard bindValue: #undo:key: to: #F1. Keyboard bindValue: #cut:key: to: #F2. Keyboard bindValue: #copy:key: to: #F3. Keyboard bindValue: #paste:key: to: #F4. Keyboard bindValue: #again:key: to: #F5. Keyboard bindValue: #doIt:key: to: #F6. Keyboard bindValue: #printIt:key: to: #F7. Keyboard bindValue: #inspectIt:key: to: #F8. Keyboard bindValue: #accept:key: to: #F9. '<''"[{(' do: [:char | Keyboard bindValue: #enclose:key: to: ESC followedBy: char]. 'sSuUbBiIx' do: [:char | Keyboard bindValue: #changeEmphasis:key: to: ESC followedBy: char]. Keyboard bindValue: #miniFormat:key: to: ESC followedBy: $f. Keyboard bindValue: #selectCurrentTypeIn:key: to: ESC followedBy: Tab! ! -- | Dan Benson benson@ee.washington.edu | | Dept. of Elec. Engr., FT-10 | | University of Washington (206) 685-7567 | | Seattle, WA 98195 |