更改键盘琴键 [英] changing keyboard keys
本文介绍了更改键盘琴键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我正在编写程序,我需要更改不同密钥发送给计算机的消息
例如,当有人按下"k"时,我希望那台计算机认为我按下"q",我该怎么做?我使用钩子和输入,但无法在C ++中获得结果.win32
解决方案
您可以指定一个转换表,如下所示:
char temp = readkey();
字符结果;
if(temp =="k")result = q;
您可以挂钩到Windows Message Queue中检查WM_KEYXYZ并处理消息.
做这样的事没有太大意义,但是有可能;)
问候
使用替换方法.
Console.Write(Console.ReadLine().Replace(' k',' q')));
>
Hi
i am writing a program i need to change the messages that different keys send computer
for example when someone pressed ''k'' i want that computer think that i pressed ''q'' how can i do it i worked with hook and input but i couldnt get results in C++ win32
解决方案
You could specify a conversion table like this:
char temp = readkey();
char result;
if (temp == "k") result = q;
You can hook into Windows Message Queue check for WM_KEYXYZ and manipulate the message.
It makes no big sense to do something like this but it is possible ;)
Regards
Use Replace method.
Console.Write(Console.ReadLine().Replace('k', 'q'));
这篇关于更改键盘琴键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文