home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------*/
- /* ╡{ªí└╔ªW║┘: wat18.c */
- /*------------------------------------------------------------------*/
- #include <stdio.h>
- #include <bios.h>
- #include <ctype.h>
-
- #define SCROLL 0x10
- #define NUMLOCK 0x20
- #define CAPS 0x40
- #define INS 0x80
-
- void main()
- {
- unsigned key_state, modifiers;
- key_state = _bios_keybrd(_KEYBRD_READ);
- modifiers = _bios_keybrd(_KEYBRD_SHIFTSTATUS);
- if(modifiers)
- {
- printf("\n[ ");
- if(modifiers & SCROLL) printf("SCROLL LOCK ┴Σ ");
- if(modifiers & NUMLOCK) printf("NUM LOCK ┴Σ ");
- if(modifiers & CAPS) printf("CAPS LOCK ┴Σ ");
- if(modifiers & INS) printf("INSERT ┴Σ ");
- printf("]\n");
- }
- if(isalnum(key_state & 0xFF))
- printf("'%c'\n",key_state);
- else
- printf("%#02x\n",key_state);
- }
-