C
C#3y ago
tornixdev

Hotkey system

trying to make a hotkey system, i'm not sure how to get the user's key input after a click of a button
6 Replies
Klarth
Klarth3y ago
What UI framework?
tornixdev
tornixdevOP3y ago
Klarth
Klarth3y ago
Oops, sorry. So WinForms doesn't really have event bubbling. The approaches I can think of: 1. subscribe all controls to your keyboard event or 2. reset the focus to some main control instead of letting (ie. your Button) maintain focus after being clicked. There are global hotkeys that work for out-of-app, keyboard accelerators, etc that might play more nicely depending on what you're doing.
tornixdev
tornixdevOP3y ago
I was able to achieve what I wanted using this:
Klarth
Klarth3y ago
Yeah, that's dipping into win32api. But it is a relatively simple solution otherwise.
tornixdev
tornixdevOP3y ago
yep alright i'll close the post now, thanks for the help
Want results from more Discord servers?
Add your server