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
Home control question (closing app functionality).
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.
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.