China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 05:44
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » How do I write a DOS32 keyboard simulated input program with WATCOM C++ View 962 Replies 4
Original Poster Posted 2004-01-06 00:00 ·  中国 浙江 温州 电信
初级用户
Credits 160
Posts 15
Joined 2004-01-06 00:00
22-year member
UID 15000
Gender Male
Status Offline
The following is a DOS 16-bit keyboard simulated input routine, but because DOS32 does not support the pokeb and peek memory functions. Right now I need functions under DOS32 that also have this capability, but I can't convert it to functions supported by WATCOM DOS32. (Note: not WATCOM DOS16)
Experts who understand WATCOM c/c++, please help me out, many thanks.

void keyboard(int choice,char key)
{
int offset,i;
offset=peek(0x40,0x1c);
for(i=0;key!='\x0';i++)
{
if(choice==0)
{
pokeb(0x40,offset,0x00);
pokeb(0x40,offset,key);
}
if(choice!=0)

{
pokeb(0x40,offset,key);
pokeb(0x40,offset+1,0x00);
}
offset=offset+2;
if(offset==0x3e)offset=0x1e;
}
pokeb(0x40,0x1c,offset);
}
Floor 2 Posted 2004-01-09 00:00 ·  中国 浙江 温州 电信
初级用户
Credits 160
Posts 15
Joined 2004-01-06 00:00
22-year member
UID 15000
Gender Male
Status Offline
Could it be that no expert has shown up yet?
Floor 3 Posted 2004-01-10 00:00 ·  中国 广东 深圳 罗湖区 电信
初级用户
Credits 133
Posts 8
Joined 2003-02-04 00:00
23-year member
UID 844
Gender Male
Status Offline
Use assembly to directly drive the speaker port
Floor 4 Posted 2004-02-04 00:00 ·  中国 江苏 南京 联通
初级用户
Credits 140
Posts 18
Joined 2004-02-03 00:00
22-year member
UID 16630
Gender Male
Status Offline
Under the Watcom directory there is an example directory provided by Watcom, and inside it there is a Sample that is exactly what you need. Why didn't you look for it yourself? Strange??
Floor 5 Posted 2004-02-07 00:00 ·  中国 浙江 温州 电信
初级用户
Credits 160
Posts 15
Joined 2004-01-06 00:00
22-year member
UID 15000
Gender Male
Status Offline
How do I write a DOS32 keyboard simulated input program with WATCOM C++
The following is a DOS 16-bit keyboard simulated input routine, but because DOS32 does not support the pokeb and peek memory functions. Right now I need functions under DOS32 that also have this capability, but I can't convert it to functions supported by WATCOM DOS32. (Note: not WATCOM DOS16)
Experts who understand WATCOM c/c++, please help me out, many thanks.

void keyboard(int choice,char key)
{
int offset,i;
offset=peek(0x40,0x1c);
for(i=0;key!='\x0';i++)
{
if(choice==0)
{
pokeb(0x40,offset,0x00);
pokeb(0x40,offset,key);
}
if(choice!=0)

{
pokeb(0x40,offset,key);
pokeb(0x40,offset+1,0x00);
}
offset=offset+2;
if(offset==0x3e)offset=0x1e;
}
pokeb(0x40,0x1c,offset);
}
Forum Jump: