System dialogs, apps, battery, power & system information (extends Lua's os library)
More...
These functions are added to Lua's standard os library, so os.time(), os.date(), os.clock(), etc. still work like in normal Lua (see the Lua manual).
System dialogs
The dialog functions (os.keyboard(), os.message(), os.importphoto(), ...) show one of the PS Vita's own dialogs and wait until it's closed, then return the result. While a dialog is open your main loop doesn't run, so the screen behind it is empty. To draw something behind a dialog (or to update it, like a progress bar), define the dialog's callback function. It's called once per frame while that dialog is open:
Don't call draw.swapbuffers() inside these callbacks, LifeLua does it for you.
function LifeLuaIMEDialog()
background:display(0, 0) -- keep the app's background visible behind the keyboard
end
local name = os.keyboard("What's your name?", "Harommel")
if name then
os.message("Hello, "..name.."!")
end
|
Used with os.shuttersound()
|
|
SceShutterSoundType | SCE_SHUTTER_SOUND_TYPE_SAVE_IMAGE |
| | Photo shutter sound.
|
| |
|
SceShutterSoundType | SCE_SHUTTER_SOUND_TYPE_SAVE_VIDEO_START |
| | Video recording start sound.
|
| |
|
SceShutterSoundType | SCE_SHUTTER_SOUND_TYPE_SAVE_VIDEO_END |
| | Video recording end sound.
|
| |
|
Used with os.lock()
|
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_PS_BTN |
| | The PS button (pressing it can then be detected with SCE_CTRL_PSBUTTON)
|
| |
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_QUICK_MENU |
| | The quick menu (holding the PS button)
|
| |
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_POWEROFF_MENU |
| | The power off menu (holding the power button)
|
| |
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_USB_CONNECTION |
| | USB connection.
|
| |
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_MC_INSERTED |
| | Memory card inserted message.
|
| |
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_MC_REMOVED |
| | Memory card removed message.
|
| |
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_MUSIC_PLAYER |
| | Music player controls.
|
| |
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_PS_BTN_2 |
| | The PS button, without showing the "not allowed" symbol.
|
| |
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_UNK8 |
| | Unknown.
|
| |
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_UNK80 |
| | Unknown.
|
| |
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_UNK100 |
| | Unknown.
|
| |
|
SceShellUtilLockType | SCE_SHELL_UTIL_LOCK_TYPE_UNK200 |
| | Unknown.
|
| |
|
Used with os.infobar(). Each one is also available without the SCE_APPMGR_ prefix (e.g. INFOBAR_COLOR_WHITE).
|
|
SceAppMgrInfoBarVisibility | SCE_APPMGR_INFOBAR_VISIBILITY_INVISIBLE |
| | Hide the info bar.
|
| |
|
SceAppMgrInfoBarVisibility | SCE_APPMGR_INFOBAR_VISIBILITY_VISIBLE |
| | Show the info bar.
|
| |
|
SceAppMgrInfoBarColor | SCE_APPMGR_INFOBAR_COLOR_BLACK |
| | Black info bar.
|
| |
|
SceAppMgrInfoBarColor | SCE_APPMGR_INFOBAR_COLOR_WHITE |
| | White info bar.
|
| |
|
SceAppMgrInfoBarTransparency | SCE_APPMGR_INFOBAR_TRANSPARENCY_OPAQUE |
| | Solid info bar.
|
| |
|
SceAppMgrInfoBarTransparency | SCE_APPMGR_INFOBAR_TRANSPARENCY_TRANSLUCENT |
| | See-through info bar.
|
| |
|
Used in the type parameter of os.keyboard()
|
|
SceUInt32 | SCE_IME_TYPE_DEFAULT |
| | Normal keyboard.
|
| |
|
SceUInt32 | SCE_IME_TYPE_BASIC_LATIN |
| | Basic latin letters only.
|
| |
|
SceUInt32 | SCE_IME_TYPE_NUMBER |
| | Number pad.
|
| |
|
SceUInt32 | SCE_IME_TYPE_EXTENDED_NUMBER |
| | Number pad with extra symbols.
|
| |
|
SceUInt32 | SCE_IME_TYPE_URL |
| | Keyboard for typing web addresses.
|
| |
|
SceUInt32 | SCE_IME_TYPE_MAIL |
| | Keyboard for typing e-mail addresses.
|
| |
|
Used in the mode parameter of os.keyboard()
|
|
SceUInt32 | SCE_IME_DIALOG_TEXTBOX_MODE_DEFAULT |
| | Normal text box.
|
| |
|
SceUInt32 | SCE_IME_DIALOG_TEXTBOX_MODE_PASSWORD |
| | Hides the typed text, for passwords.
|
| |
|
SceUInt32 | SCE_IME_DIALOG_TEXTBOX_MODE_WITH_CLEAR |
| | Text box with a clear button.
|
| |
|
Used in the option parameter of os.keyboard(). They can be added together.
|
|
SceUInt32 | SCE_IME_OPTION_MULTILINE |
| | Allow several lines of text.
|
| |
|
SceUInt32 | SCE_IME_OPTION_NO_AUTO_CAPITALIZATION |
| | Don't capitalize the first letter automatically.
|
| |
|
SceUInt32 | SCE_IME_OPTION_NO_ASSISTANCE |
| | No word suggestions.
|
| |
|
Used in the dialog_mode parameter of os.keyboard()
|
|
SceUInt32 | SCE_IME_DIALOG_DIALOG_MODE_DEFAULT |
| | Normal dialog.
|
| |
|
SceUInt32 | SCE_IME_DIALOG_DIALOG_MODE_WITH_CANCEL |
| | Dialog with a cancel button.
|
| |
|
Used in the enter_label parameter of os.keyboard()
|
|
SceUInt32 | SCE_IME_ENTER_LABEL_DEFAULT |
| | "Enter"
|
| |
|
SceUInt32 | SCE_IME_ENTER_LABEL_SEND |
| | "Send"
|
| |
|
SceUInt32 | SCE_IME_ENTER_LABEL_SEARCH |
| | "Search"
|
| |
|
SceUInt32 | SCE_IME_ENTER_LABEL_GO |
| | "Go"
|
| |
|
Used with os.message()
|
|
SceUInt32 | SCE_MSG_DIALOG_BUTTON_TYPE_OK |
| | An OK button.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_BUTTON_TYPE_YESNO |
| | Yes and No buttons.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_BUTTON_TYPE_NONE |
| | No buttons (close it with os.closemessage())
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_BUTTON_TYPE_OK_CANCEL |
| | OK and Cancel buttons.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_BUTTON_TYPE_CANCEL |
| | A Cancel button.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_BUTTON_TYPE_3BUTTONS |
| | 3 buttons with your own text
|
| |
|
Used for the button texts of os.message() with SCE_MSG_DIALOG_BUTTON_TYPE_3BUTTONS
|
|
SceUInt32 | SCE_MSG_DIALOG_FONT_SIZE_DEFAULT |
| | Normal size.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_FONT_SIZE_SMALL |
| | Small size.
|
| |
|
Used with os.systemmessage()
|
|
SceUInt32 | SCE_MSG_DIALOG_SYSMSG_TYPE_WAIT |
| | "Please wait."
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_SYSMSG_TYPE_WAIT_SMALL |
| | "Please wait." (small)
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_SYSMSG_TYPE_WAIT_CANCEL |
| | "Please wait." with a cancel button
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_SYSMSG_TYPE_NOSPACE |
| | Not enough free space.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_SYSMSG_TYPE_MAGNETIC_CALIBRATION |
| | Magnetometer calibration.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_SYSMSG_TYPE_NEED_MC_CONTINUE |
| | A memory card is needed to continue.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_SYSMSG_TYPE_NEED_MC_OPERATION |
| | A memory card is needed for this operation.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_MIC_DISABLED |
| | The microphone is disabled.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_WIFI_REQUIRED_OPERATION |
| | Wi-Fi is required for this operation.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_WIFI_REQUIRED_APPLICATION |
| | Wi-Fi is required for this application.
|
| |
|
SceUInt32 | SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_EMPTY_STORE |
| | No content available in the store.
|
| |
|
Used with os.powertick(), os.powerlock() and os.powerunlock()
|
|
SceKernelPowerTickType | SCE_KERNEL_POWER_TICK_DEFAULT |
| | All the timers below.
|
| |
|
SceKernelPowerTickType | SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND |
| | The automatic sleep timer.
|
| |
|
SceKernelPowerTickType | SCE_KERNEL_POWER_TICK_DISABLE_OLED_OFF |
| | The screen-off timer.
|
| |
|
SceKernelPowerTickType | SCE_KERNEL_POWER_TICK_DISABLE_OLED_DIMMING |
| | The screen dimming timer.
|
| |
|
Returned by os.systemevent()
|
|
SceAppMgrSystemEventType | SCE_APPMGR_SYSTEMEVENT_ON_RESUME |
| | The PS Vita woke up from sleep.
|
| |
|
SceAppMgrSystemEventType | SCE_APPMGR_SYSTEMEVENT_ON_STORE_PURCHASE |
| | A store purchase happened.
|
| |
|
SceAppMgrSystemEventType | SCE_APPMGR_SYSTEMEVENT_ON_NP_MESSAGE_ARRIVED |
| | A PSN message arrived.
|
| |
|
SceAppMgrSystemEventType | SCE_APPMGR_SYSTEMEVENT_ON_STORE_REDEMPTION |
| | A store code was redeemed.
|
| |
|
Used with os.colorspace()
|
|
SceInt32 | SCE_AVCONFIG_COLOR_SPACE_MODE_DEFAULT |
| | Normal colors.
|
| |
|
SceInt32 | SCE_AVCONFIG_COLOR_SPACE_MODE_HIGH_CONTRAST |
| | High contrast mode.
|
| |
|
Returned by os.language()
|
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_JAPANESE |
| | Japanese.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_ENGLISH_US |
| | English (United States)
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_ENGLISH_GB |
| | English (United Kingdom)
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_FRENCH |
| | French.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_SPANISH |
| | Spanish.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_GERMAN |
| | German.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_ITALIAN |
| | Italian.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_DUTCH |
| | Dutch.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_PORTUGUESE_PT |
| | Portuguese (Portugal)
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_PORTUGUESE_BR |
| | Portuguese (Brazil)
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_RUSSIAN |
| | Russian.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_KOREAN |
| | Korean.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_CHINESE_T |
| | Chinese (Traditional)
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_CHINESE_S |
| | Chinese (Simplified)
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_FINNISH |
| | Finnish.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_SWEDISH |
| | Swedish.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_DANISH |
| | Danish.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_NORWEGIAN |
| | Norwegian.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_POLISH |
| | Polish.
|
| |
|
SceSystemParamLang | SCE_SYSTEM_PARAM_LANG_TURKISH |
| | Turkish.
|
| |
|
Returned by os.dateformat() and os.timeformat()
|
|
SceSystemParamDateFormat | SCE_SYSTEM_PARAM_DATE_FORMAT_YYYYMMDD |
| | Year/Month/Day.
|
| |
|
SceSystemParamDateFormat | SCE_SYSTEM_PARAM_DATE_FORMAT_DDMMYYYY |
| | Day/Month/Year.
|
| |
|
SceSystemParamDateFormat | SCE_SYSTEM_PARAM_DATE_FORMAT_MMDDYYYY |
| | Month/Day/Year.
|
| |
|
SceSystemParamTimeFormat | SCE_SYSTEM_PARAM_TIME_FORMAT_12HR |
| | 12-hour clock
|
| |
|
SceSystemParamTimeFormat | SCE_SYSTEM_PARAM_TIME_FORMAT_24HR |
| | 24-hour clock
|
| |
|
| string | os.keyboard (string title, string default_text, SceUInt32 type, SceUInt32 mode, SceUInt32 option, SceUInt32 dialog_mode, SceUInt32 enter_label, number length) |
| |
| string | os.ime (string title, string default_text, SceUInt32 type, SceUInt32 mode, SceUInt32 option, SceUInt32 dialog_mode, SceUInt32 enter_label, number length) |
| |
| nil | os.closeime () |
| |
| nil | os.abortime () |
| |
| any | os.message (string text, SceUInt32 buttons,...) |
| |
| boolean | os.systemmessage (SceUInt32 type) |
| |
| boolean | os.errormessage (number errorcode) |
| |
| boolean | os.progressmessage (string text) |
| |
| nil | os.progressmessagetext (string text) |
| |
| nil | os.setprogressmessage (number value) |
| |
| nil | os.incprogressmessage (number amount) |
| |
| nil | os.closemessage () |
| |
| nil | os.abortmessage () |
| |
| string | os.importphoto () |
| |
| nil | os.abortphotoimport () |
| |
| string | os.importvideo () |
| |
| nil | os.abortimportvideo () |
| |
| nil | os.photoreview (string path) |
| |
| nil | os.abortphotoreview () |
| |
| image | os.cameraimport () |
| |
| nil | os.abortcameraimport () |
| |
| nil | os.notification (string text) |
| |
|
| nil | os.infobar (SceAppMgrInfoBarVisibility visibility, SceAppMgrInfoBarColor color, SceAppMgrInfoBarTransparency transparency) |
| |
| nil | os.lock (boolean lock, SceShellUtilLockType type,...) |
| |
| nil | os.shuttersound (SceShutterSoundType type) |
| |
| SceAppMgrSystemEventType | os.systemevent () |
| |
◆ os.abortcameraimport()
| nil os.abortcameraimport |
( |
| ) |
|
◆ os.abortime()
Aborts the keyboard dialog
◆ os.abortimportvideo()
| nil os.abortimportvideo |
( |
| ) |
|
Aborts the video import dialog
◆ os.abortmessage()
Aborts the open message dialog
◆ os.abortphotoimport()
| nil os.abortphotoimport |
( |
| ) |
|
Aborts the photo import dialog
◆ os.abortphotoreview()
| nil os.abortphotoreview |
( |
| ) |
|
Aborts the photo review dialog
◆ os.acquirebgm()
| nil os.acquirebgm |
( |
boolean | acquire | ) |
|
Takes or gives back the background music audio port
- Parameters
-
| acquire | true to take it, false to give it back |
◆ os.appdelete()
| nil os.appdelete |
( |
string | titleid | ) |
|
Uninstalls an app. Waits until it's done.
- Parameters
-
| titleid | The app's title ID |
◆ os.appexists()
| boolean os.appexists |
( |
string | titleid | ) |
|
Checks if an app is installed
- Parameters
-
| titleid | The app's title ID |
- Returns
true if it's installed
◆ os.batterycapacity()
| number os.batterycapacity |
( |
| ) |
|
Gets the battery's full capacity
- Returns
- Capacity in mAh
◆ os.batterycyclecount()
| number os.batterycyclecount |
( |
| ) |
|
Gets how many times the battery has been fully charged
- Returns
- The number of charge cycles
◆ os.batterylifetime()
| number os.batterylifetime |
( |
| ) |
|
Gets the estimated remaining battery time
- Returns
- Time in minutes
◆ os.batterypercent()
| number os.batterypercent |
( |
| ) |
|
Gets the battery charge
- Returns
- The charge in percent (0-100)
◆ os.batterySOH()
Gets the battery's health (State Of Health)
- Returns
- Health in percent
◆ os.batterytemperature()
| number os.batterytemperature |
( |
| ) |
|
Gets the battery temperature
- Returns
- Temperature in degrees Celsius
◆ os.batteryvoltage()
| number os.batteryvoltage |
( |
| ) |
|
Gets the battery voltage
- Returns
- Voltage in millivolts
◆ os.bus()
| number os.bus |
( |
number | mhz | ) |
|
Gets or sets the bus clock speed
- Parameters
-
| mhz | New speed in MHz (optional) |
- Returns
- The current speed in MHz if
mhz is omitted
◆ os.cameraimport()
| image os.cameraimport |
( |
| ) |
|
Opens the system's camera dialog so the user can take a photo
- Returns
- The photo as an image, or
nil if the user canceled
◆ os.closeapp()
| nil os.closeapp |
( |
string | titleid | ) |
|
Closes a running app
- Parameters
-
| titleid | The app's title ID |
◆ os.closeime()
Closes the keyboard (the typed text is kept)
◆ os.closemessage()
Closes the open message dialog (like pressing its button)
◆ os.closeotherapps()
| nil os.closeotherapps |
( |
| ) |
|
Closes all the other running apps
◆ os.colorspace()
| nil os.colorspace |
( |
SceInt32 | mode | ) |
|
Sets the screen's color mode
- Parameters
-
| mode | One of the color space mode constants (optional, default: SCE_AVCONFIG_COLOR_SPACE_MODE_DEFAULT) |
◆ os.cpu()
| number os.cpu |
( |
number | mhz | ) |
|
Gets or sets the CPU clock speed
- Parameters
-
| mhz | New speed in MHz (e.g. 333 or 444) (optional) |
- Returns
- The current speed in MHz if
mhz is omitted
◆ os.dateformat()
| SceSystemParamDateFormat os.dateformat |
( |
| ) |
|
Gets the system's date format
- Returns
- One of the date format constants
◆ os.delay()
| nil os.delay |
( |
number | seconds | ) |
|
Pauses the app for some time
- Parameters
-
| seconds | How long to wait, in seconds (decimals allowed) (optional, default: 0) |
◆ os.delaycb()
| nil os.delaycb |
( |
number | seconds | ) |
|
Pauses the app for some time, while letting system callbacks run
- Parameters
-
| seconds | How long to wait, in seconds (decimals allowed) (optional, default: 0) |
◆ os.displayoff()
Turns the screen off (the app keeps running)
◆ os.displayon()
◆ os.errormessage()
| boolean os.errormessage |
( |
number | errorcode | ) |
|
Shows the system's error message for an error code (like C1-2345-6) and waits until it's closed
- Parameters
-
| errorcode | The error code number (e.g. 0x80010002) |
- Returns
false if the user chose "No", otherwise true
◆ os.execute()
| nil os.execute |
( |
string | path, |
|
|
| ... ) |
Starts another program (eboot.bin/SELF) in place of your app
- Parameters
-
| path | Path of the SELF, it must be inside the app's partition (app0:) |
| ... | Strings passed to the program as its arguments (optional) |
◆ os.exit()
Exits the app (standard Lua function)
◆ os.externalbattery()
| boolean os.externalbattery |
( |
| ) |
|
Checks if a charger is connected
- Returns
true if the PS Vita is plugged in
◆ os.factoryfirmware()
| string os.factoryfirmware |
( |
| ) |
|
Gets the firmware version the PS Vita came with from the factory
- Returns
- The version, e.g.
"3.60"
◆ os.getregkey()
| any os.getregkey |
( |
string | category, |
|
|
string | name ) |
Reads a system registry key
- Parameters
-
| category | The key's category (e.g. "/CONFIG/SYSTEM/") |
| name | The key's name (e.g. "username") |
- Returns
- The value (a string or number), or
nil if the key can't be read
◆ os.gpu()
| number os.gpu |
( |
number | mhz | ) |
|
Gets or sets the GPU clock speed
- Parameters
-
| mhz | New speed in MHz (optional) |
- Returns
- The current speed in MHz if
mhz is omitted
◆ os.ime()
| string os.ime |
( |
string | title, |
|
|
string | default_text, |
|
|
SceUInt32 | type, |
|
|
SceUInt32 | mode, |
|
|
SceUInt32 | option, |
|
|
SceUInt32 | dialog_mode, |
|
|
SceUInt32 | enter_label, |
|
|
number | length ) |
Same as os.keyboard()
- Parameters
-
| title | Title shown above the text box |
| default_text | Text already in the text box (optional) |
| type | One of the keyboard type constants (optional) |
| mode | One of the text box mode constants (optional) |
| option | Keyboard option constants, added together (optional) |
| dialog_mode | One of the dialog mode constants (optional) |
| enter_label | One of the enter label constants (optional) |
| length | Maximum number of characters (optional) |
- Returns
- The typed text, or
nil if the user canceled
◆ os.importphoto()
| string os.importphoto |
( |
| ) |
|
Lets the user pick a photo from the Photos app
- Returns
- The path of the chosen photo, or
nil if the user canceled
- Example:
local path = os.importphoto()
if path then picture = image.load(path) end
◆ os.importvideo()
| string os.importvideo |
( |
| ) |
|
Lets the user pick a video from the Videos app
- Returns
- The path of the chosen video, or
nil if the user canceled
◆ os.incprogressmessage()
| nil os.incprogressmessage |
( |
number | amount | ) |
|
Increases the value of the open progress message's bar
- Parameters
-
◆ os.infobar()
| nil os.infobar |
( |
SceAppMgrInfoBarVisibility | visibility, |
|
|
SceAppMgrInfoBarColor | color, |
|
|
SceAppMgrInfoBarTransparency | transparency ) |
Shows, hides or changes the info bar (the bar at the top of the screen with the clock and battery)
- Parameters
-
| visibility | SCE_APPMGR_INFOBAR_VISIBILITY_VISIBLE or SCE_APPMGR_INFOBAR_VISIBILITY_INVISIBLE (optional, default: invisible) |
| color | SCE_APPMGR_INFOBAR_COLOR_BLACK or SCE_APPMGR_INFOBAR_COLOR_WHITE (optional, default: black) |
| transparency | SCE_APPMGR_INFOBAR_TRANSPARENCY_OPAQUE or SCE_APPMGR_INFOBAR_TRANSPARENCY_TRANSLUCENT (optional, default: opaque) |
- Example:
os.infobar(INFOBAR_VISIBILITY_VISIBLE, INFOBAR_COLOR_WHITE, INFOBAR_TRANSPARENCY_TRANSLUCENT)
◆ os.installdir()
| nil os.installdir |
( |
string | path, |
|
|
boolean | has_headbin ) |
Installs an app from a folder (the extracted contents of a .VPK). Waits until it's done.
- Parameters
-
| path | Path of the folder |
| has_headbin | true if the folder already has a sce_sys/package/head.bin, false to have one made (optional, default: false) |
◆ os.installvpk()
| nil os.installvpk |
( |
string | path, |
|
|
boolean | has_headbin ) |
Installs a .VPK file. It's extracted to ux0:data/ll_temp first, then installed with os.installdir().
- Parameters
-
| path | Path of the .VPK |
| has_headbin | true if the .VPK already has a sce_sys/package/head.bin (optional, default: false) |
◆ os.isbatterycharging()
| boolean os.isbatterycharging |
( |
| ) |
|
Checks if the battery is charging
- Returns
true if it's charging
◆ os.isbatterylow()
| boolean os.isbatterylow |
( |
| ) |
|
Checks if the battery is low
- Returns
true if it's low
◆ os.iscex()
Checks if the console is a retail (CEX) unit
- Returns
true on a retail unit
◆ os.isdex()
Checks if the console is a debug/testing (DEX) unit
- Returns
true on a DEX unit
◆ os.ispstv()
Checks if the console is a PS TV
- Returns
true on a PS TV
◆ os.istest()
Checks if the console is a test unit
- Returns
true on a test unit
◆ os.istool()
Checks if the console is a development kit (TOOL)
- Returns
true on a development kit
◆ os.isvita()
Checks if the console is a PS Vita handheld
- Returns
true on a PS Vita
◆ os.keyboard()
| string os.keyboard |
( |
string | title, |
|
|
string | default_text, |
|
|
SceUInt32 | type, |
|
|
SceUInt32 | mode, |
|
|
SceUInt32 | option, |
|
|
SceUInt32 | dialog_mode, |
|
|
SceUInt32 | enter_label, |
|
|
number | length ) |
Shows the system keyboard and waits for the user to type something.
os.ime() is the same function under another name.
- Parameters
-
| title | Title shown above the text box |
| default_text | Text already in the text box (optional, default: empty) |
| type | One of the keyboard type constants (optional, default: SCE_IME_TYPE_DEFAULT) |
| mode | One of the text box mode constants (optional, default: SCE_IME_DIALOG_TEXTBOX_MODE_DEFAULT) |
| option | Keyboard option constants, added together (optional, default: none) |
| dialog_mode | One of the dialog mode constants (optional, default: SCE_IME_DIALOG_DIALOG_MODE_DEFAULT) |
| enter_label | One of the enter label constants (optional, default: SCE_IME_ENTER_LABEL_DEFAULT) |
| length | Maximum number of characters (optional, default: the system maximum) |
- Returns
- The typed text, or
nil if the user canceled
- Example:
SceUInt32 SCE_IME_DIALOG_TEXTBOX_MODE_PASSWORD
Hides the typed text, for passwords.
Definition lj_os.h:690
SceUInt32 SCE_IME_TYPE_NUMBER
Number pad.
Definition lj_os.h:681
◆ os.language()
| SceSystemParamLang os.language |
( |
| ) |
|
Gets the system language
- Returns
- One of the language constants
- Example:
local greeting = "Hello"
SceSystemParamLang SCE_SYSTEM_PARAM_LANG_FRENCH
French.
Definition lj_os.h:773
◆ os.launchparams()
| string os.launchparams |
( |
| ) |
|
Gets the parameters your app was launched with (e.g. from a URI)
- Returns
- The parameters as a string
◆ os.lock()
| nil os.lock |
( |
boolean | lock, |
|
|
SceShellUtilLockType | type, |
|
|
| ... ) |
Blocks or unblocks system features, like the PS button or the quick menu
- Parameters
-
| lock | true to block, false to unblock |
| type | One or more shell lock type constants, as separate parameters |
| ... | More shell lock type constants |
- Example:
-- ...
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_PS_BTN
The PS button (pressing it can then be detected with SCE_CTRL_PSBUTTON)
Definition lj_os.h:653
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_QUICK_MENU
The quick menu (holding the PS button)
Definition lj_os.h:654
◆ os.message()
| any os.message |
( |
string | text, |
|
|
SceUInt32 | buttons, |
|
|
| ... ) |
Shows a message dialog and waits until it's closed
With SCE_MSG_DIALOG_BUTTON_TYPE_3BUTTONS, 6 more parameters are required: the text and font size of each button.
- Parameters
-
| text | The message |
| buttons | One of the message dialog button constants (optional, default: SCE_MSG_DIALOG_BUTTON_TYPE_OK) |
| ... | The 3 button texts and font sizes, only for SCE_MSG_DIALOG_BUTTON_TYPE_3BUTTONS |
- Returns
false if the user chose "No" (or the dialog was invalid), otherwise true. With 3 buttons: the text of the chosen button, or nil if none was chosen.
- Example:
io.delete("ux0:data/myapp/save.txt")
end
-- level is "Easy", "Normal" or "Hard"
SceUInt32 SCE_MSG_DIALOG_FONT_SIZE_DEFAULT
Normal size.
Definition lj_os.h:727
SceUInt32 SCE_MSG_DIALOG_BUTTON_TYPE_3BUTTONS
3 buttons with your own text
Definition lj_os.h:722
SceUInt32 SCE_MSG_DIALOG_BUTTON_TYPE_YESNO
Yes and No buttons.
Definition lj_os.h:718
◆ os.musicexport()
| boolean os.musicexport |
( |
string | path | ) |
|
Copies a song into the Music app
- Parameters
-
| path | Path of the song (.MP3) |
- Returns
true on success
◆ os.mute()
◆ os.notification()
| nil os.notification |
( |
string | text | ) |
|
Shows a notification (the kind that slides in from the top of the screen)
- Parameters
-
| text | The notification text |
◆ os.photoexport()
| boolean os.photoexport |
( |
string | path | ) |
|
Copies a photo into the Photos app
- Parameters
-
| path | Path of the photo (.PNG, .JPG/.JPEG, .BMP) |
- Returns
true on success
◆ os.photoreview()
| nil os.photoreview |
( |
string | path | ) |
|
Opens a photo in the system's photo viewer
- Parameters
-
◆ os.powerlock()
| nil os.powerlock |
( |
SceKernelPowerTickType | type | ) |
|
Prevents the PS Vita from going to sleep until os.powerunlock() is called
- Parameters
-
| type | One of the power tick type constants (optional, default: SCE_KERNEL_POWER_TICK_DEFAULT) |
◆ os.powertick()
| nil os.powertick |
( |
SceKernelPowerTickType | type | ) |
|
Resets power timers, so the screen doesn't dim/turn off and the PS Vita doesn't fall asleep. Call it regularly (e.g. once per frame) while you want to keep the PS Vita awake, like during a video.
- Parameters
-
| type | One of the power tick type constants (optional, default: SCE_KERNEL_POWER_TICK_DEFAULT) |
◆ os.powerunlock()
| nil os.powerunlock |
( |
SceKernelPowerTickType | type | ) |
|
Allows the PS Vita to go to sleep again after os.powerlock()
- Parameters
-
| type | One of the power tick type constants (optional, default: SCE_KERNEL_POWER_TICK_DEFAULT) |
◆ os.progressmessage()
| boolean os.progressmessage |
( |
string | text | ) |
|
Shows a message with a progress bar and waits until it's closed. Because this waits, the progress bar is updated from the LifeLuaProgressMessageDialog() callback, using os.setprogressmessage(), os.incprogressmessage() and os.progressmessagetext(), then closed with os.closemessage().
- Parameters
-
- Returns
true when it's closed
- Example:
local progress = 0
function LifeLuaProgressMessageDialog()
progress = progress + 1
os.setprogressmessage(progress)
if progress >= 100 then os.closemessage() end
end
os.progressmessage("Loading...")
◆ os.progressmessagetext()
| nil os.progressmessagetext |
( |
string | text | ) |
|
Changes the text of the open progress message
- Parameters
-
◆ os.realfirmware()
| string os.realfirmware |
( |
| ) |
|
Gets the real firmware version
- Returns
- The version, e.g.
"3.65"
◆ os.remainingbatterycapacity()
| number os.remainingbatterycapacity |
( |
| ) |
|
Gets the battery's remaining capacity
- Returns
- Remaining capacity in mAh
◆ os.requiremodule()
| nil os.requiremodule |
( |
string | path | ) |
|
Loads and starts a user module (.SUPRX), giving it the Lua state so it can add its own Lua functions
- Parameters
-
◆ os.restart()
◆ os.runningapps()
| table os.runningapps |
( |
number | max | ) |
|
Gets the title IDs of the apps that are running
- Parameters
-
| max | Maximum number of apps to list (optional, default: 100) |
- Returns
- A list of title IDs
◆ os.screenshot()
| nil os.screenshot |
( |
boolean | enable | ) |
|
Allows or blocks taking screenshots (PS button + Start) in your app
- Parameters
-
| enable | true to allow, false to block |
◆ os.screenshotcapture()
| nil os.screenshotcapture |
( |
number | mode | ) |
|
Takes a screenshot and saves it to the Photos app, like pressing PS button + Start
- Parameters
-
| mode | 0 for a normal screenshot, 1 to take it even if screenshots are blocked (optional, default: 1) |
◆ os.screenshotinfo()
| nil os.screenshotinfo |
( |
string | photo_title, |
|
|
string | game_title, |
|
|
string | game_comment ) |
Sets the information saved with screenshots taken in your app
- Parameters
-
| photo_title | Title of the photo (optional) |
| game_title | Title of the game (optional) |
| game_comment | A comment (optional) |
◆ os.screenshotnotification()
| nil os.screenshotnotification |
( |
boolean | enable | ) |
|
Shows or hides the notification that appears after taking a screenshot
- Parameters
-
| enable | true to show it, false to hide it |
◆ os.screenshotoverlay()
| nil os.screenshotoverlay |
( |
string | path, |
|
|
number | x, |
|
|
number | y ) |
Sets an image that's drawn over every screenshot taken in your app, like a watermark
- Parameters
-
| path | Path of the image (.PNG) |
| x | X position of the image (optional, default: 0) |
| y | Y position of the image (optional, default: 0) |
◆ os.setprogressmessage()
| nil os.setprogressmessage |
( |
number | value | ) |
|
Sets the value of the open progress message's bar
- Parameters
-
| value | Progress from 0 to 100 |
◆ os.setregkey()
| nil os.setregkey |
( |
string | category, |
|
|
string | name, |
|
|
any | value, |
|
|
number | size ) |
Writes a system registry key
- Warning
- Wrong registry values can break system settings. Only change keys you know.
- Parameters
-
| category | The key's category |
| name | The key's name |
| value | The new value, a number or a string |
| size | Size of a string/binary value in bytes (optional, default: the length of value) |
◆ os.shutdown()
◆ os.shuttersound()
| nil os.shuttersound |
( |
SceShutterSoundType | type | ) |
|
Plays the camera shutter sound
- Parameters
-
| type | One of the shutter sound type constants |
◆ os.spoofedfirmware()
| string os.spoofedfirmware |
( |
| ) |
|
Gets the firmware version the system reports (it can be spoofed by plugins)
- Returns
- The version, e.g.
"3.74"
◆ os.standby()
◆ os.suspend()
Puts the PS Vita to sleep (rest mode)
◆ os.suspendneeded()
| boolean os.suspendneeded |
( |
| ) |
|
Checks if the system wants the app to let the PS Vita go to sleep
- Returns
true if a sleep is needed
◆ os.systemevent()
| SceAppMgrSystemEventType os.systemevent |
( |
| ) |
|
Gets the next system event, like waking up from sleep
- Returns
- One of the system event constants
◆ os.systemmessage()
| boolean os.systemmessage |
( |
SceUInt32 | type | ) |
|
Shows one of the system's built-in messages and waits until it's closed
- Parameters
-
| type | One of the system message type constants |
- Returns
false if the user chose "No", otherwise true
◆ os.timeformat()
| SceSystemParamTimeFormat os.timeformat |
( |
| ) |
|
Gets the system's time format
- Returns
- One of the time format constants
◆ os.title()
Gets your app's title (as shown in the LiveArea)
- Returns
- The title
◆ os.titleid()
Gets your app's title ID
- Returns
- The title ID, e.g.
"LIFELUAJT"
◆ os.unmountmountpoint()
| nil os.unmountmountpoint |
( |
string | mountpoint | ) |
|
Unmounts a mount point
- Parameters
-
| mountpoint | The mount point |
◆ os.unsafe()
Checks if the app is running in unsafe mode (enabled in HENkaku's settings), which is needed for some features
- Returns
true if unsafe mode is on
◆ os.uri()
| nil os.uri |
( |
string | uri, |
|
|
number | flag ) |
Opens a URI, which can launch other apps or open a website in the browser
- Parameters
-
| uri | The URI (e.g. "psgm:play?titleid=VITASHELL" or "https://example.com") |
| flag | Launch flags (optional, default: 0xFFFFF) |
◆ os.username()
Gets the PSN/system user name
- Returns
- The user name
◆ os.videoexport()
| boolean os.videoexport |
( |
string | path | ) |
|
Copies a video into the Videos app
- Parameters
-
| path | Path of the video (.MP4) |
- Returns
true on success
◆ os.volume()
| number os.volume |
( |
number | volume | ) |
|
Gets or sets the system volume
- Parameters
-
| volume | New volume, from 0 to 30 (optional) |
- Returns
- The current volume (0-30) if
volume is omitted
◆ os.xbar()
| number os.xbar |
( |
number | mhz | ) |
|
Gets or sets the GPU crossbar (XBAR) clock speed
- Parameters
-
| mhz | New speed in MHz (optional) |
- Returns
- The current speed in MHz if
mhz is omitted