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 / C++ DarkGDK Window Handle Keyboard Keystroke Intercepting - Um... Help?

Author
Message
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th May 2008 16:09
Quote: "But, if you want to manipulate the window properties you can use the Win32 API calls and pass the HWND.

To do this you would need to include 'globstruct.h', you can access the HWND like this:

g_pGlob->hWnd

and the HINSTANCE like:

g_pGlob->hInstance"
- By Monotonic in this thread: http://forum.thegamecreators.com/?m=forum_view&t=129576&b=22


Monotonic... (and anyone else of course ) Can those pointers/handles be used to get keystrokes from the OS versus DarkGDK? The GUI I'm working on is slamming but key combinations like CNTL+C, CNTL+V, etc.. are sluggish sorta.. and the TAB kinda sticks..... So If I Shift+Tab, Then hit Shift+Home I get another Shift+Tab...

I admit I have a timer on the "keystate" checks.. but its 100ms, and I'm talking if I wait... And try the Shift+Home after a previous registered Shift+Home.. It comes down one more time as a Shift+Tab. If I hit a key that dbEntry is hooked to grab... then do the Shift+Home - No Sticky!

I'm wondering if I should sub class or something. Its a big deal.. I have 3 input systems... Where the one that is "turned on" is the one with the best results...

I've even considered making an array that is only as big as the keys you want to "Scan" so I can limit the dbKeyState calls to what I'm hunting for. This might be the way to do it, and manage my own dbEntry replacement. Note: dbEntry works Fine! I just think there is a possibility it impacts how dbKeystate works in some situations... or simply that WINDOWS OS makes it difficult for GDK to get 100% perfect keystrokes (linearly) for some key combo's.. that are important to windows.

I'm grasping at straws ... The problem? One pain thing is the GUI cut-n-paste is a little sluggish ... I had to find a balance from sending to many GUI messages when a key is down (slows down everything if streaming KEYPRESS, KEYPRESS, KEYPRESS, KEYPRESS.. while someone is holding down shift or something and getting the results I am after.... Ah well....

It's not critical... but it's be nice to have the ability to get the keystrokes directly as the Windows OS hands them to DarkGDK Window. I know generally speaking this is possible, subclassing your own sub message handler or something... I am also aware that DirectX might interfere with that flow to do a lower level hardware poll .. allowing multi-keypress combinations for games etc.

Thanx in advance!
Best Regards,
Jason P Sage

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 15th May 2008 13:15
I guess you haven't tried IanM's KeyState Handler. I think it does what you ask for.

Here is a link to a VS2005 project template

http://forumfiles.thegamecreators.com/?i=1259627
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 15th May 2008 14:37
Thanx Morcilla, it looks it just might LOL - Cool that you can peekmessage within DarkGDK. I'll have to investigate!

Login to post a reply

Server time is: 2024-09-29 21:17:27
Your offset time is: 2024-09-29 21:17:27