? for Gernot

Previous topic - Next topic

Kuron

Is GLBasic still using DirectInput for keyboard and mouse input on Windows?

Kitty Hello

yes. What else?

Kuron

That explains the issue. 

QuoteWhat else?
Normal Windows mouse and keyboard messages.  For DirectInput, Microsoft's official word is:

The use of DirectInput for keyboard and mouse input is not recommended,


No problem, I will code my own input routines.  It is not a bug if it is working the way it was designed  ;)

MrTAToad

Thats with the later versions of DirectX

Kitty Hello

got a link to what you read?
I use the windows version only if no directx is there (Win NT 4)

Kuron

Quotegot a link to what you read?
MSDN.  First paragraph, third sentence.

At Meltdown 2005, Chuck Walbourn of Microsoft made a presentation called "Best Practices for Windows Development"  which also stated DirectInput should not be used for keyboard and mouse.  I do have the PowerPoint of this, if you would like me to email it to you.  The PPT is under 1MB.

DirectInput has not changed since DirectX 8 which was released in November, 2000.  This issue predates DirectX 8.  Due to the nature of Vista and 7 and the runtime DX emulation used, you will be using the latest versions of DX regardless of what you have compiled against.  This issue predates both of those OSes.  I am not sure where MrTAToad's claim of only "later versions" came from.

Due to the problems that can arise, Mark had to change Blitz Plus and Blitz 3D to quit using DirectInput for mouse and keyboard many years ago.  This was long before MS started saying not to use DirecyInput for keyboard and mouse.  The issues my users are reporting now are the same they were reporting many years ago with Blitz.

Microsoft took the stance they did against the practice of using DirectInput for mouse and keyboard for a reason.

I posted it as a question instead of a bug report, because it is not a bug if you are using DirectInput.  In this case DirectInput is the issue, not GLBasic.  Unfortunately, GLBasic is using DirectInput for something it is not supposed to be used for.  Not a major issue as I can write my own input routines or just drop support for Windows and stick with Linux only.

Moru

Mabe you would like to inform us others about what these issues are? Mabe more people are having the same trouble as you and would like to know that there is a solution instead of spending hours and hours on debugging a problem that doesn't realy lay in their program?

Kitty Hello

DirectInput uses a 2nd thread for handing the WM_INPUT messages. That the only "overhead" created. Many many old games use DirectX for input and it will stay compatible for may years still.
The article is all about mouse input. I will use raw input soon, because that's the only way to get mutitouch working. I need Win7 to test that, though. That's the reason why it's not there, yet.

About the keyboard, the difference between DirectX and the API was, that only directX was able to read all keys on keaboards that supported it simultanously. (Some keyboards can't send more than 5 or so key press flags simultaneously).

So, there's no need to worry about what method of input I use. It just works and it is fast.

Kuron

QuoteMabe you would like to inform us others about what these issues are?
Mouse and keyboard control do not work properly on all systems when using DirectInput.  This is not a GLBasic problem.  This is a DirectInput problem.  This is why Microsoft came out years ago and said not to use DirectInput for keyboard and mouse control.

Unfortunately, like with the UAC, developers for years have refused to abide by the guidelines that MS has set for them.  Developers can be arrogant, stubborn and have a "my poo" doesn't stink attitude.  Some people have issues admitting they are wrong.  In this case, I will believe Microsoft who wrote DirectInput.  They have been saying not to use it for mouse and keyboard for years in various papers and conferences anf official support sites.

Not a major issues, as it takes all of five minutes to write your own input routines for Windows.  However, I can't help but chuckle when developers literally try and say that Microsoft is wrong.


QuoteThe article is all about mouse input. I
Please remain honest.  1.) I did not link to ANY article.  I linked you to the official MSDN support page for DirectInput.  2.) It is NOT just discussing the mouse, it clearly says: The use of DirectInput for keyboard and mouse input is not recommended,


QuoteMany many old games use DirectX for input and it will stay compatible for may years still.
Yes, that is why DirectInput hasn't changed since DX8.  However, Microsoft has repeatedly told developers they should NOT be using DirectInput for keyboard and mouse control anymore.  It will not work properly on all systems.

The excuse "I am doing it because everybody else is doing it" is rarely acceptable in adulthood. 

To jog your memory, a couple of years ago, I had to argue with your for two weeks straight to get you to admit that you had made a mistake with the implementation of icons and get you to fix it.


QuoteSo, there's no need to worry about what method of input I use. It just works and it is fast.
If it worked, I wouldn't be getting complaints.

It is not a GLBasic problem, it is a DirectInput problem.  The GLBasic problem comes in because you are using DirectInput for something, that even Microsoft says you should not be using it for.

Kitty Hello

OK. What complaints do you get in detail?
If DirectX is not working (returns errors), I fall back to what you want  me to do. WM_MOUSEMOVE and GetKeyboardState()