Skip to main content
gamedev.net
🔒 Locked

C# Keyhooks

Started by FenixRoA Oct 28, 2004 at 11:14 AM 5 replies 1.3k views
Original Post
FenixRoA
FenixRoA
Alright so I'm starting a program from scratch. With a little help from the GameDev community I managed to get a (fake) fullscreen GDI+ application at 800X600 resolution (yay). Now I need your help to make Key Hooks. Until recently I have been using DirectInput, but my project calls for more direct control of the keyboard and mouse device. So I come to you GameDev to aid me in designing and creating Key Hooks and some sort of Mouse interface. Thanks for your time and consideration, FenixRoA PS Any tuts would be MUCH appreciated
falkone
falkone
What functionality do you require that DirectInput does not provide?
Disclaimer: "I am in no way qualified to present advice n any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)" o
FenixRoA
FenixRoA
Let me rephrase. I meant that I need to be able to run the program on a computer that does NOT have DX installed. So, I'm trying keyhooks.

As to hooking into the window's form Keydown/Keyup, I had heard that this had its disadvantages, although I don't know the details. Does anyone have a little more information as to why Keydown/Keyup might not be the best method of hooking in to the keys.

Also, while i'm here does anyone know how to output sound without using DirectSound?

Thanks again for your time and consideration,
FenixRoA
cmptrgear
cmptrgear

PlaySound?


Or for something a little more robust
Fmod
"Pfft, Facts! Facts can be used to prove anything!" -- Homer J. Simpson
FenixRoA
FenixRoA
Playsound can only play one sound at a time (not what i need). On the other Fmod might be the solution but it states its supported with C/C++/VB/Delphi, but makes no mention of C#. Does anyone know if it works in C# as well as how to use it?
mitchw
mitchw
If you're not sure of what the problems with the eventing model of WinForms is, then how do you know it will apply to you? Try it first as it is easy to implement. You may find that it works perfect for you. If you run into problems, *then* you can start to look for alternatives.

I will warn you though, you won't get far trying to write a game using GDI+. The performance just isn't there.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.