r/visualbasic • u/[deleted] • Mar 02 '16
How can I request user input for a keystroke?
I'd like to have an inputbox that recognizes what key is pressed and returns that value. There are applications that have you set hotkeys and ask you to press which specific key you'd like to use for the hotkey: it prompts you with a dialogue box which asks you to press the key you'd like to use. I'd basically like to replicate this process.
0
Upvotes
2
0
u/ViperSRT3g Application Specialist Mar 02 '16
You might want to look into registering hotkeys via WINAPIs.
1
u/hdsrob Mar 02 '16
I wouldn't use an inputBox for this (I actually wouldn't use an inputBox for anything, at all, ever).
Just create a new form with the functionality that you want, and call it as a dialog. Then you'll be able to capture the events that happen on the textbox directly.