Home control question (closing app functionality).

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
MadButch
Posts: 16
Joined: Sat Aug 20, 2005 7:11 pm

Home control question (closing app functionality).

Post by MadButch »

When the user exits the application using the HOME control, is there an event I can catch before my application closes?

Normally it wouldn't hinder, but if I don't close my log file, 0 bytes get written to the mem.card. And if I can't catch the HOME control, is there a way to flush a file opened with sceIoOpen?

Thanks for your time,
Michael
matkeupon
Posts: 26
Joined: Sat Jul 02, 2005 10:58 pm

Post by matkeupon »

Well, you can catch it the first time with no problem (PSP_CTRL_HOME).

But I don't know how to catch the 2nd event (when the user chooses to really quit the game or cancels). So I don't know when the user returns to the program. You could just close the file when the home button is first pressed, and then put your program in a loop just checking for any keypress. If the program catches another keypress, then you know the user canceled in the home menu. So you can re-open your file and the program can go on.

If someone knows a way to catch keypresses even in the home menu, I'd like to know.
Post Reply