home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
library
/
dos
/
tegl_ii
/
intro
/
teglintr.doc
< prev
next >
Wrap
Text File
|
1991-08-16
|
15KB
|
584 lines
{-----------------------------------------------------------------------------}
{ TEGL Windows ToolKit II }
{ Copyright (C) 1990, 1991 TEGL Systems Corporation }
{ All Rights Reserved. }
{-----------------------------------------------------------------------------}
{$I switches.inc}
{$F+}
Unit TEGLIntr;
INTERFACE
USES Dos, {interrupt calls}
virtmem,
FastGrph; {needed for ActivePage Variable}
TYPE
FuncCallProc = Function:Boolean;
KeyRecPtr = ^KeyFlags;
KeyFlags = RECORD
NextKeyFlag : KeyRecPtr;
Repeatkey : Boolean;
KeyCode : Word;
KeyCall : FuncCallProc;
END;
TimeRecPtr = ^TimeFlags;
TimeFlags = RECORD
NextTimeFlag : timerecptr;
TimerCount : Word;
TimerStart : Word;
TimerFlag : Boolean;
TimerCall : FuncCallProc;
END;
const
TimerIgnore : boolean = FALSE;
Timerbusy : boolean = FALSE;
TimerCheck : Boolean = TRUE;
ControlBreakFlag : Boolean = FALSE;
CtrlBrkCount : Word = 0;
Mouse_Event : Word = 0;
Mouse_Xcoord : Integer = 319;
Mouse_Ycoord : Integer = 174;
Mouse_Buttons : Word = 0;
Last_Mouse_Buttons : Word = 0; {used only by TEGLIntr.ASM}
DoubleClickSpeed : Word = 6;
LeftButtonDouble : Boolean = False;
LeftButtonTimeRem : Word = 0;
LeftButtonPress : Word = 0;
LeftPressXcoord : Word = 0;
LeftPressYcoord : Word = 0;
LeftButtonRelease : Word = 0;
LeftReleaseXcoord : Word = 0;
LeftReleaseYcoord : Word = 0;
RightButtonDouble : Boolean = False;
RightButtonTimeRem : Word = 0;
RightButtonPress : Word = 0;
RightPressXcoord : Word = 0;
RightPressYcoord : Word = 0;
RightButtonRelease : Word = 0;
RightReleaseXcoord : Word = 0;
RightReleaseYcoord : Word = 0;
MiddleButtonDouble : Boolean = False;
MiddleButtonTimeRem : Word = 0;
MiddleButtonPress : Word = 0;
MiddlePressXcoord : Word = 0;
MiddlePressYcoord : Word = 0;
MiddleButtonRelease : Word = 0;
MiddleReleaseXcoord : Word = 0;
MiddleReleaseYcoord : Word = 0;
KBMouseBusy : Boolean = FALSE;
MouseShow : Boolean = FALSE;
MouseUserFlag : Boolean = FALSE;
Mouse_MaxYpos : Integer = 349;
Mouse_MinYpos : Integer = 0;
Mouse_MaxXpos : Integer = 639;
Mouse_MinXpos : Integer = 0;
FreezeCount : Word = 0;
Sk_NoShift = $00;
Sk_RightShift = $01;
Sk_LeftShift = $02;
Sk_CtrlShift = $04;
Sk_AltShift = $08;
Sk_ScrollLock = $10;
Sk_NumLock = $20;
Sk_CapsLock = $40;
Sk_InsLock = $80;
Key_ESC = $01;
Key_a = $1E;
Key_b = $30;
Key_c = $2E;
Key_d = $20;
Key_e = $12;
Key_f = $21;
Key_g = $22;
Key_h = $23;
Key_i = $17;
Key_j = $24;
Key_k = $25;
Key_l = $26;
Key_m = $32;
Key_n = $31;
Key_o = $18;
Key_p = $19;
Key_q = $10;
Key_r = $13;
Key_s = $1F;
Key_t = $14;
Key_u = $16;
Key_v = $2F;
Key_w = $11;
Key_x = $2D;
Key_y = $15;
Key_z = $2C;
Key_1 = $02;
Key_2 = $03;
Key_3 = $04;
Key_4 = $05;
Key_5 = $06;
Key_6 = $07;
Key_7 = $08;
Key_8 = $09;
Key_9 = $0A;
Key_0 = $0B;
Key_F1 = $3B;
Key_F2 = $3C;
Key_F3 = $3D;
Key_F4 = $3E;
Key_F5 = $3F;
Key_F6 = $40;
Key_F7 = $41;
Key_F8 = $42;
Key_F9 = $43;
Key_F10 = $44;
Key_Space = $39;
Key_Enter = $1C;
Key_Tab = $0F;
Key_SysReq = $54;
Key_BackSpace = $0E;
Key_Ins = $52;
Key_Del = $53;
Key_Home = $47;
Key_UpArrow = $48;
Key_PgUp = $49;
Key_LeftArrow = $4B;
Key_RightArrow = $4D;
Key_DownArrow = $50;
Key_End = $4F;
Key_PgDn = $51;
Key_NumLock = $45;
Key_ScrollLock = $46;
Key_Ctrl = $1D;
Key_shift = $2A;
Key_Alt = $38;
Key_CapsLock = $3A;
Key_minus = $0C;
Key_equal = $0D;
Key_period = $34;
Key_lbracket = $1A;
Key_rbracket = $1B;
Key_coma = $33;
Key_semi = $27;
Key_rquote = $28;
Key_lquote = $29;
Key_asterisk = $37;
Key_GrayMinus = $4A;
Key_Center5 = $4C;
Key_GrayPlus = $4E;
Key_backslash = $2B;
Key_forwslash = $35;
PointingHand: MaskType =
(($E1FF,$E1FF,$E1FF,$E1FF,$E1ff,$E000,$E000,$e000, { Screen Mask }
$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000),
($1E00,$1200,$1200,$1200,$1200,$13ff,$1249,$1249, { Cursor Mask }
$1249,$9001,$9001,$9001,$8001,$8001,$8001,$FFFF));
HourGlass: MaskType =
(($0000,$0000,$0000,$0000,$8001,$C003,$E007,$F00F,
$E007,$C003,$8001,$0000,$0000,$0000,$0000,$FFFF),
($0000,$7FFE,$6006,$300C,$1818,$0C30,$0660,$03C0,
$0660,$0C30,$1998,$33CC,$67E6,$7FFE,$0000,$0000));
Standard: MaskType =
(($3FFF,$1FFF,$0FFF,$07FF,$03FF,$01FF,$00FF,$007F,
$003F,$001F,$01FF,$10FF,$30FF,$F87F,$F87F,$FC7F),
($0000,$4000,$6000,$7000,$7800,$7C00,$7E00,$7F00,
$7F80,$7C00,$6C00,$4600,$0600,$0300,$0300,$0000));
DiagCross: MaskType =
(($07E0,$0180,$0000,$C003,$F00F,$C003,$0000,$0180,
$07E0,$FFFF,$FFFF,$FFFF,$FFFF,$FFFF,$FFFF,$FFFF),
($0000,$700E,$1C38,$0660,$03C0,$0660,$1C38,$700E,
$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000));
CheckMark: MaskType =
(($FFF0,$FFE0,$FFC0,$FF03,$0607,$000F,$001F,$C03F,
$F07F,$FFFF,$FFFF,$FFFF,$FFFF,$FFFF,$FFFF,$FFFF),
($0000,$0006,$000C,$0018,$0030,$0060,$70C0,$1D80,
$0700,$0000,$0000,$0000,$0000,$0000,$0000,$0000));
MaskCURSOR : Masktype =
(($07FF,$07FF,$07FF,$8FFF,$8FFF,$8FFF,$8FFF,$8FFF,
$8FFF,$8FFF,$8FFF,$07FF,$07FF,$07FF,$FFFF,$FFFF),
($0000,$7000,$2000,$2000,$2000,$2000,$2000,$2000,
$2000,$2000,$2000,$2000,$7000,$0000,$0000,$0000));
ScancodeTable : Array [1..127] of Boolean =
(
{code 01} FALSE, {ESC}
{code 02} FALSE, {1}
{code 03} FALSE, {2}
{code 04} FALSE, {3}
{code 05} FALSE, {4}
{code 06} FALSE, {5}
{code 07} FALSE, {6}
{code 08} FALSE, {7}
{code 09} FALSE, {8}
{code 0A} FALSE, {9}
{code 0B} FALSE, {0}
{code 0C} FALSE, {-}
{code 0D} FALSE, {=}
{code 0E} FALSE, {BackSpace}
{code 0F} FALSE, {Tab}
{code 10} FALSE, {q}
{code 11} FALSE, {w}
{code 12} FALSE, {e}
{code 13} FALSE, {r}
{code 14} FALSE, {t}
{code 15} FALSE, {y}
{code 16} FALSE, {u}
{code 17} FALSE, {i}
{code 18} FALSE, {o}
{code 19} FALSE, {p}
{code 1A} FALSE, {[}
{code 1B} FALSE, {]}
{code 1C} FALSE, {Enter}
{code 1D} FALSE, {Ctrl}
{code 1E} FALSE, {a}
{code 1F} FALSE, {s}
{code 20} FALSE, {d}
{code 21} FALSE, {f}
{code 22} FALSE, {g}
{code 23} FALSE, {h}
{code 24} FALSE, {j}
{code 25} FALSE, {k}
{code 26} FALSE, {l}
{code 27} FALSE, {;}
{code 28} FALSE, {'}
{code 29} FALSE, {`}
{code 2A} FALSE, {shift}
{code 2B} FALSE, {\}
{code 2C} FALSE, {z}
{code 2D} FALSE, {x}
{code 2E} FALSE, {c}
{code 2F} FALSE, {v}
{code 30} FALSE, {b}
{code 31} FALSE, {n}
{code 32} FALSE, {m}
{code 33} FALSE, {,}
{code 34} FALSE, {.}
{code 35} FALSE, {/}
{code 36} FALSE,
{code 37} FALSE, {Gray *}
{code 38} FALSE, {Alt}
{code 39} FALSE, {Space}
{code 3A} FALSE, {Caps Lock}
{code 3B} FALSE, {F1}
{code 3C} FALSE, {F2}
{code 3D} FALSE, {F3}
{code 3E} FALSE, {F4}
{code 3F} FALSE, {F5}
{code 40} FALSE, {F6}
{code 41} FALSE, {F7}
{code 42} FALSE, {F8}
{code 43} FALSE, {F9}
{code 44} FALSE, {F10}
{code 45} FALSE, {Num Lock}
{code 46} FALSE, {Scroll Lock}
{code 47} FALSE, {White Home}
{code 48} FALSE, {White Up Arrow}
{code 49} FALSE, {White PgUp}
{code 4A} FALSE, {Gray -}
{code 4B} FALSE, {White Left Arrow}
{code 4C} FALSE, {Center Key (5)}
{code 4D} FALSE, {White Right Arrow}
{code 4E} FALSE, {Gray +}
{code 4F} FALSE, {White End}
{code 50} FALSE, {White Down Arrow}
{code 51} FALSE, {White PgDn}
{code 52} FALSE, {White Ins}
{code 53} FALSE, {White Del}
{code 54} FALSE, {Sys Req}
{code 55} FALSE,
{code 56} FALSE,
{code 57} FALSE,
{code 58} FALSE,
{code 59} FALSE,
{code 5A} FALSE,
{code 5B} FALSE,
{code 5C} FALSE,
{code 5D} FALSE,
{code 5E} FALSE,
{code 5F} FALSE,
{code 60} FALSE,
{code 61} FALSE,
{code 62} FALSE,
{code 63} FALSE,
{code 64} FALSE,
{code 65} FALSE,
{code 66} FALSE,
{code 67} FALSE,
{code 68} FALSE,
{code 69} FALSE,
{code 6A} FALSE,
{code 6B} FALSE,
{code 6C} FALSE,
{code 6D} FALSE,
{code 6E} FALSE,
{code 6F} FALSE,
{code 70} FALSE,
{code 71} FALSE,
{code 72} FALSE,
{code 73} FALSE,
{code 74} FALSE,
{code 75} FALSE,
{code 76} FALSE,
{code 77} FALSE,
{code 78} FALSE,
{code 79} FALSE,
{code 7A} FALSE,
{code 7B} FALSE,
{code 7C} FALSE,
{code 7D} FALSE,
{code 7E} FALSE,
{code 7F} FALSE
);
AsciiScanCode : Array [1..127] of byte =
(
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$00,
$39, { }
$02, {!}
$28, {"}
$04, {#}
$05, { $}
$06, {%}
$08, {&}
$28, {'}
$0A, {(}
$0B, {)}
$37, {*}
$4E, {+}
$33, {,}
$4A, {-}
$34, {.}
$35, {/}
$0B, {0}
$02, {1}
$03, {2}
$04, {3}
$05, {4}
$06, {5}
$07, {6}
$08, {7}
$09, {8}
$0A, {9}
$27, {:}
$27, {;}
$33, {<}
$0D, {=}
$34, {>}
$35, {?}
$03, {@}
$1E, {A}
$30, {B}
$2E, {C}
$20, {D}
$12, {E}
$21, {F}
$22, {G}
$23, {H}
$17, {I}
$24, {J}
$25, {K}
$26, {L}
$32, {M}
$31, {N}
$18, {O}
$19, {P}
$10, {Q}
$13, {R}
$1F, {S}
$14, {T}
$16, {U}
$2F, {V}
$11, {W}
$2D, {X}
$15, {Y}
$2C, {Z}
$1A, {[}
$2B, {\}
$1B, {]}
$07, {^}
$0C, {_}
$29, {`}
$1E, {a}
$30, {b}
$2E, {c}
$20, {d}
$12, {e}
$21, {f}
$22, {g}
$23, {h}
$17, {i}
$24, {j}
$25, {k}
$26, {l}
$32, {m}
$31, {n}
$18, {o}
$19, {p}
$10, {q}
$13, {r}
$1F, {s}
$14, {t}
$16, {u}
$2F, {v}
$11, {w}
$2D, {x}
$15, {y}
$2C, {z}
$1A, {left curly }
$2B, {|}
$1B, {right curly }
$29, {~}
$00 { }
);
{*------------------------------------------------------------------------*
| Keyboard mouse and Microsoft Mouse constants |
*------------------------------------------------------------------------*}
kbcode : Word = 0;
kbcode_striped : Word = 0;
kbmouse_On : Boolean = TRUE; {turns on keyboard mouse}
KB_ShftYSteps : Word = 1;
KB_ShftXSteps : Word = 2;
KB_XSteps : Word = 12;
KB_YSteps : Word = 8;
BIOS_Data = $40;
KeyCodeChainBusy : boolean = false;
KeyCodeChain : KeyRecPtr = NIL;
TimeCodeChain : TimeRecPtr = NIL;
VAR
Mouse_Installed : Boolean;
{*------------------------------------------------------------------------*
| Mouse Cursor Routines |
*------------------------------------------------------------------------*}
function MiddleDoubleClick : boolean;
function LeftDoubleClick : boolean;
function RightDoubleClick : boolean;
Procedure SetMouseSensitivity(x_sense,y_sense,threshold:Word);
Procedure GetMouseSensitivity(VAR x_sense,y_sense,threshold:Word);
Procedure SetMouseMinMax(MinX,MinY,MaxX,MaxY:Word);
Procedure ShowMouse;
Procedure HideMouse;
Procedure SetMousePosition(mousex,mousey:Word);
Procedure SetMousePos(xpos,ypos:Word);
Procedure CursorShape(var Shape);
Procedure SetMouseMask(var Shape; x,y:word);
Function MousePosition(VAR MouseX,MouseY : Word) : Word;
Procedure SetMouseHotSpot(x,y:Word);
Procedure SetMouseColor(Color : Word);
Procedure SetKeyBoardMouse(ON_OFF : Boolean);
Procedure SetKBSteps(xsteps,ysteps,sfxsteps,sfysteps:Word);
Procedure GetKBSteps(VAR xsteps,ysteps,sfxsteps,sfysteps:Word);
Procedure GetButtonReleaseInfo(button:Word; VAR ButtonStat,ButtonRelease,xpos,ypos:Word);
Procedure GetButtonPressInfo(button:Word; VAR ButtonStat,ButtonPresses,xpos,ypos:Word);
Procedure ClearButtonInfo;
Procedure FrozenMouse;
Function FreezeMouse(x,y,x1,y1:Word):Boolean;
Procedure UnFreezeMouse(mshow:Boolean);
Procedure SwapTimerOut;
Procedure SwapTimerIn;
Procedure SetTimerStart(VAR timepiece:timerecptr; timeset:Word);
Procedure SetTimerCallProcStart(VAR timepiece:timerecptr; timeset:Word; timercallproc:FuncCallProc);
Procedure ResetTimerFlag(timepiece:timerecptr);
Procedure DropTimerCount(timepiece:timerecptr);
Procedure TimerSwitch(onoff:Boolean);
Function NilTimeCallProc:Boolean;
Procedure SwapTEGLIntrOff;
Procedure SwapTEGLIntrOn;
Function TEGLReadkey : Word;
Function TEGLKeyPressed : Boolean;
Procedure AddCaptureKey(keycode:Word;Repeatkey:Boolean; keycall:FuncCallProc);
Procedure DeleteCaptureKey(keycode:Word);
Function Key(shiftbits,keycode:Byte):Word;
Function NilKeyCallProc:Boolean;
Procedure SetShiftKeys(shiftflag:Byte; onoff:Boolean);
procedure TxtCursorPos(x1,y1 : word);
procedure TxtCursorOn;
procedure TxtCursorOff;
procedure TxtCursorStop;
procedure TxtCursorInit(x1,y1,x2,y2,blinktime,color:word; iconcursor:pointer);
Function TxtCursorBlink:Boolean;
procedure TxtCursorResume;
procedure TxtCursorFreeze;
Procedure Init_TEGLIntr;
IMPLEMENTATION