书法字典:https://www.shufadict.com

随笔分类 -  DirectInput

防止Direct Input获取多次输入
摘要:如果将Direct input处理键盘输入的函数放到游戏循环中,由于Direct Input速度极快,用户的一次按键,Direct Input将会产生多次按键事件,导致程序多次被响应,处理如下。char hitLetter = '';static bool keyPressed = false;if(dinput_->getKey()){ if(!keyPressed) { hitLetter = dinput_->getKey(); keyPressed = true; }}else{ keyPressed = false;}关键在于key... 阅读全文

posted @ 2013-02-27 10:49 翰墨小生 阅读(1545) 评论(2) 推荐(1) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
书法字典:https://www.shufadict.com
点击右上角即可分享
微信分享提示