看板 C_and_CPP 關於我們 聯絡資訊
( *[1m *[m 為色碼,可以按 Ctrl+V 預覽會顯示的顏色 ) ( 未必需要依照此格式,文章條理清楚即可 ) 遇到的問題: (題意請描述清楚) 目前寫程式執行某軟體後,該軟體需按多次"Enter",才有辦法使執行結果更為精確。 平台是Dev C++ 想問有沒有什麼函數或方法可以直接對鍵盤下press "Enter"鍵的指令? 感謝<(_ _)> -- "Hey, coach, let me play, let me play it out, please, please, look, I swear, look... if I need one (break), I swear I'll come out, seriously look, please let me go, I swear, if I need one I'll take myself out, please just let me go in..." Chris Paul -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.118.109.216
james732:按鍵精靈 XDDD 09/11 16:40
hhashoww:樓上說的是 keypress(13) 這個嗎XD? 09/11 17:07
PaulChris:不能使用按鍵精靈啊大哥…= =,希望是以程式去下指令… 09/11 18:27
uranusjr:http://tinyurl.com/ybo4qqh 上網查一下不難吧... 09/11 18:31
PaulChris:感謝樓上,因為之前都是往批次檔的方向去找,所以... 09/11 18:39
herman602:可是那連結的是C++/CLI耶 原PO的平台是Dev C++ ... 09/11 19:28
flydragon198:之前也是想要用C++去控制鍵盤,結果很複雜的樣子@@ 09/11 20:50
PaulChris:剛剛有稍微看一下,感覺不同 囧 09/11 20:56
tinlans:用程式去控制按鍵精靈。 09/11 21:33
loveme00835: t 大這招比較難喔! XDD 09/11 21:34
suhorng:用程式控制按鍵去控制按鍵精靈來按按鍵(誤) 09/11 21:41
herman602:http://0rz.tw/Tr85o 09/11 22:18
ljhgc:keybd_event(0xd,0, 0, 0); 09/12 01:56
ljhgc:keybd_event(VK_CONTROL, 0, 0, 0); 09/12 01:59
ljhgc:keybd_event(VK_SHIFT,0, dwFlags, 0); 09/12 01:59
ljhgc:keybd_event(VK_SHIFT,0, 0, 0); 09/12 01:59
ljhgc:keybd_event(VK_MENU,0, 0, 0); 這是ALT 09/12 02:00
ljhgc:0xd是ENTER,以上是"按下",用完記得放開...像這樣 09/12 02:02
ljhgc:keybd_event(VK_SHIFT,0, KEYEVENTF_KEYUP, 0); 09/12 02:03
winest:hook 09/12 11:27
ab4daa:windows api SendInput 09/12 12:33
※ 編輯: PaulChris 來自: 218.167.76.122 (09/15 01:18)
PaulChris:謝謝各位,問題解決了^^ 09/15 01:19