power-key_daemon v1.0b2
© 1998 Tyler Riti and Fly By Night Productions

Introduction:
power-key_daemon is a simple utility that enables you to shutdown or restart your computer from the keyboard using the power key on all Macintosh keyboards.

System Requirements:
PowerMac running BeOS PR2 or higher
A keyboard with a power key (looks like the icon)

Contents:
power-key_daemon				The executable file
README.txt					You're reading it
install.sh						Shell script to automate installation
power-key_daemon_10b2.txt		BeWare information file

Installation:
Launch a Terminal from the Be menu and cd to the power-key_daemon directory. From here, type "install.sh" on the command line. power-key_daemon will be copied to your ~/config/bin directory by little gnomes who will then modify your UserBootscript so that power-key_daemon will be launched at startup. Type "power-key_daemon &" if you want to launch it immediately (you wicked monkey you).

Usage:
power-key_daemon can be launched from either the Terminal on the command line or from the Tracker by double-clicking the application icon. On the command line you have the following options:

power-key_daemon [-p VALUE]

-p allows you to set the how often in microseconds power-key_daemon checks to see if the power key is pressed. By default, the value is equal to the Delay Until Key Repeat rate set in the Keyboard preferences application which ranges from 250,000 ms to 1,000,000 ms or from a quarter of a second to a whole second.

Okay, so there's only one option so far. Eventually, you'll be able to customize power-key_daemon even further.

When the power key is pressed, alert appears to give you the choice of shutting down, restarting, or canceling. You can hit Return to shutdown, "r" to restart, or Escape to cancel. Definitely much easier than having to go to the Be menu and is so much more natural to a Mac user.

Known Bugs:
power-key_daemon crashes with a data access exception in the pulse task when killed from the command line without the "-KILL" option (damn gnomes).

If you find any other bugs, please contact me at the e-mail address below.

Frequently Asked Questions:
Q: Cool program, how does it work?
A: The power key is actually connected to a light inside your computer. When you press the key, the light turns on alerting the gnomes (just like in your fridge). Actually, I just poll the keyboard in the application's Pulse() method looking for the power key's keycode. It's dirty but there's no way that I know of to create a global BMessageFilter.

Q: Will there be an Intel version?
A: It's come to my attention that some PC keyboards actually have a button that can serve as a power off key. If someone can tell me what keycode it generates, I'll have the gnomes work on an Intel version. Either way, I hope to get a bigger and better project underway that'll make power-key_daemon look like puppy chow.

Q: Why doesn't the shutdown alert appear every time I hit the power key?
A: To make sure that the polling loop catches your keypress, you have to hold the power key for about half a second. Think of it as a feature for now. A really weird, kooky feature.

Q: I'm hitting the "r" key but the computer won't restart. Why is this?
A: You probably have caps lock on. Press the caps lock key to turn it off and then press "r". I'd like to set two shortcuts to the same button but the API doesn't seem to let me.

Q: Nice, really nice. How do I quit power-key_daemon?
A: Open the Terminal as described above and type "kill -KILL power-key_daemon". If you really want a better way then let me know and I'll see what the gnomes can do.

Q: Who really asks these so-called frequent questions?
A: Little gnomes.

License and Distribution:
power-key_daemon is freeware but copyrighted. You are allowed to use, copy, and distribute power-key_daemon for free provided that the executable and all files in the enclosing directory are kept together and unaltered. Distribution of this product or any files contained therein for purpose of profit is expressly prohibited. Please contact the author in case of publication on CD-ROM.

TYLER RITI PROVIDES THIS SOFTWARE "AS IS", WITH NO WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT WILL TYLER RITI BE LIABLE FOR ANY INDIRECT DAMAGES OR OTHER RELIEF ARISING OUT OF YOUR USE OR INABILITY TO USE THE PROGRAM INCLUDING, BY WAY OF ILLUSTRATION AND NOT LIMITATION, LOST PROFITS, LOST BUSINESS OR LOST OPPORTUNITY, OR ANY SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF SUCH USE OR INABILITY TO USE THE PROGRAM, EVEN IF TYLER RITI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.

(Wow, that was pretty serious!)

Version History:
April 2, 1998:		Initial public beta release
April 4, 1998:		Public beta 2 release. Fixed a nasty bug that would cause 
				power-key_daemon to crash on reboot or shutdown.

About the Author:
Name:			Tyler Riti
Occupation:		Full time CS student at The University of Texas at Austin
E-mail:			fizzboy@mail.utexas.edu
				fizzboy@mail.cs.utexas.edu (rarely checked)
Web:			http://www.cs.utexas.edu/users/fizzboy/

Final Word:
The word "gnomes" now appears eight times in this readme.

Fly By Night Productions
“We put the ‘cute’ back in ‘executable’.”