paul@aucs.UUCP (08/11/87)
There is a feature of MS-DOS that I want to disable. When the ALT key is held down while digits on the numeric pad are pressed, the corresponding ascii character is generated. I do not want this to happen; I want a BIOS scancode for the key combination pressed. If anybody out there knows how this can be done (without going to the interrupt level), please drop me a note. Thanks. Paul H. Steele UUCP: {uunet|watmath|utai|garfield}!dalcs!aucs!Paul Acadia University BITNET: Paul@Acadia Wolfville, NS Internet: Paul%Acadia.BITNET@WISCVM.WISC.EDU CANADA B0P 1X0 PHONEnet: (902) 542-2201x587
jvc@mirror.UUCP (08/13/87)
/* Written 8:39 am Aug 11, 1987 by paul@aucs.UUCP in comp.sys.ibm.pc */ /* ---------- "DOS keyboard feature?" ---------- */ >There is a feature of MS-DOS that I want to disable. When the ALT key >is held down while digits on the numeric pad are pressed, the corresponding >ascii character is generated. I do not want this to happen; I want a BIOS >scancode for the key combination pressed. If anybody out there knows how >this can be done (without going to the interrupt level), please drop me >a note. Thanks. > >Paul H. Steele UUCP: {uunet|watmath|utai|garfield}!dalcs!aucs!Paul This can't be done. The problem is that the ascii code has no direct relationship to a single key. Although each key has a unique scan code, several scan codes can be mapped to the same ascii character. For example, the keypad keys ( . - + 0 1 2 3 4 5 6 7 8 9 0 ) generate the same ascii character as the keyboard keys of the same label but they generate different scan codes. However, it is possible to get the scan code of the key used to generate the ascii character that is in the buffer (unless it was generated with the ALT nnn sequence). If you use INT 16 (keyboard I/O) to read the next char from the keyboard buffer, the ascii code is returned in AL and the scan code is returned in AH (see the DOS technical reference). Ascii characters generated by the ALT nnn sequence will have a scan code of 0 (scan codes on a XT range from 1 to 83. See the DOS technical reference). The function keys return 0 as the ascii code. ------------------------------------------------------------------------- Jim Champeaux jvc@mirror.TMC.COM {mit-eddie, ihnp4, wjh12, cca, cbosgd, seismo}!mirror!jvc Mirror Systems, 2067 Massachusetts Avenue, Cambridge, MA 02140 Telephone: (617) 661-0777