keep a key pressed

  • Thread starter Thread starter news.de.bosch.com
  • Start date Start date
N

news.de.bosch.com

Hello,

does anybody know a way to keep a key pressed programmatically?


TIA

Stephan
 
news.de.bosch.com said:
does anybody know a way to keep a key pressed programmatically?

How should that work? Do you have a robot that is able to press keys?
 
hm ok, maybe my question can be misunterstood.

What i want to realize is to _simulate_ a pressed key programatically. For
example to create the possibility to toggle the ALT keystate using a
checkbox...
 
hm ok, maybe my question can be misunterstood.

What i want to realize is to simulate a pressed key programatically.
For example to create the possibility to toggle the ALT keystate
using a checkbox...

Stephan

OK, no robots :-)

Have a look in the help at the 'SendKeys' class - will that do what you
want?
 
Hi Stephan

What do you want your code to do? Why don't you respond to KeyDown and KeyUp
events to toggle the state of your application, then use a Timer to
repeatedly execute an action while the state shows the key is down. You might
want to use KeyPreview on a form so that you get all the keyboard events
before they are routed to individual controls.

HTH

Nigel Armstrong

Stephan Mader said:
hm ok, maybe my question can be misunterstood.

What i want to realize is to _simulate_ a pressed key programatically. For
example to create the possibility to toggle the ALT keystate using a
checkbox...
 
Back
Top