How to?

  • Thread starter Thread starter Jacek Jurkowski
  • Start date Start date
J

Jacek Jurkowski

retrieve a Char representing a key value f.e.
Keys.Control?

I must place some keyboard Char into a
keyboard buffer on button click.
 
Hi Jacek,

In the KeyDown event, you could use

char c = (char)e.KeyValue;

but it would not reflect upper or lowercase characters. You may be able
to get casing by testing for Shift, but I'm not sure if you need to to
further testing to get an acceptable result.

char c = (char)e.KeyValue;
if (!e.Shift)
c = Char.ToLower(c);
 
The problem is that no key is pressed.
The BUTTON is pressed and in it's
Click methood I must raise some event...

Button1.Tag = Keys.Space;

Button1.Click += delegate
{
if(KeyboardKeyPress != null)
{
Keys key = (Keys)Button1.Tag
KeyboardKeyPress(new KeyPressEventArgs(this,?));
}
}

How to parse Keys enum item to Char?
I'm trying to develop an keyborad like thouse
on PDA.
 
Back
Top