简体   繁体   English

在C ++应用程序中禁用对大写/小写字母的转换功能

[英]disable shift ability to upper/lower case letters in a c++ application

I am making a simulation of an infantry in c++ with Vega Prime. 我正在使用Vega Prime对c ++中的步兵进行仿真。

I use the WASD keys for movement and shift for running. 我使用WASD键进行移动,并使用shift键进行运行。

when I press w and then press shift - when i release w it became a capital W so the event for the release w does't happen (because the shift turn the w to W...). 当我按w键,然后按shift键时-当我释放w键时,它变为大写字母W,因此不会发生释放w的事件(因为将shift键将w转到W ...)。

Now, there is no option to handle the two keys (w and W) because some reason that is not important. 现在,由于某些不重要的原因,无法处理两个键(w和W)。

All I want to do is to disable the SHIFT KEY ability in the application to upper/lower letters. 我要做的就是将应用程序中的SHIFT KEY功能禁用为大写/小写字母。

how can I do that? 我怎样才能做到这一点?

You can convert each character read to uppercase: 您可以将每个字符转换为大写:

#include <cctype>
handleInput(toupper(c))

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

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