![]() |
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-09-15 01:49 |
47,812 topics / 349,917 posts / today 0 new / 48,268 members |
| DOS开发编程 & 发展交流 (开发室) » Question for the experts! |
| Printable Version 1,334 / 0 |
| Floor1 Loff | Posted 2003-07-23 00:00 |
| 中级用户 Posts 59 Credits 286 | |
|
How can I distinguish/control the left and right Alt keys and the left and right Ctrl keys in C/C++? I'm writing a typing practice program and want to implement an animated keyboard, that is, when I press a key on the real keyboard, the corresponding key on the keyboard on screen also sinks down, and when I release it, it pops back up too. I have already implemented all keys in the main keyboard area except Alt and Ctrl, but the left and right Ctrl and Alt seem to have the same code. I'd appreciate guidance from an expert.
This is the function I use to get the key code: (using Turbo C 2.0 or Turbo C++ 3.0) int sckey() { union REGS r; unsigned char KEY_CODE=0; KEY_CODE=inportb(0x60); r.h.ah=0x0c; int86(0x21,&r,&r); return KEY_CODE; } |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |