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 / while (LoopSDK() && !dbEscapeKey()) {}

Author
Message
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 29th Jan 2006 01:14
Hello,

I read up in another thread about this, and have encountered a problem about these commands: LoopSDK() && !dbEscapeKey()

Actually LoopSDK() was exactly what I was looking for, since the program crashes if I don't use this function and click on the close button of the window -> [X].

But, if u dont use the escape key to end the loop, then weird things happen to my Program Window. I wonder why the program crashes if I leave out the && !dbEscapeKey() part and then hit escape when the program runs?

What if I want my escapekey to be assigned to something different than having my program crashed?

greets,
Barnski.

-- I just started with DarkSDK, by translating DBP Projects. So please be patient when helping me thanx! --
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 29th Jan 2006 12:07
This works fine for me :



Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
Smoke me a computer chip, I'll be baking breakfast.
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 29th Jan 2006 15:18
Hi Stinky Stout,

Actually I should have mentioned that the program does not crash completely. But the window in which it is running does not react anymore!

I tried your code, when hitting escape the program continues, ok, but try to move your window for example! or switch task and back, your window will not be redrawn... (at least mine does not!)

I would like to find out if its just on my PC or if its a "bug" or an "unwanted" feature of LoopSDK().

greets,
Barnski.

-- I just started with DarkSDK, by translating DBP Projects. So please be patient when helping me thanx! --
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 30th Jan 2006 08:59 Edited at: 30th Jan 2006 08:59
Hmm, maybe this can help:

dbDisableEscapekey()


//Awards: Best DM at NeverwinterConventionIII (NWCon3)
//Sys: Pentium IV 3200E/Prescott;800Mhz FSB;HT;WinXPPro;ATIR9700PRO;1024MB RAM(2x512MB"DualChanneled";VC++7.net;Delphi6;ADSL512;
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 30th Jan 2006 11:26
Quote: "ok, but try to move your window for example! or switch task and back, your window will not be redrawn... (at least mine does not!)"

Yes, I forgot to mention you need dbDisableEscapeKey - see above post.

Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
Smoke me a computer chip, I'll be baking breakfast.
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 30th Jan 2006 19:08
OK thanks, now it works fine for me.

There's just a tiny difference still; while holding down escape key, you cant move the window, but with any other key it is possible.. so disableEscapeKey doesnt do 100% disabling, as it seems.
However, this should never be a real concern I guess...

greets,
Barnski.

-- I just started with DarkSDK, by translating DBP Projects. --
-- As a new member my post will NOT appear until mods approve it, OK, but why is the "Last Post by" never updated? --

Login to post a reply

Server time is: 2024-05-17 09:57:52
Your offset time is: 2024-05-17 09:57:52