本文介紹了如何在 C++ 中模擬按鍵按下的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我想知道如何在 C++ 中模擬按鍵凹陷.例如,當(dāng)我運(yùn)行程序時(shí),它按下字母W"鍵的代碼.我不想在控制臺(tái)窗口中顯示它,我只想在每次單擊文本字段時(shí)顯示W(wǎng)"鍵.謝謝!
I was wondering how can I simulate a key depression in C++. Such as having code that when I run the program it presses the letter "W" key. I don't want to be displaying it in a console window I just want it to display the "W" key every time I click on a text field. Thanks!
注意:我不是想成為垃圾郵件發(fā)送者.
Note: I am not trying to make a spammer.
推薦答案
您似乎想要使用 SendInput()
或 keybd_event()
(這是做同樣事情的舊方法).
It looks like you want to use either SendInput()
or keybd_event()
(which is an older way of doing the same thing).
這篇關(guān)于如何在 C++ 中模擬按鍵按下的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!