Click here to Skip to main content
15,905,785 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am designing user interface using c#. I have connected my hardware kit to PC via usb communication and i am sending some commands from user interface(PC) to get data from hardware.
I am successfully sending commands and receiving response from hardware.

I am sending the command like this
C#
SendCommand("TEMP");


I am trying to send "Esc" button command from user interface. I mean i want to send like this
C#
SendCommand("27");
but not working. I think ESC (character 27) button.

Can anyone suggest me how to send that?
Posted

Assuming that SendCommand is your own method, and it only accepts a string:
C#
SendCommand("\x1b");
Should send a single escape character.
 
Share this answer
 
I am not familiar with this type of stuff. But i found this interesting.You can refer to these links. It would be helpful if you modify something.

Sending "ENTER" key through serial port[^]

Close Application at Press of Escape Button[^]

Press Escape key to call method[^]

Virtual-Key Codes[^]

Regards.. :)
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900