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 -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -