Calling TSRs from Turbo-Pascal 
Author Message
 Calling TSRs from Turbo-Pascal

Hi, all,

I need help:
I need to call a TSR from within a TP-program (in DOS or WIN 3.1). The
HOTKEY-combination to invoke the TSR is "ALT-Backspace". This combination
does neither produce a keycode nor a scancode, setting the keyboard status
bit and writing to the keyboard buffer does not have an effect. What shall
I try next ?

Any suggestions are much appreciated !

Joerg,




Wed, 18 Jun 1902 08:00:00 GMT  
 Calling TSRs from Turbo-Pascal
In comp.lang.Pascal.borland, J?rg Hedtmann uttered:

Quote:
>I need to call a TSR from within a TP-program (in DOS or WIN 3.1). The
>HOTKEY-combination to invoke the TSR is "ALT-Backspace". This combination
>does neither produce a keycode nor a scancode, setting the keyboard status
>bit and writing to the keyboard buffer does not have an effect. What shall
>I try next ?

You need to write to the buffer using the Interrupt $16 function $05.
Alt-Backspace is $0,$0E but it only works with when BIOS *and* program
support enhanced keyboard reading using int $16 and function $10
(readkey for enhanced keyboard).

Is the TSR your own and how are you reading the KeyBoard - Readkey does
not support enhanced keystrokes as it uses the older functions.

Pascal source only for the benefit of those with older compilers:

Procedure WriteExtKeyb(extcode:char);
var r:registers;
begin
     inline($fa);
     r.ah := $05;
     r.ch := ord(extcode);
     r.cl := 0;
     Intr($16,r);
     inline($fb);
end;

In your case call with: WriteExtKeyb(chr(14));
--
Pedt Scragg

No-one is completely useless, they can always be a bad example.



Wed, 18 Jun 1902 08:00:00 GMT  
 Calling TSRs from Turbo-Pascal
Sorry, but this isn't possible on most kb's and most TSR's.

The TSR seems to hook INT 09 (IRQ1) which is called after each kb event.
If the scancode for Alt = PORT[$60], AltPressed := True;
If 128 + the scancode for Alt = PORT[$60], AltPressed := False;
If the scancode for BkSp = PORT[$60], BkPressed := True;
If 128 + the scancode for BkSp = PORT[$60], BkPressed := False;
If AltPressed AND BkPressed AND NOT TSRRunning then begin
        AltPressed := false;
        BkPressed := false;
        TSRRunning := true;
        RunTSR;
        TSRRunning := false
end;

BUT:

There are some TSR's which may be detected AND activated by other programs.
Those hook another INT (which you can see even with MSD; normally INT 10,
21, 2F, 33) which at least two functions: Installation Check and Call
function.



Quote:
> Hi, all,

> I need help:
> I need to call a TSR from within a TP-program (in DOS or WIN 3.1). The
> HOTKEY-combination to invoke the TSR is "ALT-Backspace". This combination
> does neither produce a keycode nor a scancode, setting the keyboard
status
> bit and writing to the keyboard buffer does not have an effect. What
shall
> I try next ?

> Any suggestions are much appreciated !

> Joerg,





Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Overlays in TSRs in Turbo Pascal

2. TSRs from Turbo Pascal

3. External program call from TURBO PASCAL ??

4. External program call from TURBO PASCAL ??

5. Calling "C LIB" from Turbo Pascal

6. calling Turbo Pascal functions from Borland C++ builder

7. LOOKING FOR A PROGRAM CALLED NIM for turbo pascal

8. VBX in Delphi DLL called from Turbo Pascal Win 1.5

9. Calling C functions from Turbo Pascal?

10. Calling C func in Turbo PASCAL?????

11. Unloading pascal TSRs

12. TSRs in Pascal

 

 
Powered by phpBB® Forum Software