# Programmatically Triggering A Keyboard Signal Using C#?



## DrakeonX (Jul 1, 2003)

Hi Guys, I am currently trying to solve an issue which I fear may not be as straight-forward as I hoped:

Is it possible to programmatically cause the keyboard to send the actual signal exactly as if the key were being pressed? I am not talking about virtual keys, I mean to generate the digital signals which occur on the event that a user presses or releases the key.

I ask this because I have a device which attaches between the PC and a PS/2 keyboard and responds directly to hot-key commands. Since it is becoming tedious to mechanically trigger the hot-key commands I am hoping to write a program (ideally somewhere in the C family) which would automatically trigger those hot-key events when the proper conditions are met.

The conclusion I am coming to is that this may be impossible to do programmatically with a standard PS/2 keyboard. The theory currently floating around my head is that I may, in a sense, "ping" the keyboard and have it respond with the signal that it would have generated were I to have mechanically depressed the key so that the device can capture the signal (from the keyboard) and react accordingly...but I am finding it is not so simple.

Any suggestions as to how to tackle this problem? Is it even possible?

Thanks!


----------



## thingamajig (Mar 5, 2005)

I don't think this is possible. The device is listening to the keyboard port for the hot-keys but not the PC. I could only see this working if the device has it's own drivers and can accept signals back from the computer.


----------



## DrakeonX (Jul 1, 2003)

Well that is a disappointment. Is there any alternative to programmatically control a device which doesn't take drivers..but does react to keyboard signals?

Thanks!


----------



## thingamajig (Mar 5, 2005)

DrakeonX said:


> Well that is a disappointment. Is there any alternative to programmatically control a device which doesn't take drivers..but does react to keyboard signals?
> 
> Thanks!


I'm not sure what kind of device you have. It sounds a like a KVM switch. What is the device?


----------



## lotuseclat79 (Sep 12, 2003)

Hi DrakeonX,

Presumably, your device is programmed with hot-key mappings to the keyboard, and intercepts the hot-key input from the keyboard and provides the mappings to functions predetermined. Is that correct? Do you have any such documentation on the device hot-key mappings? What device is it: manufacturer, model?

Usually, it is possible to modify hot-key mappings programatically. What OS are you using: name, version, etc.

-- Tom


----------



## DrakeonX (Jul 1, 2003)

thingamajig: you hit it dead on:

Its the IOGEAR GCS62 KVM switch running in Windows XP Pro.

My ultimate goal is to replicate the "feel" of Synergy without the security risks of connecting through the LAN (it is a sensitive network). Example: Using the KVM mentioned, above drag mouse to desired edge of screen and have it automatically switch over to the other PC. I figured not only would it make my life a little easier..but it would be a nifty project (again...if it were possible).

Ideally I was hoping to be able to resolve the issue without additional and/or different hardware, but that outlook seems bleak now.

Any suggestions?

Thanks!


----------



## DrakeonX (Jul 1, 2003)

I guess it is safe to assume my approach would never work?


----------



## thingamajig (Mar 5, 2005)

I can't think of a way given your current hardware. You might consider instead getting programmable keyboard where function keys can be assigned. Perhaps this is easier than the default hot-keys for your KVM. Otherwise, you would need special hardware and I'm not sure it exists.


----------

