Difference between revisions of "SCI Kernel Documentation/Input Functions"
(8 intermediate revisions by the same user not shown) | |||
Line 23: | Line 23: | ||
</div><br /> | </div><br /> | ||
− | <div align="center"><span style="font-size: 22pt"></span><br /> | + | <div align="center"><span style="font-size: 22pt">Input Functions</span><br /> |
''Author: [[Jeff Stephenson]]''<br /> | ''Author: [[Jeff Stephenson]]''<br /> | ||
''Revision by: David Slayback''</div> | ''Revision by: David Slayback''</div> | ||
Line 29: | Line 29: | ||
| | ||
− | + | ==<br /> Input Functions == | |
+ | |||
+ | ===<br /> (Said saidStr) === | ||
+ | |||
+ | <blockquote> | ||
+ | Checks to see if the parsed input sentence matches the input specified by saidStr. Returns TRUE if the input matched saidStr, FALSE otherwise. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (HaveMouse) === | ||
+ | |||
+ | <blockquote> | ||
+ | Returns TRUE if the user has a mouse driver installed, FALSE otherwise. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (SetCursor form showOn [x] [y]) === | ||
+ | |||
+ | <blockquote> | ||
+ | Will set the cursor to the one found in the file "cursor.form" and show the cursor if showOn is TRUE. The optional x & y will position the cursor to the given position. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (GetEvent eventMask event) === | ||
+ | |||
+ | <blockquote> | ||
+ | Checks the input buffer for an input event of type specified by eventMask. Returns FALSE if there are none. If an event exists, it fills in the event record of the event instance whose ID is in event and returns TRUE. | ||
+ | |||
+ | The types of events which may be specified in eventMask are: | ||
+ | |||
+ | <blockquote> | ||
+ | {| | ||
+ | |width= "100" | mouseDown ||a mouse button was pressed | ||
+ | |- | ||
+ | |mouseUp||a mouse button was released | ||
+ | |- | ||
+ | |keyDown||a key was pressed | ||
+ | |- | ||
+ | |keyUp||a key was released | ||
+ | |- | ||
+ | |menuStart||the menu request key was hit | ||
+ | |- | ||
+ | |menuHit||a menu item was selected | ||
+ | |- | ||
+ | |direction||a direction event was received | ||
+ | |- | ||
+ | |saidEvent||a Said statement | ||
+ | |- | ||
+ | |joyDown||a joystick button was pressed | ||
+ | |- | ||
+ | |joyUp||a joystick button was released | ||
+ | |} | ||
+ | </blockquote> | ||
+ | |||
+ | These event types may be 'or'ed together to request multiple event types. The symbolic value 'allEvents' requests any event type. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (GlobalToLocal event) === | ||
+ | |||
+ | <blockquote> | ||
+ | Convert the coordinates in the event object event from global (screen) to local (window) coordinates. Event coordinates are always returned in global coordinates, so this call is necessary to convert to the coordinates within the current window. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (LocalToGlobal event) === | ||
+ | |||
+ | <blockquote> | ||
+ | The reverse of GlobalToLocal -- converts the coordinates in event from the local window coordinates to global screen coordinates. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (Parse stringPtr) === | ||
+ | |||
+ | <blockquote> | ||
+ | Parses the string pointed to by stringPtr and returns TRUE if the kernel could parse the string, FALSE otherwise. The kernel can parse the string if all the words in the string are in the game's vocabulary (the file vocab.000) and the sentence structure is one recognized by the kernel's grammar. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (SetSynonyms regionList) === | ||
+ | |||
+ | <blockquote> | ||
+ | Lets the kernel known about the synonyms in each region. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (MapKeyToDir flag) === | ||
+ | |||
+ | <blockquote> | ||
+ | If flag is TRUE(default), direction keys are mapped to direction events, otherwise if FALSE, direction keys are mapped to keyDown events. | ||
+ | </blockquote> | ||
| | ||
Line 42: | Line 124: | ||
| | ||
− | <span style="float: left">[[SCI Kernel Documentation/|< Previous: ]]</span><span style="float: right">[[SCI Kernel Documentation/|Next: | + | <span style="float: left">[[SCI Kernel Documentation/Graphic Screen Functions|< Previous: Graphic Screen Functions]]</span> |
+ | <span style="float: right">[[SCI Kernel Documentation/Menu Functions|Next: Menu Functions >]]</span> | ||
| | ||
[[Category:SCI Documentation]] | [[Category:SCI Documentation]] | ||
− | |||
[[Category:Kernel Functions]] | [[Category:Kernel Functions]] | ||
+ | [[Category:Input]] | ||
+ | [[Category:Input Functions]] |
Latest revision as of 13:39, 3 December 2015
Input Functions
(Said saidStr)
Checks to see if the parsed input sentence matches the input specified by saidStr. Returns TRUE if the input matched saidStr, FALSE otherwise.
(HaveMouse)
Returns TRUE if the user has a mouse driver installed, FALSE otherwise.
(SetCursor form showOn [x] [y])
Will set the cursor to the one found in the file "cursor.form" and show the cursor if showOn is TRUE. The optional x & y will position the cursor to the given position.
(GetEvent eventMask event)
Checks the input buffer for an input event of type specified by eventMask. Returns FALSE if there are none. If an event exists, it fills in the event record of the event instance whose ID is in event and returns TRUE.
The types of events which may be specified in eventMask are:
mouseDown a mouse button was pressed mouseUp a mouse button was released keyDown a key was pressed keyUp a key was released menuStart the menu request key was hit menuHit a menu item was selected direction a direction event was received saidEvent a Said statement joyDown a joystick button was pressed joyUp a joystick button was released These event types may be 'or'ed together to request multiple event types. The symbolic value 'allEvents' requests any event type.
(GlobalToLocal event)
Convert the coordinates in the event object event from global (screen) to local (window) coordinates. Event coordinates are always returned in global coordinates, so this call is necessary to convert to the coordinates within the current window.
(LocalToGlobal event)
The reverse of GlobalToLocal -- converts the coordinates in event from the local window coordinates to global screen coordinates.
(Parse stringPtr)
Parses the string pointed to by stringPtr and returns TRUE if the kernel could parse the string, FALSE otherwise. The kernel can parse the string if all the words in the string are in the game's vocabulary (the file vocab.000) and the sentence structure is one recognized by the kernel's grammar.
(SetSynonyms regionList)
Lets the kernel known about the synonyms in each region.
(MapKeyToDir flag)
If flag is TRUE(default), direction keys are mapped to direction events, otherwise if FALSE, direction keys are mapped to keyDown events.
- Notes
< Previous: Graphic Screen Functions Next: Menu Functions >