So I have been messing around with the built-in Osk using the sceUtility library in the sdk, and was trying to figure out how to detect a cancellation on text entry, which returns an empty string just like entering an empty string would. Since this part of the sdk isn't documented all that well, I just wanted to share with others how to detect it.
The fields are already there in the sceUtility structs that indicate whether the user cancelled or entered text, it just isn't stated what values are returned when. Here is what I found through some tests( see psputility.h and psputility_osk.h in the src/utility/ folder of the sdk ):
The "results" member of the pspUtilityDialogCommon struct ( "base" field of SceUtilityOskParams ), will be set to 0 upon successful text entry, and 1 if the user cancels the text entry.
Also, it seems that the "rc" field of the SceUtilityOskData struct will be set to 1 if the user cancels, and 2 after successful text entry.
Hope this helps anyone else that was wondering the same thing!
Detect Cancellation from OSK
-
- Posts: 376
- Joined: Wed May 10, 2006 11:31 pm