Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

c# key sequence

Comments

  • Registered Users, Registered Users 2 Posts: 2,082 ✭✭✭Tobias Greeshman


    The problem with the key combination Ctrl+Pause/Break is that it's a special key combination that get triggered before the KeyDown handler gets access to it. It will terminate/pause a program in execution.

    There is a way to get around this, by means of what is called a Keyboard Hook.

    Have a look at the Win API Function SetWindowsHookEx

    Example: http://delphi.about.com/library/bluc/text/uc063001a.htm


  • Registered Users, Registered Users 2 Posts: 362 ✭✭theone


    Thanks for that

    I'm using it to send a break to a serial device, I could simulate that key sequence by changin the com port settings then simulating the spacebar being held down,but doing it by just simulating the key sequence is a much more efficient way of doing it.

    I'll check it out thanks.


  • Registered Users, Registered Users 2 Posts: 362 ✭✭theone


    got it to work once hasn't worked since though

    SendKeys.SendWait("^{BREAK}");

    thats under a button click event

    that simulates ctrl +pause/break,I'm guessing thats where the hook comes in,but if it worked once can't understand why it won't work again.


Advertisement