C# SendKeys.Send

前端 未结 9 1291
闹比i
闹比i 2021-01-13 01:17

I am running on an issue using C# SendKeys.Send method. I am trying to replace keyboard keys with other keys, for example when I press \"a\" in keyboard I want that key to b

9条回答
  •  终归单人心
    2021-01-13 01:47

    I get "a" printed because backspace is sent immediately after "s" and it deletes the "s" character. How can I prevent this from happening?

    uhm.....

    don't send backspace immediately after sending s?

    if ((Keys)keyCode== Keys.A)
                {
                    Sendkeys.Send("{BS}"); // Deletes the "A" (already sent)
                    SendKeys.Send("s"); // Sends the "S"
                }
    

提交回复
热议问题