views:

94

answers:

1

I want to send keypresses from c# app to an active app (in my case Frets on Fire). The problem is that my code is working with most apps I tried, but not with the actual app I'm aiming for. Here's my code:

while (true)
{
    SendKeys.SendWait("{F1}");
    Thread.Sleep(500);
}

What might prevent the specific app from taking the c# keysends, and what workaround options do I have? Thanx!

A: 

I'm guessing Frets on Fire doesn't deal with Windows keypress messages, but is instead polling the input devices directly; thus it won't respond to SendKeys.

As for workaround options, the two I come up with off-hand are:

  • Create/find an input device driver to communicate with. There has to be some joystick/gamepad driver or something somewhere you can modify to work with.
  • Open up Frets on Fire and look at how it gets its input. Either learn from this or add a hook you can then use to communicate.

Mind you, neither of these seems like a quick job.

lc
As it's very very far from what I'm used to deal with, do you have any related reading material, or umm a tutorial even, I can look at?
MeLight