VB.Net How to get keyboard input and set a variable? -


so i'm wanting have button, says 'click here set bind' when click it, says 'press key' , when uses presses key, sets variable value/enum of key. e.g if push lmb set 1, capslock 20, etc...

i've been unable find helps online. hoping perhaps here provide help. thanks.

you can create event on form listen user key down this:

protected overrides sub onkeydown(byval e keyeventargs)     mybase.onkeydown(e)      if (e.keycode = keys.capslock)         ' thing ...         dim value = 20     elseif (e.keycode = keys.control)         dim value = 6     end if  end sub 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -