Link to home
Start Free TrialLog in
Avatar of P1ST0LPETE
P1ST0LPETEFlag for United States of America

asked on

Capture Multiple key press in C#

Hi all,
I have a "secret" windows form that I want to load when multiple keys are pressed at the same time.  How can I do this is C#, starting from my main form?
Thanks
ASKER CERTIFIED SOLUTION
Avatar of pivar
pivar
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of P1ST0LPETE

ASKER

pivar:
Your solution looks similar to what I was trying to work with already when I got stuck.  I have another question for clarification though. In the IF statement "if(keys == yourkeycombination)", what exactly do I put in for "yourkeycombination"?  The key combination I'm going for is: SHIFT + 5 letter keys.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm fine with pressing the keys in the correct order, however I'm not getting it to work.  The "S" key, which is one of the 5 letters is not working.  If I replace the "S" with another letter, then it works, but with the S in it, it won't fire.  Obviously the "S" on my keyboard is working or I wouldn't be able to type them out in this sentence.  I even tried putting a conditional breakpoint on the methed to try and catch the S, and it's not working either.  What's the deal with the "S" key?  Does it hold a special hex falue similar to the shift key?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well I was using the name of the company I work for which ends in an S, but I fine with not using it.  I'll just play around with it until I find a combo that I like and the system accepts.  I've got a good understanding of how it woks though now, so I should be good, thanks for the help.
Thanks for all the help pivar.
Also thanks Idle Mind for the extra info.