keyboard converter

  • Thread starter Thread starter cwineman
  • Start date Start date
C

cwineman

I am working on a form that receives keyboard events. Upon an event you know
what key was pressed, and you know whether or not the ALT,CTRL, or SHIFT
keys were being held down.

I was wondering if there was a class that would figure out the difference
between say, a "B" versus "b" or a "3" versus a "#" being pressed. It
wouldn't be that hard to do it myself, but I thought that .NET might already
have something.

There is a KeysConverter class and that might be what I am looking for. But
I couldn't figure out how to use it. The documentation was useless and a
Google search didn't help me out either.

Anyone know if KeysConverter is the class I want to use? Got any examples?

-cwineman
 
I believe KeysConverter is used to convert a Keys enum value to and from a
string value.
Its used by the graphical editors.

Dont know Im afraid, Im guessing you have to consume KeyPressed as well
which gives you a properly formated char, either that or just assume english
keyboard and handle the logic yourself.

You wouldnt happen to know how to tell if shift (and only shift) is being
pressed btw? I take it you can only tell from when other keys are being
pressed from the shift flag on keypress, but if not..

/Dan
 
Back
Top