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 / Keyboard events lost?

Author
Message
thierry st malo
19
Years of Service
User Offline
Joined: 7th Nov 2005
Location: Saint-Malo, France
Posted: 12th Jan 2007 10:37
Hi,
I am creating an application with VB Express, that uses DarkGDK .NET and ZKATBIT's DbWindow control. Basically this works fine, but some (not all) keyboard events do seem to be lost or eaten up. They are related to tab characters and to menu shortcuts.
Can you help?
Thanks in advance,
Thierry
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 12th Jan 2007 13:47
have you tried recreating the problem in a different project that doesnt use any third party items (like ZK's dbWin)?

It would help narrow down the possibilities if you did.

thierry st malo
19
Years of Service
User Offline
Joined: 7th Nov 2005
Location: Saint-Malo, France
Posted: 12th Jan 2007 18:37
Unless I am mistaken, I can't. As far as I know, ZK's dbWin is the only way to use DGDK .NET in a "normal" Windows app. Otherwise I have to fall back on a .NET console app which is nice for a game but not for general 3D developments.
Cheers,
Thierry
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 12th Jan 2007 20:34
my point was to discover where the problem is occurring. have you contacted ZK and asked him about it? the problem sounds like its going to be occurring at his layer as opposed to within the dgdk.net itself.

Cypher Zero
18
Years of Service
User Offline
Joined: 11th May 2006
Location:
Posted: 13th Jan 2007 04:38
You can use DGDK.NET in a normal windows app, try using these commands:

X = <WinForm>.Handle()
Y = oDBDisplay.GetHWND()
oDBDisplay.OverrideHWND(X)
Cypher Zero
18
Years of Service
User Offline
Joined: 11th May 2006
Location:
Posted: 13th Jan 2007 04:39
PS. You can also use GetAsyncKeyState to retrieve keyboard events anyway, this class might help you

APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 13th Jan 2007 15:56
When DGDK and DGDK.NET create their own windows for rendering the DX layer, that window uses a WNDPROC or Window Procedure to receive standard events such as keyboard/mouse etc. A message loop is used to process these system events. When you substitute a new Window handle for the DX layer etc, you're asking the library to send all events and such to a new window. This includes keyboard and mouse events. If your new window doesn't contain events for catching keyboard and mouse events, DGDK will not respond to these events. That's why the input functions will no longer work as normal when you capture into a new window.

Normally when you create or subclass a window, you also get the original window's WndProc address so that events that you don't handle, you pass into the captured WndProc for it to process events. This captured WndProc address must be the original Window Procedure that DGDK created when the toolkit first initialized. I've not done this under the .NET languages, and therefore I cannot explain the technical aspect on how to do it, but this is what is needed in order to fix the keyboard and mouse events so that you can still call the oDBInput class methods.

If not, then implement your own standard keyboard/mouse event handlers for your Windows form, and ignore the DGDK input methods altogether.

Paul.

thierry st malo
19
Years of Service
User Offline
Joined: 7th Nov 2005
Location: Saint-Malo, France
Posted: 14th Jan 2007 10:41
Thanks, Paul. That's what I did, using Cypher Zero's recommendation.
So, problem fixed.
Cheers,
Thierry
SirLeon
17
Years of Service
User Offline
Joined: 6th Jan 2007
Location: Greece
Posted: 29th Jan 2007 20:10
Hello,

I think it would be a good idea to provide an actually working example of a DGDK integrated in a windows form application.

I'm working with a windows application that is using DB engine to render the results in real time and although I can find some alternatives ways to catch keyboard and mouse events, it starts getting more and more complicated. One point that makes my life difficult now is that I lose all of my keyboard shortcuts that I can easily assign through the Visual IDE.

From the time that I use the "oDBDisplay.OverrideHWND" and stop showing my main form through the "Application.Run(new Form1());" command I lose shortcut events.

I am not an expert in Visual .NET programming and although I've tried I can't achieve proper results (in a way that APEXnow describes).

Thank you for your time.

Best regards,

Login to post a reply

Server time is: 2024-11-19 11:27:24
Your offset time is: 2024-11-19 11:27:24