自动点击器发送击键 [英] Auto clicker to send keystrokes
问题描述
你好,
我正在为一些朋友设置一个小型自动点击器来发送礼物。 不时地出现一个小弹出窗口并按下"输入"按钮。它点击"发送"。
I'm setting up a little auto clicker for some friends for a game to send gifts. Now and again theres a little popup that comes up and by pressing "enter" it clicks "send".
我所拥有的是以下内容:
What I have is the following:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If ComboBox1.Text = 2 Or 3 Or 4 Or 5 Then Timer1.Start()
My.Computer.Keyboard.SendKeys("{ENTER}")
Button1.BackColor = Color.Red
Button2.Enabled = True
End Sub
但是,"点击"按钮工作正常,但它不会发送或重复"Sendkeys"对于Enter按钮..
However, the "clicking" works fine, but it won't send or repeat the "Sendkeys" for the Enter button..
我要做的是:
设置计时器,按开始,单击(等待几秒钟)输入,,点击 (等待几秒钟)输入等等(直到按下停止按钮或按下热键)
Set timer, press start, click (wait a few seconds) enter,, click (wait a few seconds) enter,, etc. (until stop button is pressed or hotkey is pressed)
但是它在做什么是:
点击,点击,点击,点击(按键不会发送)
click, click, click, click (keystroke won't send)
我怎样才能得到"击键"用点击重复直到"停止"单击?
How can I get the "keystroke" to repeat with the click until "stop" is clicked?
此外,是否可以使用热键启动和停止程序/窗口失焦?
Also, Is it possible to use hotkeys to start and stop with program/window being out of focus?
推荐答案
您好,
Hello,
我'为某些朋友设置一个小型自动点击器,让游戏送礼物。 不时地出现一个小弹出窗口并按下"输入"按钮。它点击"发送"。
I'm setting up a little auto clicker for some friends for a game to send gifts. Now and again theres a little popup that comes up and by pressing "enter" it clicks "send".
我所拥有的是以下内容:
What I have is the following:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If ComboBox1.Text = 2 Or 3 Or 4 Or 5 Then Timer1.Start()
My.Computer.Keyboard.SendKeys("{ENTER}")
Button1.BackColor = Color.Red
Button2.Enabled = True
End Sub
然而,"点击"工作正常,但它不会发送或重复"Sendkeys"对于Enter按钮..
However, the "clicking" works fine, but it won't send or repeat the "Sendkeys" for the Enter button..
我要做的是:
设置计时器,按开始,单击,,输入,,单击,,输入,,等等(直到按下停止按钮或按下热键)
Set timer, press start, click,, enter,, click,, enter,, etc. (until stop button is pressed or hotkey is pressed)
但它的作用是:
点击,点击,点击,点击(按键不会发送)
click, click, click, click (keystroke won't send)
如何获得"按键"?用点击重复直到"停止"单击?
How can I get the "keystroke" to repeat with the click until "stop" is clicked?
此外,是否可以使用热键启动和停止程序/窗口失焦?
Also, Is it possible to use hotkeys to start and stop with program/window being out of focus?
我很确定计时器永远不会启动 - 在tick事件处理程序上放置一个断点并查看它是否输入。
I'm pretty sure the timer never starts - put a breakpoint on the tick event handler and see if it is entered.
这行代码几乎没有机会运行:
There is almost no chance that this line of code works:
如果ComboBox1.Text = 2或3或4或5然后Timer1.Start()
If ComboBox1.Text = 2 Or 3 Or 4 Or 5 Then Timer1.Start()
这将解析为:
如果ComboBox1.Text = 7
If ComboBox1.Text = 7
然后将从整数到字符串进行隐式转换。
Which will then do the implicit conversion from integer to string.
这篇关于自动点击器发送击键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!