Difference between revisions of "SCI Kernel Documentation/Input Functions"

From SCI Wiki
Jump to navigationJump to search
 
(One intermediate revision by the same user not shown)
Line 58: Line 58:
 
<blockquote>
 
<blockquote>
 
{|
 
{|
|mouseDown &nbsp;&nbsp;||a mouse button was pressed
+
|width= "100" | mouseDown ||a mouse button was pressed
 
|-
 
|-
 
|mouseUp||a mouse button was released
 
|mouseUp||a mouse button was released

Latest revision as of 13:39, 3 December 2015

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Index


Input Functions

Author: Jeff Stephenson

Revision by: David Slayback

 


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


 

Table of Contents

 

< Previous: Graphic Screen Functions Next: Menu Functions >