 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
MrDosu
Joined: 15 Feb 2007 Posts: 3
|
Posted: Fri Mar 02, 2007 11:28 pm Post subject: catching power events question |
|
|
Hi,
id like to catch the power events like in the power callback eg:
| Code: | int power_callback(int unknown, int pwrflags, void* unknown2)
{
if ( pwrflags & PSP_POWER_CB_POWER_SWITCH ) {
printf("night night...\n");
} else if ( pwrflags & PSP_POWER_CB_RESUME_COMPLETE ) {
printf("returning from sleep...\n");
}
int cbid = sceKernelCreateCallback("Power Callback", power_callback, NULL);
scePowerRegisterCallback(0, cbid);
return 0;
} |
but would like to circumvent the need for installing the "normal" home button and volume key callbacks that are done by calling
sceKernelSleepThreadCB();
does any of u guys know a way to get those power events without te home button showing up the exit scren and volume buttons working?
thx in advance :D _________________ No Keyboard Present - Press F1 to continue |
|
| Back to top |
|
 |
adrahil
Joined: 16 Mar 2006 Posts: 277
|
Posted: Fri Mar 02, 2007 11:48 pm Post subject: |
|
|
For suspend/resume, listen to sysevents with an event mask of 0x00FFFF00, you'll figure it out when you see the events :) (0x400X for suspend, 0x1000X for resume, iirc)
There's a simple sample in the SDK for this, just remove the dispatches and register it to listen to the system event mask (0x00ffff00). This would be the only *neat* way not to use callbacks for this, in my opinion.
For other events than standby/resume, well... I guess you need to fiddle around ;) |
|
| Back to top |
|
 |
MrDosu
Joined: 15 Feb 2007 Posts: 3
|
Posted: Fri Mar 02, 2007 11:53 pm Post subject: |
|
|
great mate! :D
the 4 the quick reply just what i needed, 2 thumbs up _________________ No Keyboard Present - Press F1 to continue |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|