how to use a string, char and KEYS properly?

  • Thread starter Thread starter Flip
  • Start date Start date
F

Flip

I'm trying to create a form which a user can type out a key, and the
CTRL-ALT-SHIFT keys are recognized (via ModifiedKeys object) and then pass
the letter the user pressed to the windows API method for setting the
hotkey. My problem is that WIN API takes a Keys object/enumeration. I'm a
bit weak on that stuff, so I'm hoping someone can point me in the right
direction? I'm looking for a good link or just out right help, please?

If I have a string or char, how do I get a Keys from it? I'm sure this is a
newbie type of question, sorry.

Thanks for any help.
 
Hi,

Can you retrieve the key from the KeyDown event? there on the parameters you
will find the Key structure filled

Otherwise you can raise the event System.Windows.Forms.KeyPressEventArgs and
pass the char letter, if you handle the event you will receive the Key
structure filled.

Hope this helps
Salva
 
Back
Top