Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hook keystroke to change from "C" to "Ctrl+C" in .NET?

Tags:

c#

.net

keyboard

In specific time period, when user presses "C" I want it to happen as user presses "Ctrl+C". Actually, whatever key user presses the program should adds Ctrl with it.

DO you know how to do that .NET ?

I've look around for changing KeyEventArgs.KeyData but it cannot be set.

like image 880
eig Avatar asked Mar 16 '10 12:03

eig


1 Answers

KeyEventArgs.KeyData represents what they user actually pressed.

You can create a new KeyEventArgs with the KeyData you want and pass that around.

like image 67
Oded Avatar answered Sep 17 '22 13:09

Oded