![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-18 16:23 |
47,814 topics / 349,908 posts / today 1 new / 48,259 members |
| DOS疑难解答 & 问题讨论 (解答室) » How to automatically turn on CapsLock in DOS |
| Printable Version 1,728 / 7 |
| Floor1 hudisk | Posted 2006-12-11 22:11 |
| 初级用户 Posts 13 Credits 34 | |
|
How to automatically turn on Caps Lock in DOS? Num Lock can be configured in config.sys
|
|
| Floor2 redtek | Posted 2006-12-12 21:30 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
The following post has the tool you need (this tool is only a few KB in size), which is to turn on the caps lock state and turn off the caps lock state.
(The tool can be downloaded on the 9th floor of the following post) (It also contains the source code) (Tested under MS-DOS 6.22 version) Turn on the caps lock key when starting http://www.cn-dos.net/forum/viewthread.php?tid=23973&fpage=1&highlight=%E5%A4%A7%E5%86%99 |
|
| Floor3 houfujin | Posted 2006-12-29 11:12 |
| 新手上路 Posts 8 Credits 16 | |
|
I wrote a program with QuickBASIC to control the on and off of the keyboard indicators.
|
|
| Floor4 hebecoco | Posted 2007-01-02 23:36 |
| 初级用户 Posts 25 Credits 63 | |
|
40:17 byte Keyboard flag byte 0 (see KB FLAGS)
|7|6|5|4|3|2|1|0| keyboard flag byte 0 | | | | | | | `--- right shift key depressed | | | | | | `---- left shift key depressed | | | | | `----- CTRL key depressed | | | | `------ ALT key depressed | | | `------- scroll-lock is active | | `-------- num-lock is active | `--------- caps-lock is active `---------- insert is active You can just use pokeb(0x40,0x17,0x40) |
|
| Floor5 tantan2010 | Posted 2007-01-05 10:38 |
| 新手上路 Posts 4 Credits 6 | |
| Floor6 lxmxn | Posted 2007-01-06 13:46 |
| 版主 Posts 4,938 Credits 11,386 | |
Originally posted by hebecoco at 2007-1-2 10:36: How to use this? |
|
| Floor7 redtek | Posted 2007-01-06 22:52 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
At memory address 0040:0017, there is a byte that represents the current key state. This byte uses binary 1 or 0 to indicate the keyboard state.
0 means no on state, and 1 means on lock state. If a key as shown in the information from Brother hebecoco on floor 4 is pressed, the shown address 0040:0017 will be rewritten by the interrupt routine to indicate the current key state. Experiment:
So finally use Debug E 40:17 40 (Invalid under Windows CMD, valid under MS-DOS) This command can directly rewrite the keyboard representation state of the byte at memory address 0040:0017. And set the keyboard to the uppercase lock state: the 6th bit of the binary is 1, indicating the on function, then 01000000 in hexadecimal (for easy reading) is 40, so fill 40 into that memory address~:) Brother hebecoco on floor 4 gave "pokeb(0x40.0x17,0x40)" which is the operation method in high-level languages. According to Brother hebecoco's detailed explanation on floor 4, it can be completed in high-level languages like C that can write and operate memory~:) |
|
| Floor8 lxmxn | Posted 2007-01-07 01:49 |
| 版主 Posts 4,938 Credits 11,386 | |
|
Powerful, learned it. |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |