Answer the question
In order to leave comments, you need to log in
How to make a key binding?
What I want to convey
I am writing a key binding script, which will start the macro
How to make such a key binding and it is mandatory that in a Windows Form? the binding process should take place when the user clicks on the button1 button, that is, in the button1_Click method.
What I tried:
1. make a truncated similarity of a keylogger, but there was more information on console applications and on the C ++ language
2. this article from stackoverflow
but did not understand what stands for
private void MainForm_Load(object sender, EventArgs e)
{
hook.KeyDown += (s, ev) => {
// Так или иначе свернём приложение и т.д.,
// при необходимости можно проверить, какая именно кнопка была нажата
};
System.InvalidOperationException: "Unable to read keys when any application does not have a console or console input was redirected from a file. Try using Console.Read."
private void Form1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
listBox1.Items.Add(e.KeyCode);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question