c# key sequence

  • Thread starter Thread starter jpierson
  • Start date Start date
J

jpierson

Hi,

I'm trying to simulate a break sequence to a serial device ctrl +
pause/break
I tried it with limited succcess using this

SendKeys.SendWait("^{BREAK}")

I'm putting this code under a button click event,I think it may have
something to do with a keyboard hook but i'm not sure how to go about
it.

Any help would be appreciated.

Thanks

James
 
James,

What device are you trying to send to? Why not just open the port to
the serial device (you can use the classes in the System.IO.Ports namespace
to connect to it) and then send the appropriate information through that.

Hope this helps.
 
Hi Nicholas,

I'm communicating with a router over the console port sending a break
to the router is part of password recovery

Ctrl + pause/break sends a break to the device.

Im automating this process so I want the same key sequence to work
under a button click event for example.

I have no problem sending information to the device over the com port
I'm trying to simulate the ctrl + pause/break key sequence.

Thanks

James
 
Hi Nicholas,

I'm communicating with a router over the console port sending a break
to the router is part of password recovery

Ctrl + pause/break sends a break to the device.

Im automating this process so I want the same key sequence to work
under a button click event for example.

I have no problem sending information to the device over the com port
I'm trying to simulate the ctrl + pause/break key sequence.

You might want to try the native SendInput function instead.
 
thanks I'll look into that from a little reading it looks similar to a
keyboard hook so maybe thats the road I have to take

cheers

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top