<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Screensaver when using gamepad</title>
		<link>http://www.allegro.cc/forums/view/586688</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 26 Jul 2006 21:55:50 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m currently writing a game whith gamepad support.<br />I played the game to test it using the gamepad.<br />After some minutes my screen turned off. I thought I had a major bug and my PC just turned off completely.<br />But then I noticed that the monitor has been set to powersafe mode and was turned off.<br />Because I didn&#39;t use the mouse or the keyboard the PC thought it was not used.<br />But I played all the time!</p><p>How can I prevent that the screensaver/power safe mode turns on, while my game is played with a gamepad.</p><p>This dosn&#39;t happen on commercial games, does it?</p><p>Thanks for your help!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (count)</author>
		<pubDate>Wed, 26 Jul 2006 15:48:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>With Win32 look up on <a href="http://msdn.microsoft.com">Microsoft</a></p><p>WM_SYSCOMMAND<br />SC_SCREENSAVE<br />SC_MONITORPOWER</p><div class="source-code snippet"><div class="inner"><pre><span class="c">//from 'allegro.c' getting value from 'allegro.cfg'</span>
_screensaver_policy <span class="k3">=</span> <a href="http://www.allegro.cc/manual/get_config_int" target="_blank"><span class="a">get_config_int</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/uconvert_ascii" target="_blank"><span class="a">uconvert_ascii</span></a><span class="k2">(</span><span class="s">"system"</span>, tmp1<span class="k2">)</span>,
                                     <a href="http://www.allegro.cc/manual/uconvert_ascii" target="_blank"><span class="a">uconvert_ascii</span></a><span class="k2">(</span><span class="s">"disable_screensaver"</span>, tmp2<span class="k2">)</span>,
                                     FULLSCREEN_DISABLED<span class="k2">)</span><span class="k2">;</span>

<span class="c">// from 'wwnd.c'</span>
      <span class="k1">case</span> WM_SYSCOMMAND:
         <span class="k1">if</span> <span class="k2">(</span>wparam <span class="k3">=</span><span class="k3">=</span> SC_MONITORPOWER <span class="k3">|</span><span class="k3">|</span> wparam <span class="k3">=</span><span class="k3">=</span> SC_SCREENSAVE<span class="k2">)</span> <span class="k2">{</span>
            <span class="k1">if</span> <span class="k2">(</span>_screensaver_policy <span class="k3">=</span><span class="k3">=</span> ALWAYS_DISABLED
                <span class="k3">|</span><span class="k3">|</span> <span class="k2">(</span>_screensaver_policy <span class="k3">=</span><span class="k3">=</span> FULLSCREEN_DISABLED
                    <span class="k3">&amp;</span><span class="k3">&amp;</span> gfx_driver <span class="k3">&amp;</span><span class="k3">&amp;</span> <span class="k3">!</span>gfx_driver-&gt;windowed<span class="k2">)</span><span class="k2">)</span>
            <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
         <span class="k2">}</span>
         <span class="k1">break</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (DanielH)</author>
		<pubDate>Wed, 26 Jul 2006 18:31:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank you.<br />But to be honest I don&#39;t know what to do with this information/ how to implement it.<br />The Microsoft site didn&#39;t help me.<br />Sorry for being dumb <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" /></p><p>Would be cool if you could explain a little bit more what this code is/does.</p><p>Thanks alot!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (count)</author>
		<pubDate>Wed, 26 Jul 2006 21:55:50 +0000</pubDate>
	</item>
</rss>
