Category : Word Processors
Archive   : HP22D5.ZIP
Filename : KEYHOOK.C

 
Output of file : KEYHOOK.C contained in archive : HP22D5.ZIP
#include

#include "extern.h" /* Extensions need these! */

/*
** This keyboard hook filters all alphabetic characters, passing only
** the upper case equivalents.
**
** Keyboard hooks must save the DS register.
*/
WORD _loadds trap(WORD KeyWord)

{
WORD w;

w = KeyWord & 0x00FF; /* w = ASCII code */

if (w) {
if (isalpha(w)) return((KeyWord & 0xFF00) | toupper(w));
}

return(KeyWord);
}

startHook()

{
SetKeyHook(trap);
return(STOP);
}

stopHook()

{
SetKeyHook(NULL);
return(STOP);
}

/*
** Remove the keyboard hook when the extension is removed from memory.
*/
pascal far WhenUnLoaded()

{
stopHook();
}

POOL pascal Pool[] = {

{ "startHook",
startHook,
0,
HANDLER},

{ "stopHook",
stopHook,
0,
HANDLER},

{ NULL, /* NULLs signify the end of the table */
NULL,
0,
0} };


  3 Responses to “Category : Word Processors
Archive   : HP22D5.ZIP
Filename : KEYHOOK.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/