while true
{
if (checkBox1.Checked & KKEY == "CapsLock")
{
if (sim.InputDeviceState.IsKeyDown(VirtualKeyCode.CAPITAL))
{
(Send something)
Thread.Sleep(100);
}
}
}
I want to know how can I send something only one time in this code.
I tried to delay the sends with thread.sleep
because when I press the key it sends multiple times but I want only to send something 1 time per key click.
I tried to break but that cut the if and it only send the key one time and then never send it again.
Is there any way to do what I want to do? Thanks!
Edit: I forgot to put the while sorry.
Holding the key should be one click and when is pressed again i need the send something again.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…