键盘输入缓冲问题

来源:百度知道 编辑:UC知道 时间:2024/06/01 10:44:24
我在编C程序时遇到一个问题:怎样让键盘输入的东西不经过缓冲直接送入内存,比如说在写字板上直接按a不动,a出来的速度非常慢,而游戏时对键盘速度精确要求特别大,如劲乐团, 有什么解决办法呢?
能不能在程序中用什么语句来实现呢?
我用" 打开控制面板双击“键盘”在速度选项卡中拖动“重复延迟”长条。" 试了效果不错,不过让别人玩我编的游戏,还要这么麻烦?
而用函数setbuf(stdin, NULL)好象完全没有作用,问题在哪呢?
有没人知道啊,急待解决啊.

" 打开控制面板双击“键盘”在速度选项卡中拖动“重复延迟”长条。"
又是怎样做到修改键盘缓冲速度的呢?
不是机器或软件的问题,是程序控制I/O设备的问题.

在游戏中,使用DirectInput控件 不仅键盘,还有鼠标、游戏柄,DirectInput都提供支持

在MSDN中,搜索DirectInput,他能够直接访问输入设备。
难道你编游戏不用DirectX吗?????????????

DirectX foundation
1 DirectDraw: Graphics surface management Video-ports, new MMX HEL, AGP
2 DirectSound: Sound mixer and effects 3D HAL, capture, property sets
3 Direct3D: Immediate Mode Low-level 3D display DrawPrimitive, overloads
4 DirectInput: Input device interface New devices, force feedback
5 DirectSetup: Driver installation Improved driver updating, user interface customization

6 DirectX media:
Direct3D Retained Mode 3D scene graph Interpolators, progressive meshes
Microsoft DirectPlay® Multiuser player Connection shortcuts, improved password protection, secure server connections

这个问题在我们学校机房也出现过 把防火墙关了就好了 应该是瑞星的吧 我们学校就是

那应该怎么控制呢?