2012-10-06 57 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 & "/"