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.

DarkBASIC Professional Discussion / Disable Systemkeys does not work

Author
Message
Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 13th Dec 2014 01:29
I am on Windows 8.1 and the disable systemkeys does not work, i need it to prevent gamers to alt+tab the game, as if they do that, when they come back the game crashes.
Does anybody know why the disable systemkeys command does not work?
Or better, there is a simple way so that a gamer can alt+tab and come back on the game without getting errors?
As far as i read in the forum i should have to reload everything (objects, textures) but that seems to be crazy, it will take too much time as people who use alt+tab usually they do for a few second for example to "check something fast and come back to the game"
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 13th Dec 2014 02:07
That's an ancient function that only works on Windows 98 and below I think, I believe it was removed from newer versions because it made it too easy to cause mishief for the computer user (it allegedly disabled the various windows key shortcuts and even ctrl + alt + del).

Your window should receive a message when it is about to loose focus due to being tabbed out from. If you can catch this (which is easiest done using Windows GUI plugins like BlueGUI (or any others such as BBB Gui, I suppose)) you can work from there.
The main problem lies in the fact that DX9 purges all objects upon a monitor resolution change, as is deemed to happen when tabbing out from fullscreen mode (this is considered to happen even if your fullscreen resolution matches the desktop resolution I believe). Basically you will have to keep track of all your loaded media and reload it when this happens to prevent the crash. There should be a post about this somewhere here. I don't think this will happen if you run in the "windowed fullscreen" mode if you want a simpler fix.

WickedX
16
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 13th Dec 2014 04:43
I have added the ability to disable/enable the system keys to my DBPro plug-in. This will work on Windows systems newer then Windows 98 as well. Download the attached file, extract and copy to your dark Basic folder. Run this snippet in Full Screen Exclusive Mode or Windowed - Full Screen.

Attachments

Login to view attachments
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 13th Dec 2014 05:02
most users don't appreciate having basic controls over their own systems taken away from them. Removing the ability to alt-tab is really not the best way to go about this.

As Rudolpho said, you can set the 'screen type' option in the left hand side of the editor to 'fulldesktop' and you can alt-tab to your heart's content without a crash. This is a borderless windowed fullscreen.

the basic 'fullscreen' mode is a fullscreen exclusive and will suffer a d3d device loss/reset on alt-tab. If you can detect this loss you can recover from it by reloading media.

Ideally, your game should have a user options menu where they can choose how to run your game and will have a better understanding of what to expect out of the use of system keys.

Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 13th Dec 2014 05:28
I noticed that if I remove the command "set Windows off", i can alt+tab normally, but my fps drops from 72-73 to 69, i think i will make an option to decide which one to use, so that slow computers could gain a few fps but they won't be able to alt+tab
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Dec 2014 12:24
Quote: "As Rudolpho said, you can set the 'screen type' option in the left hand side of the editor to 'fulldesktop' and you can alt-tab to your heart's content without a crash. This is a borderless windowed fullscreen."


That's my advice too.

Quote: "but my fps drops from 72-73 to 69"


I'd rather have that than need to reload all my media. Doesn't seem like a big issue to me.



Powered by Free Banners
ShellfishGames
12
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 13th Dec 2014 17:32
Quote: "I noticed that if I remove the command "set Windows off", i can alt+tab normally, but my fps drops from 72-73 to 69, i think i will make an option to decide which one to use, so that slow computers could gain a few fps but they won't be able to alt+tab"


So I guess by default, as people here mentioned, you've set it to Fulldesktop (i.e. windowed fullscreen). Using "set window off" will change to exclusive fullscreen, resulting in the undesired behaviour of having to reload all media after tabbing out. Not sure about the FPS drop though, I didn't know there was a difference.. but seems worth it I guess.

WickedX
16
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 13th Dec 2014 17:54
Since I started using DBPro, I have gone through three computers and alway got a better frame rate in Windowed - Full Screen Mode.
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 13th Dec 2014 21:44
Quote: "Not sure about the FPS drop though, I didn't know there was a difference.. but seems worth it I guess."

The whole point of the exclusive fullscreen mode is that the GPU will have direct access to the monitor, which will make it faster than if this has to go through a window.
I think the efficiency difference used to be a lot more significant on older systems than it is today however.

Stab in the Dark software
Valued Member
22
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 14th Dec 2014 01:56
It seems that using the exclusive full screen mode uses 3 times the
GPU ram then Fulldesktop does. You can check this using an application called "Process Hacker". This may be a memory leak.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.

Login to post a reply

Server time is: 2025-05-12 05:02:17
Your offset time is: 2025-05-12 05:02:17