Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / Issues with Mouse and Keyboard input

Author
Message
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 8th Oct 2009 13:17
It's evident that there are currently problems still with detecting both Mouse and Keyboard input (some) on Windows Form based applications. This unfortunately is a side effect of having the DarkGDK.NET Viewport control on a form and DirectX. Unfortunately, until I can have a workaround in the main DGDK libraries implemented, there is absolutely nothing that I can do to resolve this problem.

I've attempted to override the windows messaging pipeline to interecept all input based events from the control, but DirectX input does not work this way. Some of the messages do get intercepted, hence this is why the MouseX and MouseY properties return correctly updated values. Also, some keystrokes which are managed by the main DarkGDK message pump are also handled. What isn't handled in Windows forms, are keycode based input and of course, the mouse events.

The good news is, this problem only manifests itself with Windows form based applications. If you set the FullScreen property of the control to True, so that your program goes into exclusive full screen mode, the normal DarkGDK.NET input functions work correctly. If you plan to make heavy use of the input functions, then I would suggest using full screen mode for your applications. If indeed you need windows form controls etc, then you will need to rely solely on the form input event handlers until the problem has been solved.

Hope this clears up a few things.

Paul.

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 8th Oct 2009 14:35
If somebody can post sample project source I will have a look. I can't seem to reproduce the problem at the moment. The template winform app works fine for me.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 18th Oct 2009 22:56
Quote: "If indeed you need windows form controls etc, then you will need to rely solely on the form input event handlers until the problem has been solved."


Just to clarify - you can use the mouse events on the Viewport control. I was under the impression you had to get the mouse click from the form, but no!

APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 19th Oct 2009 02:35
It may pick up some events BatVink, but there are definately some issues with controllers and such.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 19th Oct 2009 09:47
I found that the mouse clicks did not get picked up by the form, only by the viewport, but I am a .net novice so I am quite possibly missing a setting somewhere.

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 23rd Nov 2009 14:35
Sorry to bring up dead cows, but does anyone have a workaround for this? frmMain.CtlDarkGDKViewport1.MouseButtons seems to return a value even when the mouse is not over the viewport.


EDP Map Editor[2D]
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Dec 2009 11:31
The plot thickens...

I have been picking up the Mouse_down event from the form for my viewport. But today I needed to check for Mouse_up. This didn't work at form level, so I tried it at Viewport level, and it worked. BUT...My Mouse_down even must now check at Viewport level too, it has miraculously shifted itself after adding the Mouse_up code.

It works, it's just confusing!

Login to post a reply

Server time is: 2024-04-23 09:41:42
Your offset time is: 2024-04-23 09:41:42