1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Programmatically Triggering A Keyboard Signal Using C#?

Discussion in 'Software Development' started by DrakeonX, Apr 10, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. DrakeonX

    DrakeonX Thread Starter

    Joined:
    Jul 1, 2003
    Messages:
    41
    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!
     
  2. thingamajig

    thingamajig Banned

    Joined:
    Mar 5, 2005
    Messages:
    6,271
    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.
     
  3. DrakeonX

    DrakeonX Thread Starter

    Joined:
    Jul 1, 2003
    Messages:
    41
    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!
     
  4. thingamajig

    thingamajig Banned

    Joined:
    Mar 5, 2005
    Messages:
    6,271
    I'm not sure what kind of device you have. It sounds a like a KVM switch. What is the device?
     
  5. lotuseclat79

    lotuseclat79

    Joined:
    Sep 12, 2003
    Messages:
    20,583
    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
     
  6. DrakeonX

    DrakeonX Thread Starter

    Joined:
    Jul 1, 2003
    Messages:
    41
    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!
     
  7. DrakeonX

    DrakeonX Thread Starter

    Joined:
    Jul 1, 2003
    Messages:
    41
    I guess it is safe to assume my approach would never work?
     
  8. thingamajig

    thingamajig Banned

    Joined:
    Mar 5, 2005
    Messages:
    6,271
    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.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/916059

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice