简体   繁体   English

如何判断Windows Mobile 6.5(c ++)中何时按下了键

[英]How to tell when a key is pressed in Windows Mobile 6.5 (c++)

I am writing a windows mobile application and would like to be able to respond to key presses from the user. 我正在编写Windows Mobile应用程序,希望能够响应用户的按键操作。 There are points in the app where I would like to wait for a keypress to continue. 应用程序中有些地方我想等待按键继续。 ex. 例如

"Press any key to continue..." “按任意键继续...”

How could I achieve that in c++? 如何在C ++中实现呢? I was thinking something like: 我在想类似的东西:

MessageBox("Press any key to continue...");

while(isntPressed){
    if(a key is pressed){
        isntPressed=false;
    }
}

Thank you in advance 先感谢您

Have you looked at this link: 您是否看过此链接:

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keydown(v=vs.80).aspx http://msdn.microsoft.com/zh-cn/library/system.windows.forms.control.keydown(v=vs.80).aspx

You can use the KeyPress or KeyDown events. 您可以使用KeyPressKeyDown事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM