Tads 3 keyboard

I would like to have a pc and when player types words on keyboard to show message based on the word they typed. Asl give a default message for words not coded?

I think there was an example similar to this in the docs… I’ll try to get you an answer this evening…

Thanks

This is copied (and modified) from How To Create Verbs from the Tech Manual, which you might want to read:

   DefineLiteralTAction(TypeOn, DirectObject);

   VerbRule(TypeOn)
     'type' singleLiteral 'on' singleDobj
     : TypeOnAction
     verbPhrase = 'type/typing (what) (on what)'
   ;

   modify Thing
     dobjFor(TypeOn)
     {
       verify() 
       { 
         illogical('There\'s no way to type anything on {that dobj/him}. ');
       }
     }
   ;

   // later, as part of some room definition...
   + keyboard: Thing 'keyboard' 'keyboard'
     dobjFor(TypeOn)
     {
       verify() { }
       action()
       {
         "You type \"<<gLiteral>>\" on the keyboard. ";
         screen.screenText += '\n' + gLiteral;
       }
     }
   ;
   + screen: Immovable 'screen' 'screen'
     "The screen shows the following text:
      \b<< screenText >> "

     screenText = 'Enter some text: '
;