//event loop
KeySetMask( ~( keyBitHard1 | keyBitHard2 | keyBitHard3 | keyBitHard4 ) );
do {
EvtGetEvent(&event, evtWaitForever);
if(event.eType == keyDownEvent)
if(event.data.keyDown.chr == 264 || event.data.keyDown.chr == 266 ||
event.data.keyDown.chr == 267)
continue;
if (! SysHandleEvent(&event))
if (! MenuHandleEvent(NULL, &event, &error))
if (! AppHandleEvent(&event))
FrmDispatchEvent(&event);
} while (event.eType != appStopEvent);
KeySetMask( keyBitsAll );
This code will mask out the hard button and silked buttons. Unfortunately
it doesn't work if the user presses one of theses button while in a dialog.
You can easily change this code so instead of masking out the keys, it check
to see if they are hit and runs some function. The key (no pun intended) is
to never let the key presses get to the normal event loop code
(SysHandleEvent), because then the app will close.
-Nick
-----Original Message-----
From: cherry zhang [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 02, 1999 10:08 AM
To: [EMAIL PROTECTED]
Subject: RE: How to override hard button?
Hi, all:
I need advice on how to use hard button for my own purpose instead of
launching the datebook, memopad, etc. I put some code under keydown event
in the preprossor event, it works but after that it still launches the
default application. How can I avoid it happen? Is it the right place to
place the code in the event loop?
Thanks a lot.
Cherry