****sectionsbetween{**and**}notyetimplemented!!****Abstract:TIPisapackagebuiltontopofDanSwinehart'sInscriptsoftwarethatparseshardware-levelactionsfromthekeyboard,mouse,andkeyset,intohigher-leveluseractions.TheinputtoTIPisaMesa-likeprogram(calledhereaTIPtable)describingtheparsingalgorithm.i.e.thesetofeventstoberecognised,andtheoutputtobepassedthroughaclientsuppliedprocedure,whichiscalledoncepereventparsed.TIPrunsasaseparateprocessfromtheclientandisreentrant,allowingseveralinstancestorunatonce.TherearepublicinterfacestocreateanewTIPclientandtochangetheparsetablebywhichTIPrecognisesevents.TIPisusedbyCedarDocs,andpotentialusersshouldbeawareoftheInputFocusinterfacethatallowsinputeventstoarbitrarilydirectedtoasingleCedardocument.BasicOverview:Inordertogetstarted,youneedtocreateaTIPclient.Auserisexpectedtoprovideaprocedure(aTIPNotifyProc)thatTIPcancallforrecognisedevents.Inyourstartcode,youshouldcallCreateClient,passinginyourTIPNotifyProc.TIPwillforkaprocessandbeginlookingforinputevents.YounextneedtogiveTIPatablefromwhichtoparseevents.Mostapplicationsfindthedefaulttabletobesufficient,butyoucanreadthesectiononTIPTablesbelowinorderto"rollyourown".YoucancreateyourownTIPTablefromitsdiskrepresentationusingInstantiateNewTIPTable,orsimplypassNILintoInstantiateNewTIPTable.WhenTIPrecognisesanevent,theTIPNotifyProciscalledwiththeparameter'results',whichisalistofvaluescollectedfromtheTIPTablewhileparsinganevent.ThedefaulttableprovidesaREFCHARACTERfornormalkeys,{**andtheatom$Red,$Yellow,or$Blueformouseclicks.Inaddition,aREFRECORD[x,y:REAL]ispassedalongwiththemouseclickinformationthatgivesthescreencoordinatesofthemouse.{Theatom$AbortispassediftheusertypesCONTROLDEL.**}TIPTables:Foradetailedexample,see[IVY]Tioga>Tioga.tip,andrememberthatyoucanalwaysdefaultthetablebypassingNILtoInstantiateTIPTable.Ingeneral,mostpeoplewillwanttousethedefaultmechanisms.HereistheBNFdescriptionforavalidTIPtable:(terminalsarethequotedsymbolsandthespecialcharactersbesidesthemetasymbols::=and|)TIPTable::=OptionsTriggerStmt.Options::=empty|"OPTIONS"OptionList;OptionList::=SmallOrFast|SmallOrFast,PrintOrDefaultKeys|PrintOrDefaultKeysSmallOrFast::="Small"|"Fast"PrintOrDefaultKeys::="PrintKeys"|"DefaultKeys"TriggerStmt::="SELECT""TRIGGER""FROM"TriggerChoiceSeriespf_,<"%') 2.3[Xv N"#& ..398;V  #\).o1&58 @U@-_ !"(.267C:= S "$7%*)+- 47:>x@'QS|=# *.0!47_9=PJv?i"%([,.0? 6<N5d#%* 0@157:<@Lc k r!m%{(= .368 ;GKT #')|-s/,1 8>Iu #).*,/4 F]HC90 $%)*-2Q368B=Agl '*-`/2v4 ;@?V #] +02;5v ?>`YV!&) ,147;D<?B4,  #%x .0+4"7=92  #),/X259>@r05 -!V$.C05=8=x?/6q5 !^%*S,#136o=? -|N !(#'+ 25u8;G+ #P&+,1Q258 ;*@&v#` 68?O!l\ d#%*-/\<>Z T8C!$( (i !{#$(J+ . 5c7:>^lG $}& / 145x %% + } !u"R *J+'7q  "6 &'  a9!*0\TVm$2EnableStmt::="SELECT""ENABLE""FROM"EnableChoiceSeriesTriggerChoiceSeries::=TriggerChoice;TriggerChoiceSeries|TriggerChoice"ENDCASE"FinalChoiceEnableChoiceSeries::=EnableChoice;EnableChoiceSeries|EnableChoice"ENDCASE"FinalChoiceTriggerChoice::=TriggerTermExpressionEnableChoice::=EnableTermExpressionTriggerTerm::=KeyTimeOut|"Mouse"TimeOutEnableTerm::=Key|PredicateIdentKey::=KeyIdent"Up"|KeyIdent"Down"TimeOut::="BEFORE"Number|"AFTER"NumberExpression::="AND"TriggerChoice|"WHILE"EnableChoice|=>StatementResults::=ResultItem|ResultItem,Results|ResultItemExpressionResultItem::="Coords"|"Char"|String|Number|ResultIdentFinalChoice::=empty|=>StatementStatement::=TriggerStmt|EnableStmt|ResultsBlanks,tabsandCRsareallowedbetweensymbols,commentsarehandledasinMesa.Therearesyntaxdiagramsavailablefrom[IVY]TIP>TIPsyntax.pressreflectingtheabove.Themeaningoftheoptionsisasfollows:DefaultKeys-Addsallnormalkeyboardevents{**,plusred,blue,andyellowdown**}PrintKeys-Asabove,butonlyprintingkeys(e.g.not'Return'ormousestuff)Fast-IndicatestotablebuilderthatyoufavorlookupspeedoverstorageSmall-Indicatesyoufavorstorageoverlookupspeed(default)ThewholematchprocessisviewedasaSELECTstatement,whichiscontinuouslyexecutedreadingkeytransitions,mousemovements,orkeystatesfromtheinputstream.Atriggerstatementhastheeffectoflookingatthenextactionrecordedintheinputstreamandbranchingtotheappropriatechoice.Anenablestatementimpliesselectionbetweenthedifferentchoicesaccordingtothe'current'stateofthekeyboardorthemousekeys.Triggertermsmayappearinsequence,separatedbyAND.TheymightbemixedwithenabletermswhichinturnarecharacterizedbythekeywordWHILE.Atimeoutfollowingatriggerindicatesatimingconditionwhichhastoholdbetweenthistriggeranditspredecessor.Thenumberassociatedwiththetimeoutexpressesatimeintervallinmsecs.Anenabletermconsistingofapredicateidentifierisinterpretedbycallingthe'TIPPredicate'withthesamename,abooleanprocedureregisteredinTIPbytheuser.Eventsstartingwiththesamesequenceoftriggerand/orenabletermsareexpressedasnestedstatements.AsresultitemsyouqEg/p_, !)|/[4 ( ) Z6 $- XY ($)"V $-} S  # Q  # N #$d*KL  I!"a(Ht %&x-%D  '(/M \C8Af '(\?8 J >  %x&T*m+I01 : vNd!9!6 !" * *4+k#2$* /6;8=?2 O$+)0"'Z -n/+'?!"$8( ( ($V*_.147M:=w&%H%H %H v"&+S.l1o39G; ?e###z"'*z-105k9Lp* x#~&5( /27 >BA]$z&(*w,1/4v :<=!  & !$& /25L8<>  z8 1 "%M(-257~:@ ' #E)+3/ 68Char;...ThiseventwillbetriggeredwhentheAkeygoesdown,onlyiftheCtrlkeyisupandwillpassaREFtothecharacterAasaresult.Amoreelaborateexamplemaylooklikethis:SELECTTRIGGERFROMRedDown=>SELECTTRIGGERFROMRedUpBEFORE200ANDRedDownBEFORE200=>SELECTENABLEFROMLeftShiftDown=>Coords,ShiftedDoubleClickENDCASE=>Coords,NormalDoubleClick;BlueDownBEFORE300=>RedAndBlueENDCASE=>Coords,SimpleClick;...ThistableproducestheresultNormalDoubleClickalongwiththemousecoordinatesiftheredmousebuttongoesdown,remainstherenotlongerthan200ms,andgoesdownagainbeforeanother200mselapse.TheresultwillbeShiftedDoubleClickifthesameactionsoccurbutalsotheleftshiftkeyisdown.Iflessthan300msaftertheinitial'RedDown'thebluemousebuttonalsogoesdownthenwegettheresultRedAndBlue.AndfinalythetablespecifiestheresultSimpleClick(withcoordinates)forthecaseofredgoingdownbutnoneoftheabovedescribedsucceedingactionsoccuring.--wwTIP.syntax--lasteditedbyWiniger,30-Sep-8117:17:44TIPTable::=OptionsTriggerStmt.Options::=empty|"OPTIONS"OptionList;OptionList::=SmallOrFast|SmallOrFast,PrintOrDefaultKeys|PrintOrDefaultKeysSmallOrFast::="Small"|"Fast"PrintOrDefaultKeys::="PrintKeys"|"DefaultKeys"qEg/p_,V!&(q*04a6%;D>Bl] I d"'(++.$/047:u>[.$8%)B.5{82<>:Z6P"$+1.25<9 B5XD^#(,./;h?v@V!k&'*+ 249? @U@Q`1 "& (]*.Q1>557& >NLJm!#KSH/  $'(+(.B2e5~69?<>@F]l;E &()*CA @#D&]) ?>)x #%K(X'I(+ .3#69e<2>A&J%H7!U%A(-/m26;T>!#v!A !w!$P( /3q ;3=p?B R*@!k#'- 49[, ,{%e %% +o } !u"R *J+'7   x6 &' ]TVm$4TriggerStmt::="SELECT""TRIGGER""FROM"TriggerChoiceSeriesEnableStmt::="SELECT""ENABLE""FROM"EnableChoiceSeriesTriggerChoiceSeries::=TriggerChoice;TriggerChoiceSeries|TriggerChoice"ENDCASE"FinalChoiceEnableChoiceSeries::=EnableChoice;EnableChoiceSeries|EnableChoice"ENDCASE"FinalChoiceTriggerChoice::=TriggerTermExpressionEnableChoice::=EnableTermExpressionTriggerTerm::=KeyTimeOut|"Mouse"TimeOutEnableTerm::=Key|PredicateIdentKey::=KeyIdent"Up"|KeyIdent"Down"TimeOut::="BEFORE"Number|"AFTER"NumberExpression::="AND"TriggerChoice|"WHILE"EnableChoice|=>StatementResults::=ResultItem|ResultItem,Results|ResultItemExpressionResultItem::="Coords"|"Char"|String|Number|ResultIdentFinalChoice::=empty|=>StatementStatement::=TriggerStmt|EnableStmt|ResultsqEg/p_, a9!*0\] !)|/Z64 ( ) X $- VY ($)"U@ $-} Q  # PJ  # L #$d*KKT  H!"a(F^t %&x-%C  '(/M \Ah8? '(\>8 J