Subject: Re: Enable mouse to disable screen
To: Yasir Malik <ymalik@cs.stevens.edu>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: port-i386
Date: 12/27/2005 17:47:01
In message <Pine.NEB.4.63.0512271001110.15458@long-trail.cs.stevens-tech.edu>, 
Yasir Malik writes:
>Hi all,
>
>When I have my laptop plugged in and the screen grays out, I am able to 
>use my MS Basic Optical Mouse to re-enable the screen.  However, when I am 
>running on my battery and the screen turns off, I cannot use the mouse to 
>re-enable the screen.  I can use the keyboard, however.  Also, using the 
>mouse does not effect whether the screen turns off.  I am running apmd(8). 
>Please note that when I am running on battery, the screen never grays out. 
>How can I have the mouse re-enable the screen?  I am still running NetBSD 
>2.0_BETA.
>
>I have tried running screenblank(1), but this does not do anything; maybe 
>it's because I don't have the correct frame buffer device, but I can't 
>find any frame buffer device in dmesg.  I am not sure if "disabling" the 
>framebuffer is the same as turning off the screen, and if isn't, I don't 
>think screenblank(1) would work anyway.
>
>I asked this question before as part of other mouse related questions, and 
>I was told by someone to add the mouse to the BIOS.  I did not know how to 
>do this, and out of embarrassment, I didn't ask how.  Back then the screen 
>turning off wasn't so much of a problem, but now since I working on a 
>curses program now, it is.  I guess the thing to do would be to add the 
>mouse as one of the devices for apmd to monitor, but I can't find any 
>documentation on this.
>

The problem, I suspect, is that your screen-blanking is being done by 
the BIOS, which NetBSD doesn't see.  Furthermore, the BIOS doesn't know 
that you have an external mouse connected.  The issue is that the BIOS 
is configured to be aggressive about blanking the screen when you're on 
battery power.

I have no idea how to tell your BIOS (or even my laptop's BIOS) that 
there's an external mouse connected.  What you can do is disable BIOS 
screen-blanking -- and you'll have to figure out that part -- and use 
'xset' (I assume you're using X, since you're asking about the mouse) 
with 'dpms' to blank the screen.  (If you don't use dpms, it won't do 
what you want.)

		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb