home *** CD-ROM | disk | FTP | other *** search
- !SHORT:Confine_Mouse_Horiz Resrtrict position of mouse cursor horizontally
- Confine_Mouse_Horiz KeyTTT
-
-
-
- Purpose To restrict the screen position of the mouse cursor
- horizontally.
-
- Declaration Confine_Mouse_Horiz(Left,Right: integer);
-
- Left is the left most X coord (1..80)
- Right is the right most X coord (1..80)
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks If the mouse is outside the confined coords when the
- restrictions are made, the mouse is repositioned inside the
- nearest boundary, as soon as any mouse activity occurs .
-
-
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- BEGIN
- HIDE_MOUSE_CURSOR;
- CONFINE_MOUSE_HORIZ(20,60);
- SHOW_MOUSE_CURSOR;
- END.
-
-
- The mouse is resticted to movement between columns 20 and 60.
-
- !SEEALSO:Confine_Mouse_Vert
-
-
- !SHORT:Confine_Mouse_Vert Restrict position of mouse cursor vertically
- Confine_Mouse_Vert KeyTTT
-
-
-
- Purpose To restrict the screen position of the mouse cursor
- vertically.
-
- Declaration Confine_Mouse_Vert(Top,Bot: integer);
-
- Top is the upper most Y coord (1..25)
- Bot is the lower most Y coord (1..25)
-
- Uses CRT, DOS, KeyTTT;
-
- Remarks If the mouse is outside the confined coords, then as soon as
- any mouse activity occurs (or a mouse function is called)
- the mouse is repositioned inside the nearest boundary.
-
-
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- BEGIN
- HIDE_MOUSE_CURSOR;
- CONFINE_MOUSE_HORIZ(20,60);
- CONFINE_MOUSE_VERT(5,15);
- SHOW_MOUSE_CURSOR;
- END.
-
-
- The mouse is resticted to movement between columns 20 to 60, and
- between rows 5 to 15.
-
-
- !SEEALSO:Confine_Mouse_Horiz
-
-
- !SHORT:DelayKey Pause specified time period or key press
- DelayKey KeyTTT
-
-
-
- Purpose To pause while user presses key or a specified time period
- elapses.
-
- Declaration DelayKey(Time: integer);
-
- Time is the maximum pause in seconds.
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks This is one of my favorites. The system pauses until a key
- is pressed or, if a key isn't pressed, until a specified
- time has elapsed.
-
- Very useful for temporarily displaying messages, copyright
- screens etc. As soon as the user presses a key (or there is
- mouse activity) the procedure ends.
-
-
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- BEGIN
- DISPLAY_HELP; {SOME EARLIER DEFINED PROCEDURE}
- DELAYKEY(5);
- CLRSCR;
- END.
-
-
- A help screen is displayed for up to 5 seconds or until a key is
- pressed.
-
- !SEEALSO:GetKey
-
-
- !SHORT:GetKey Read a character from keyboard
- GetKey KeyTTT
-
-
-
- Purpose To read a character from the keyboard.
-
- Declaration GetKey:char;
-
- Returns Char
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks This is the main function in the KeyTTT unit and is called
- throughout the Toolkit.
-
- This is a fully functional replacement for Turbo's internal
- ReadKey command. Refer to Appendix B for a full list of all
- the character codes that are returned.
-
-
-
- Example
-
-
- USES CRT, FASTTTT, DOS, KEYTTT;
- VAR CH : CHAR;
- BEGIN
- WRITECENTER(25,LIGHTCYAN,BLUE,'PRESS F10 TO CONTINUE');
- CH := GETKEY;
- IF CH <> #196 THEN
- HALT;
- END.
-
-
- The code for F10 is #196, see appendix B.
-
- !SEEALSO:DelayKey
-
-
- !SHORT:Get_Mouse_Action Determine mouse activity
- Get_Mouse_Action KeyTTT
-
-
-
- Purpose Determine mouse activity i.e. movement and button presses.
-
- Declaration Get_Mouse_Action(var But:button; var Hor, Ver:
- integer);
-
- But is retuned with one of NoB, LeftB, RightB, BothB
- Hor and Ver return the horizontal and vertical movement
-
- Uses CRT, DOS, KeyTTT.
-
- Remarks This procedure is designed for internal use and is called by
- GetKey.
-
- The Hor & Ver variables return the movement in cols and rows
- not pixels i.e. Pixel div 8. The movement is returned
- relative to the position of the mouse the last time the
- procedure was called.
-
- Example
-
-
- USES CRT, DOS, KEYTTT;
- VAR
- B : BUTTON;
- X,Y : INTEGER;
- BEGIN
- REPEAT
- GET_MOUSE_ACTION(B,X,Y);
- UNTIL B = LEFTB;
- END.
-
-
-
- This program continues looping until the left mouse button is pressed.
-
-
-
-
-
-
-
- !SHORT:Hide_Mouse_Cursor Hide mouse cursor from view
- Hide_Mouse_Cursor