2012-10-06 139 views
-2

我正在製作一個程序來提高您的遊戲技能,所以它不是一個黑客程序!Visual Studio遊戲控制器

現在,我被困在一件事上,我需要一種鍵盤記錄器,它會記錄你做了什麼,例如,當你按下空格時,它必須放在一個富文本框中跳轉。 當你點擊鼠標左鍵時,它必須添加Shots Fired到Rich Text Box,然後,當點擊鼠標右鍵時,添加Aiming Down Sights,但是當它釋放時它還應該添加諸如Stopped Aiming Down Sights之類的東西。

+0

[檢測箭頭鍵 - 的KeyDown整個窗口]的可能重複(HTTP:// stackoverflow.com/questions/4378865/detect-arrow-key-keydown-for-the-whole-window) –

+0

當窗體在背景中時,我需要捕捉它,並在其前面運行遊戲,所以不需要真的是重複的 – Pythonator

+0

如果應用程序可以正常工作,您預期用戶如何在前臺應用程序中輸入空間? Youneedtothinkthisthroughabit.Type 「RegisterHotKey」 intheSearchboxattheupperrightofthispage。 –

回答

0

我發現我不得不廣告的代碼,不過,我還沒有foun空格鍵還

If Chr(i) = "(" Then 
txtkeys.Text = txtkeys.Text & "[Arrow Down]" 
ElseIf Chr(i) = "%" Then 
txtkeys.Text = txtkeys.Text & "[Arrow Left]" 
ElseIf Chr(i) = "'" Then 
txtkeys.Text = txtkeys.Text & "[Arrow Right]" 
ElseIf Chr(i) = "&" Then 
txtkeys.Text = txtkeys.Text & "[Arrow up]" 
ElseIf Chr(i) = "" Then 
txtkeys.Text = txtkeys.Text & "[mouse click left]" 
ElseIf Chr(i) = "" Then 
txtkeys.Text = txtkeys.Text & "[mouse click right]" 
ElseIf Chr(i) = "" Then 
txtkeys.Text = txtkeys.Text & "[backspace]" 
ElseIf Chr(i) = "." Then 
txtkeys.Text = txtkeys.Text & "[delete]" 
ElseIf Chr(i) = "" Then 
txtkeys.Text = txtkeys.Text & "[shift]" 
ElseIf Chr(i) = " " Then 
txtkeys.Text = txtkeys.Text & "[tab]" 
ElseIf Chr(i) = "¾" Then 
txtkeys.Text = txtkeys.Text & "." 
ElseIf Chr(i) = "¼" Then 
txtkeys.Text = txtkeys.Text & "," 
ElseIf Chr(i) = "¿" Then 
txtkeys.Text = txtkeys.Text & "/"