Search code examples
.net.net-4.5input-devices

Control Input Devices with .NET, is it possible?


I have a gaze controller with their respective .NET SDK.

I'm wondering if there is any way to create an application/process in .NET where through code I can control cursor movement (and actions: click, double click…) in Windows SO and also to inject text (in anywhere such as, rename a icon, make a search in a browser), basically I want to control input devices (mouse, keyboard) through code in .NET.

Is it possible? What would I need for this? Where to start?

Excuse me if it is an inappropiate question.

Thanks in advance.


Solution

  • You can control cursor movement and clicks in windows from a .net application using the Cursor Class

    You can send keyboard strokes to the active application in windows using the SendKeys Class

    Both are quite straight forward, for example, to send an ENTER keypress all that is required is

     SendKeys.Send("{ENTER}")