class_os.rst 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_OS:
  4. OS
  5. ==
  6. **Inherits:** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Operating System functions.
  11. Member Functions
  12. ----------------
  13. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`alert<class_OS_alert>` **(** :ref:`String<class_string>` text, :ref:`String<class_string>` title="Alert!" **)** |
  15. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`can_draw<class_OS_can_draw>` **(** **)** const |
  17. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`can_use_threads<class_OS_can_use_threads>` **(** **)** const |
  19. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`delay_msec<class_OS_delay_msec>` **(** :ref:`int<class_int>` msec **)** const |
  21. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`delay_usec<class_OS_delay_usec>` **(** :ref:`int<class_int>` usec **)** const |
  23. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`dump_memory_to_file<class_OS_dump_memory_to_file>` **(** :ref:`String<class_string>` file **)** |
  25. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`dump_resources_to_file<class_OS_dump_resources_to_file>` **(** :ref:`String<class_string>` file **)** |
  27. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`int<class_int>` | :ref:`execute<class_OS_execute>` **(** :ref:`String<class_string>` path, :ref:`PoolStringArray<class_poolstringarray>` arguments, :ref:`bool<class_bool>` blocking, :ref:`Array<class_array>` output=[] **)** |
  29. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`int<class_int>` | :ref:`find_scancode_from_string<class_OS_find_scancode_from_string>` **(** :ref:`String<class_string>` string **)** const |
  31. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`get_borderless_window<class_OS_get_borderless_window>` **(** **)** const |
  33. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`String<class_string>` | :ref:`get_clipboard<class_OS_get_clipboard>` **(** **)** const |
  35. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`PoolStringArray<class_poolstringarray>` | :ref:`get_cmdline_args<class_OS_get_cmdline_args>` **(** **)** |
  37. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`int<class_int>` | :ref:`get_current_screen<class_OS_get_current_screen>` **(** **)** const |
  39. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`String<class_string>` | :ref:`get_data_dir<class_OS_get_data_dir>` **(** **)** const |
  41. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`Dictionary<class_dictionary>` | :ref:`get_date<class_OS_get_date>` **(** :ref:`bool<class_bool>` utc=false **)** const |
  43. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`Dictionary<class_dictionary>` | :ref:`get_datetime<class_OS_get_datetime>` **(** :ref:`bool<class_bool>` utc=false **)** const |
  45. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Dictionary<class_dictionary>` | :ref:`get_datetime_from_unix_time<class_OS_get_datetime_from_unix_time>` **(** :ref:`int<class_int>` unix_time_val **)** const |
  47. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`int<class_int>` | :ref:`get_dynamic_memory_usage<class_OS_get_dynamic_memory_usage>` **(** **)** const |
  49. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`String<class_string>` | :ref:`get_environment<class_OS_get_environment>` **(** :ref:`String<class_string>` environment **)** const |
  51. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`String<class_string>` | :ref:`get_executable_path<class_OS_get_executable_path>` **(** **)** const |
  53. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`int<class_int>` | :ref:`get_exit_code<class_OS_get_exit_code>` **(** **)** const |
  55. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`String<class_string>` | :ref:`get_latin_keyboard_variant<class_OS_get_latin_keyboard_variant>` **(** **)** const |
  57. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`String<class_string>` | :ref:`get_locale<class_OS_get_locale>` **(** **)** const |
  59. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`String<class_string>` | :ref:`get_model_name<class_OS_get_model_name>` **(** **)** const |
  61. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`String<class_string>` | :ref:`get_name<class_OS_get_name>` **(** **)** const |
  63. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`int<class_int>` | :ref:`get_power_percent_left<class_OS_get_power_percent_left>` **(** **)** |
  65. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`get_power_seconds_left<class_OS_get_power_seconds_left>` **(** **)** |
  67. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`int<class_int>` | :ref:`get_power_state<class_OS_get_power_state>` **(** **)** |
  69. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`int<class_int>` | :ref:`get_process_ID<class_OS_get_process_ID>` **(** **)** const |
  71. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`int<class_int>` | :ref:`get_processor_count<class_OS_get_processor_count>` **(** **)** const |
  73. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`String<class_string>` | :ref:`get_scancode_string<class_OS_get_scancode_string>` **(** :ref:`int<class_int>` code **)** const |
  75. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`int<class_int>` | :ref:`get_screen_count<class_OS_get_screen_count>` **(** **)** const |
  77. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`int<class_int>` | :ref:`get_screen_dpi<class_OS_get_screen_dpi>` **(** :ref:`int<class_int>` screen=0 **)** const |
  79. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`int<class_int>` | :ref:`get_screen_orientation<class_OS_get_screen_orientation>` **(** **)** const |
  81. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`Vector2<class_vector2>` | :ref:`get_screen_position<class_OS_get_screen_position>` **(** :ref:`int<class_int>` screen=0 **)** const |
  83. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`Vector2<class_vector2>` | :ref:`get_screen_size<class_OS_get_screen_size>` **(** :ref:`int<class_int>` screen=0 **)** const |
  85. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`int<class_int>` | :ref:`get_splash_tick_msec<class_OS_get_splash_tick_msec>` **(** **)** const |
  87. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`int<class_int>` | :ref:`get_static_memory_peak_usage<class_OS_get_static_memory_peak_usage>` **(** **)** const |
  89. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`int<class_int>` | :ref:`get_static_memory_usage<class_OS_get_static_memory_usage>` **(** **)** const |
  91. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`String<class_string>` | :ref:`get_system_dir<class_OS_get_system_dir>` **(** :ref:`int<class_int>` dir **)** const |
  93. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`int<class_int>` | :ref:`get_system_time_secs<class_OS_get_system_time_secs>` **(** **)** const |
  95. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`int<class_int>` | :ref:`get_ticks_msec<class_OS_get_ticks_msec>` **(** **)** const |
  97. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`Dictionary<class_dictionary>` | :ref:`get_time<class_OS_get_time>` **(** :ref:`bool<class_bool>` utc=false **)** const |
  99. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`Dictionary<class_dictionary>` | :ref:`get_time_zone_info<class_OS_get_time_zone_info>` **(** **)** const |
  101. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`String<class_string>` | :ref:`get_unique_ID<class_OS_get_unique_ID>` **(** **)** const |
  103. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`int<class_int>` | :ref:`get_unix_time<class_OS_get_unix_time>` **(** **)** const |
  105. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`int<class_int>` | :ref:`get_unix_time_from_datetime<class_OS_get_unix_time_from_datetime>` **(** :ref:`Dictionary<class_dictionary>` datetime **)** const |
  107. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`Vector2<class_vector2>` | :ref:`get_window_position<class_OS_get_window_position>` **(** **)** const |
  109. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`Vector2<class_vector2>` | :ref:`get_window_size<class_OS_get_window_size>` **(** **)** const |
  111. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`bool<class_bool>` | :ref:`has_environment<class_OS_has_environment>` **(** :ref:`String<class_string>` environment **)** const |
  113. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`bool<class_bool>` | :ref:`has_touchscreen_ui_hint<class_OS_has_touchscreen_ui_hint>` **(** **)** const |
  115. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`bool<class_bool>` | :ref:`has_virtual_keyboard<class_OS_has_virtual_keyboard>` **(** **)** const |
  117. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | void | :ref:`hide_virtual_keyboard<class_OS_hide_virtual_keyboard>` **(** **)** |
  119. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`bool<class_bool>` | :ref:`is_debug_build<class_OS_is_debug_build>` **(** **)** const |
  121. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`bool<class_bool>` | :ref:`is_in_low_processor_usage_mode<class_OS_is_in_low_processor_usage_mode>` **(** **)** const |
  123. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`bool<class_bool>` | :ref:`is_keep_screen_on<class_OS_is_keep_screen_on>` **(** **)** const |
  125. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`bool<class_bool>` | :ref:`is_ok_left_and_cancel_right<class_OS_is_ok_left_and_cancel_right>` **(** **)** const |
  127. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`bool<class_bool>` | :ref:`is_scancode_unicode<class_OS_is_scancode_unicode>` **(** :ref:`int<class_int>` code **)** const |
  129. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`bool<class_bool>` | :ref:`is_stdout_verbose<class_OS_is_stdout_verbose>` **(** **)** const |
  131. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`bool<class_bool>` | :ref:`is_vsync_enabled<class_OS_is_vsync_enabled>` **(** **)** const |
  133. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | :ref:`bool<class_bool>` | :ref:`is_window_fullscreen<class_OS_is_window_fullscreen>` **(** **)** const |
  135. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`bool<class_bool>` | :ref:`is_window_maximized<class_OS_is_window_maximized>` **(** **)** const |
  137. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | :ref:`bool<class_bool>` | :ref:`is_window_minimized<class_OS_is_window_minimized>` **(** **)** const |
  139. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | :ref:`bool<class_bool>` | :ref:`is_window_resizable<class_OS_is_window_resizable>` **(** **)** const |
  141. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | :ref:`int<class_int>` | :ref:`kill<class_OS_kill>` **(** :ref:`int<class_int>` pid **)** |
  143. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | :ref:`bool<class_bool>` | :ref:`native_video_is_playing<class_OS_native_video_is_playing>` **(** **)** |
  145. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | void | :ref:`native_video_pause<class_OS_native_video_pause>` **(** **)** |
  147. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`int<class_int>` | :ref:`native_video_play<class_OS_native_video_play>` **(** :ref:`String<class_string>` path, :ref:`float<class_float>` volume, :ref:`String<class_string>` audio_track, :ref:`String<class_string>` subtitle_track **)** |
  149. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | void | :ref:`native_video_stop<class_OS_native_video_stop>` **(** **)** |
  151. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | void | :ref:`native_video_unpause<class_OS_native_video_unpause>` **(** **)** |
  153. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | void | :ref:`print_all_resources<class_OS_print_all_resources>` **(** :ref:`String<class_string>` tofile="" **)** |
  155. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | void | :ref:`print_all_textures_by_size<class_OS_print_all_textures_by_size>` **(** **)** |
  157. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | void | :ref:`print_resources_by_type<class_OS_print_resources_by_type>` **(** :ref:`PoolStringArray<class_poolstringarray>` types **)** |
  159. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | void | :ref:`print_resources_in_use<class_OS_print_resources_in_use>` **(** :ref:`bool<class_bool>` short=false **)** |
  161. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | void | :ref:`request_attention<class_OS_request_attention>` **(** **)** |
  163. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | void | :ref:`set_borderless_window<class_OS_set_borderless_window>` **(** :ref:`bool<class_bool>` borderless **)** |
  165. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | void | :ref:`set_clipboard<class_OS_set_clipboard>` **(** :ref:`String<class_string>` clipboard **)** |
  167. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | void | :ref:`set_current_screen<class_OS_set_current_screen>` **(** :ref:`int<class_int>` screen **)** |
  169. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | void | :ref:`set_exit_code<class_OS_set_exit_code>` **(** :ref:`int<class_int>` code **)** |
  171. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | void | :ref:`set_icon<class_OS_set_icon>` **(** :ref:`Object<class_object>` icon **)** |
  173. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | void | :ref:`set_keep_screen_on<class_OS_set_keep_screen_on>` **(** :ref:`bool<class_bool>` enabled **)** |
  175. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | void | :ref:`set_low_processor_usage_mode<class_OS_set_low_processor_usage_mode>` **(** :ref:`bool<class_bool>` enable **)** |
  177. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | void | :ref:`set_screen_orientation<class_OS_set_screen_orientation>` **(** :ref:`int<class_int>` orientation **)** |
  179. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`int<class_int>` | :ref:`set_thread_name<class_OS_set_thread_name>` **(** :ref:`String<class_string>` name **)** |
  181. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | void | :ref:`set_use_file_access_save_and_swap<class_OS_set_use_file_access_save_and_swap>` **(** :ref:`bool<class_bool>` enabled **)** |
  183. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | void | :ref:`set_use_vsync<class_OS_set_use_vsync>` **(** :ref:`bool<class_bool>` enable **)** |
  185. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | void | :ref:`set_window_fullscreen<class_OS_set_window_fullscreen>` **(** :ref:`bool<class_bool>` enabled **)** |
  187. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | void | :ref:`set_window_maximized<class_OS_set_window_maximized>` **(** :ref:`bool<class_bool>` enabled **)** |
  189. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | void | :ref:`set_window_minimized<class_OS_set_window_minimized>` **(** :ref:`bool<class_bool>` enabled **)** |
  191. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | void | :ref:`set_window_position<class_OS_set_window_position>` **(** :ref:`Vector2<class_vector2>` position **)** |
  193. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | void | :ref:`set_window_resizable<class_OS_set_window_resizable>` **(** :ref:`bool<class_bool>` enabled **)** |
  195. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | void | :ref:`set_window_size<class_OS_set_window_size>` **(** :ref:`Vector2<class_vector2>` size **)** |
  197. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | void | :ref:`set_window_title<class_OS_set_window_title>` **(** :ref:`String<class_string>` title **)** |
  199. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`int<class_int>` | :ref:`shell_open<class_OS_shell_open>` **(** :ref:`String<class_string>` uri **)** |
  201. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | void | :ref:`show_virtual_keyboard<class_OS_show_virtual_keyboard>` **(** :ref:`String<class_string>` existing_text="" **)** |
  203. +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. Numeric Constants
  205. -----------------
  206. - **DAY_SUNDAY** = **0**
  207. - **DAY_MONDAY** = **1**
  208. - **DAY_TUESDAY** = **2**
  209. - **DAY_WEDNESDAY** = **3**
  210. - **DAY_THURSDAY** = **4**
  211. - **DAY_FRIDAY** = **5**
  212. - **DAY_SATURDAY** = **6**
  213. - **MONTH_JANUARY** = **1**
  214. - **MONTH_FEBRUARY** = **2**
  215. - **MONTH_MARCH** = **3**
  216. - **MONTH_APRIL** = **4**
  217. - **MONTH_MAY** = **5**
  218. - **MONTH_JUNE** = **6**
  219. - **MONTH_JULY** = **7**
  220. - **MONTH_AUGUST** = **8**
  221. - **MONTH_SEPTEMBER** = **9**
  222. - **MONTH_OCTOBER** = **10**
  223. - **MONTH_NOVEMBER** = **11**
  224. - **MONTH_DECEMBER** = **12**
  225. - **SCREEN_ORIENTATION_LANDSCAPE** = **0**
  226. - **SCREEN_ORIENTATION_PORTRAIT** = **1**
  227. - **SCREEN_ORIENTATION_REVERSE_LANDSCAPE** = **2**
  228. - **SCREEN_ORIENTATION_REVERSE_PORTRAIT** = **3**
  229. - **SCREEN_ORIENTATION_SENSOR_LANDSCAPE** = **4**
  230. - **SCREEN_ORIENTATION_SENSOR_PORTRAIT** = **5**
  231. - **SCREEN_ORIENTATION_SENSOR** = **6**
  232. - **SYSTEM_DIR_DESKTOP** = **0**
  233. - **SYSTEM_DIR_DCIM** = **1**
  234. - **SYSTEM_DIR_DOCUMENTS** = **2**
  235. - **SYSTEM_DIR_DOWNLOADS** = **3**
  236. - **SYSTEM_DIR_MOVIES** = **4**
  237. - **SYSTEM_DIR_MUSIC** = **5**
  238. - **SYSTEM_DIR_PICTURES** = **6**
  239. - **SYSTEM_DIR_RINGTONES** = **7**
  240. - **POWERSTATE_UNKNOWN** = **0**
  241. - **POWERSTATE_ON_BATTERY** = **1**
  242. - **POWERSTATE_NO_BATTERY** = **2**
  243. - **POWERSTATE_CHARGING** = **3**
  244. - **POWERSTATE_CHARGED** = **4**
  245. Description
  246. -----------
  247. Operating System functions. OS Wraps the most common functionality to communicate with the host Operating System, such as: mouse grabbing, mouse cursors, clipboard, video mode, date and time, timers, environment variables, execution of binaries, command line, etc.
  248. Member Function Description
  249. ---------------------------
  250. .. _class_OS_alert:
  251. - void **alert** **(** :ref:`String<class_string>` text, :ref:`String<class_string>` title="Alert!" **)**
  252. Displays a modal dialog box utilizing the host OS.
  253. .. _class_OS_can_draw:
  254. - :ref:`bool<class_bool>` **can_draw** **(** **)** const
  255. Return true if the host OS allows drawing.
  256. .. _class_OS_can_use_threads:
  257. - :ref:`bool<class_bool>` **can_use_threads** **(** **)** const
  258. Returns if the current host platform is using multiple threads.
  259. .. _class_OS_delay_msec:
  260. - void **delay_msec** **(** :ref:`int<class_int>` msec **)** const
  261. Delay executing of the current thread by given milliseconds.
  262. .. _class_OS_delay_usec:
  263. - void **delay_usec** **(** :ref:`int<class_int>` usec **)** const
  264. Delay executing of the current thread by given microseconds.
  265. .. _class_OS_dump_memory_to_file:
  266. - void **dump_memory_to_file** **(** :ref:`String<class_string>` file **)**
  267. Dumps the memory allocation ringlist to a file (only works in debug).
  268. Entry format per line: "Address - Size - Description"
  269. .. _class_OS_dump_resources_to_file:
  270. - void **dump_resources_to_file** **(** :ref:`String<class_string>` file **)**
  271. Dumps all used resources to file (only works in debug).
  272. Entry format per line: "Resource Type : Resource Location"
  273. At the end of the file is a statistic of all used Resource Types.
  274. .. _class_OS_execute:
  275. - :ref:`int<class_int>` **execute** **(** :ref:`String<class_string>` path, :ref:`PoolStringArray<class_poolstringarray>` arguments, :ref:`bool<class_bool>` blocking, :ref:`Array<class_array>` output=[] **)**
  276. Execute the binary file in given path, optionally blocking until it returns. A process ID is returned.
  277. .. _class_OS_find_scancode_from_string:
  278. - :ref:`int<class_int>` **find_scancode_from_string** **(** :ref:`String<class_string>` string **)** const
  279. Returns the scancode of the given string (e.g. "Escape")
  280. .. _class_OS_get_borderless_window:
  281. - :ref:`bool<class_bool>` **get_borderless_window** **(** **)** const
  282. Returns true if the current window is borderless.
  283. .. _class_OS_get_clipboard:
  284. - :ref:`String<class_string>` **get_clipboard** **(** **)** const
  285. Get clipboard from the host OS.
  286. .. _class_OS_get_cmdline_args:
  287. - :ref:`PoolStringArray<class_poolstringarray>` **get_cmdline_args** **(** **)**
  288. Return the commandline passed to the engine.
  289. .. _class_OS_get_current_screen:
  290. - :ref:`int<class_int>` **get_current_screen** **(** **)** const
  291. Returns the current screen index (0 padded).
  292. .. _class_OS_get_data_dir:
  293. - :ref:`String<class_string>` **get_data_dir** **(** **)** const
  294. Return the absolute directory path of user data path(:ref:`user://<class_user://>`).
  295. .. _class_OS_get_date:
  296. - :ref:`Dictionary<class_dictionary>` **get_date** **(** :ref:`bool<class_bool>` utc=false **)** const
  297. Returns current date as a dictionary of keys: year, month, day, weekday, dst (daylight savings time).
  298. .. _class_OS_get_datetime:
  299. - :ref:`Dictionary<class_dictionary>` **get_datetime** **(** :ref:`bool<class_bool>` utc=false **)** const
  300. Returns current datetime as a dictionary of keys: year, month, day, weekday, dst (daylight savings time), hour, minute, second.
  301. .. _class_OS_get_datetime_from_unix_time:
  302. - :ref:`Dictionary<class_dictionary>` **get_datetime_from_unix_time** **(** :ref:`int<class_int>` unix_time_val **)** const
  303. Get a dictionary of time values when given epoch time.
  304. Dictionary Time values will be a union of values from :ref:`get_time<class_OS_get_time>` and :ref:`get_date<class_OS_get_date>` dictionaries (with the exception of dst = day light standard time, as it cannot be determined from epoch).
  305. .. _class_OS_get_dynamic_memory_usage:
  306. - :ref:`int<class_int>` **get_dynamic_memory_usage** **(** **)** const
  307. Return the total amount of dynamic memory used (only works in debug).
  308. .. _class_OS_get_environment:
  309. - :ref:`String<class_string>` **get_environment** **(** :ref:`String<class_string>` environment **)** const
  310. Return an environment variable.
  311. .. _class_OS_get_executable_path:
  312. - :ref:`String<class_string>` **get_executable_path** **(** **)** const
  313. Return the path to the current engine executable.
  314. .. _class_OS_get_exit_code:
  315. - :ref:`int<class_int>` **get_exit_code** **(** **)** const
  316. .. _class_OS_get_latin_keyboard_variant:
  317. - :ref:`String<class_string>` **get_latin_keyboard_variant** **(** **)** const
  318. Returns the current latin keyboard variant as a String.
  319. Possible return values are: "QWERTY", "AZERTY", "QZERTY", "DVORAK", "NEO" or "ERROR"
  320. .. _class_OS_get_locale:
  321. - :ref:`String<class_string>` **get_locale** **(** **)** const
  322. Return the host OS locale.
  323. .. _class_OS_get_model_name:
  324. - :ref:`String<class_string>` **get_model_name** **(** **)** const
  325. Returns the model name of the current device.
  326. .. _class_OS_get_name:
  327. - :ref:`String<class_string>` **get_name** **(** **)** const
  328. Return the name of the host OS. Possible values are: "Android", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "UWP", "X11".
  329. .. _class_OS_get_power_percent_left:
  330. - :ref:`int<class_int>` **get_power_percent_left** **(** **)**
  331. .. _class_OS_get_power_seconds_left:
  332. - :ref:`int<class_int>` **get_power_seconds_left** **(** **)**
  333. .. _class_OS_get_power_state:
  334. - :ref:`int<class_int>` **get_power_state** **(** **)**
  335. .. _class_OS_get_process_ID:
  336. - :ref:`int<class_int>` **get_process_ID** **(** **)** const
  337. Returns the game process ID
  338. .. _class_OS_get_processor_count:
  339. - :ref:`int<class_int>` **get_processor_count** **(** **)** const
  340. Returns the number of cores available in the host machine.
  341. .. _class_OS_get_scancode_string:
  342. - :ref:`String<class_string>` **get_scancode_string** **(** :ref:`int<class_int>` code **)** const
  343. Returns the given scancode as a string (e.g. Return values: "Escape", "Shift+Escape").
  344. .. _class_OS_get_screen_count:
  345. - :ref:`int<class_int>` **get_screen_count** **(** **)** const
  346. Returns the number of displays attached to the host machine
  347. .. _class_OS_get_screen_dpi:
  348. - :ref:`int<class_int>` **get_screen_dpi** **(** :ref:`int<class_int>` screen=0 **)** const
  349. Returns the dots per inch density of the specified screen.
  350. On Android Devices, the actual screen densities are grouped into six generalized densities:
  351. ldpi - 120 dpi
  352. mdpi - 160 dpi
  353. hdpi - 240 dpi
  354. xhdpi - 320 dpi
  355. xxhdpi - 480 dpi
  356. xxxhdpi - 640 dpi
  357. .. _class_OS_get_screen_orientation:
  358. - :ref:`int<class_int>` **get_screen_orientation** **(** **)** const
  359. Returns the current screen orientation, the return value will be one of the SCREEN_ORIENTATION constants in this class.
  360. .. _class_OS_get_screen_position:
  361. - :ref:`Vector2<class_vector2>` **get_screen_position** **(** :ref:`int<class_int>` screen=0 **)** const
  362. .. _class_OS_get_screen_size:
  363. - :ref:`Vector2<class_vector2>` **get_screen_size** **(** :ref:`int<class_int>` screen=0 **)** const
  364. Returns the dimensions in pixels of the specified screen.
  365. .. _class_OS_get_splash_tick_msec:
  366. - :ref:`int<class_int>` **get_splash_tick_msec** **(** **)** const
  367. .. _class_OS_get_static_memory_peak_usage:
  368. - :ref:`int<class_int>` **get_static_memory_peak_usage** **(** **)** const
  369. Return the max amount of static memory used (only works in debug).
  370. .. _class_OS_get_static_memory_usage:
  371. - :ref:`int<class_int>` **get_static_memory_usage** **(** **)** const
  372. .. _class_OS_get_system_dir:
  373. - :ref:`String<class_string>` **get_system_dir** **(** :ref:`int<class_int>` dir **)** const
  374. .. _class_OS_get_system_time_secs:
  375. - :ref:`int<class_int>` **get_system_time_secs** **(** **)** const
  376. .. _class_OS_get_ticks_msec:
  377. - :ref:`int<class_int>` **get_ticks_msec** **(** **)** const
  378. Return the amount of time passed in milliseconds since the engine started.
  379. .. _class_OS_get_time:
  380. - :ref:`Dictionary<class_dictionary>` **get_time** **(** :ref:`bool<class_bool>` utc=false **)** const
  381. Returns current time as a dictionary of keys: hour, minute, second
  382. .. _class_OS_get_time_zone_info:
  383. - :ref:`Dictionary<class_dictionary>` **get_time_zone_info** **(** **)** const
  384. .. _class_OS_get_unique_ID:
  385. - :ref:`String<class_string>` **get_unique_ID** **(** **)** const
  386. .. _class_OS_get_unix_time:
  387. - :ref:`int<class_int>` **get_unix_time** **(** **)** const
  388. Return the current unix timestamp.
  389. .. _class_OS_get_unix_time_from_datetime:
  390. - :ref:`int<class_int>` **get_unix_time_from_datetime** **(** :ref:`Dictionary<class_dictionary>` datetime **)** const
  391. Get an epoch time value from a dictionary of time values.
  392. ``datetime`` must be populated with the following keys: year, month, day, hour, minute, second.
  393. You can pass the output from :ref:`get_datetime_from_unix_time<class_OS_get_datetime_from_unix_time>` directly into this function. Daylight savings time (dst), if present, is ignored.
  394. .. _class_OS_get_window_position:
  395. - :ref:`Vector2<class_vector2>` **get_window_position** **(** **)** const
  396. Returns the window position relative to the screen, the origin is the top left corner, +Y axis goes to the bottom and +X axis goes to the right.
  397. .. _class_OS_get_window_size:
  398. - :ref:`Vector2<class_vector2>` **get_window_size** **(** **)** const
  399. Returns the size of the window (without counting window manager decorations).
  400. .. _class_OS_has_environment:
  401. - :ref:`bool<class_bool>` **has_environment** **(** :ref:`String<class_string>` environment **)** const
  402. Return true if an environment variable exists.
  403. .. _class_OS_has_touchscreen_ui_hint:
  404. - :ref:`bool<class_bool>` **has_touchscreen_ui_hint** **(** **)** const
  405. .. _class_OS_has_virtual_keyboard:
  406. - :ref:`bool<class_bool>` **has_virtual_keyboard** **(** **)** const
  407. Returns true if the platform has a virtual keyboard, false otherwise.
  408. .. _class_OS_hide_virtual_keyboard:
  409. - void **hide_virtual_keyboard** **(** **)**
  410. Hides the virtual keyboard if it is shown, does nothing otherwise.
  411. .. _class_OS_is_debug_build:
  412. - :ref:`bool<class_bool>` **is_debug_build** **(** **)** const
  413. .. _class_OS_is_in_low_processor_usage_mode:
  414. - :ref:`bool<class_bool>` **is_in_low_processor_usage_mode** **(** **)** const
  415. Return true if low cpu usage mode is enabled.
  416. .. _class_OS_is_keep_screen_on:
  417. - :ref:`bool<class_bool>` **is_keep_screen_on** **(** **)** const
  418. Returns whether the screen is being kept on or not.
  419. .. _class_OS_is_ok_left_and_cancel_right:
  420. - :ref:`bool<class_bool>` **is_ok_left_and_cancel_right** **(** **)** const
  421. .. _class_OS_is_scancode_unicode:
  422. - :ref:`bool<class_bool>` **is_scancode_unicode** **(** :ref:`int<class_int>` code **)** const
  423. .. _class_OS_is_stdout_verbose:
  424. - :ref:`bool<class_bool>` **is_stdout_verbose** **(** **)** const
  425. Return true if the engine was executed with -v (verbose stdout).
  426. .. _class_OS_is_vsync_enabled:
  427. - :ref:`bool<class_bool>` **is_vsync_enabled** **(** **)** const
  428. .. _class_OS_is_window_fullscreen:
  429. - :ref:`bool<class_bool>` **is_window_fullscreen** **(** **)** const
  430. Returns whether the window is in fullscreen mode or not.
  431. .. _class_OS_is_window_maximized:
  432. - :ref:`bool<class_bool>` **is_window_maximized** **(** **)** const
  433. Return true if the window is maximized.
  434. .. _class_OS_is_window_minimized:
  435. - :ref:`bool<class_bool>` **is_window_minimized** **(** **)** const
  436. Return true if the window is minimized.
  437. .. _class_OS_is_window_resizable:
  438. - :ref:`bool<class_bool>` **is_window_resizable** **(** **)** const
  439. Returns whether the window is resizable or not.
  440. .. _class_OS_kill:
  441. - :ref:`int<class_int>` **kill** **(** :ref:`int<class_int>` pid **)**
  442. Kill a process ID (this method can be used to kill processes that were not spawned by the game).
  443. .. _class_OS_native_video_is_playing:
  444. - :ref:`bool<class_bool>` **native_video_is_playing** **(** **)**
  445. .. _class_OS_native_video_pause:
  446. - void **native_video_pause** **(** **)**
  447. .. _class_OS_native_video_play:
  448. - :ref:`int<class_int>` **native_video_play** **(** :ref:`String<class_string>` path, :ref:`float<class_float>` volume, :ref:`String<class_string>` audio_track, :ref:`String<class_string>` subtitle_track **)**
  449. .. _class_OS_native_video_stop:
  450. - void **native_video_stop** **(** **)**
  451. .. _class_OS_native_video_unpause:
  452. - void **native_video_unpause** **(** **)**
  453. .. _class_OS_print_all_resources:
  454. - void **print_all_resources** **(** :ref:`String<class_string>` tofile="" **)**
  455. .. _class_OS_print_all_textures_by_size:
  456. - void **print_all_textures_by_size** **(** **)**
  457. .. _class_OS_print_resources_by_type:
  458. - void **print_resources_by_type** **(** :ref:`PoolStringArray<class_poolstringarray>` types **)**
  459. .. _class_OS_print_resources_in_use:
  460. - void **print_resources_in_use** **(** :ref:`bool<class_bool>` short=false **)**
  461. .. _class_OS_request_attention:
  462. - void **request_attention** **(** **)**
  463. Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX.
  464. .. _class_OS_set_borderless_window:
  465. - void **set_borderless_window** **(** :ref:`bool<class_bool>` borderless **)**
  466. .. _class_OS_set_clipboard:
  467. - void **set_clipboard** **(** :ref:`String<class_string>` clipboard **)**
  468. Set clipboard to the OS.
  469. .. _class_OS_set_current_screen:
  470. - void **set_current_screen** **(** :ref:`int<class_int>` screen **)**
  471. .. _class_OS_set_exit_code:
  472. - void **set_exit_code** **(** :ref:`int<class_int>` code **)**
  473. .. _class_OS_set_icon:
  474. - void **set_icon** **(** :ref:`Object<class_object>` icon **)**
  475. .. _class_OS_set_keep_screen_on:
  476. - void **set_keep_screen_on** **(** :ref:`bool<class_bool>` enabled **)**
  477. Set keep screen on if true, or goes to sleep by device setting if false. (for Android/iOS)
  478. .. _class_OS_set_low_processor_usage_mode:
  479. - void **set_low_processor_usage_mode** **(** :ref:`bool<class_bool>` enable **)**
  480. Set to true to enable the low cpu usage mode. In this mode, the screen only redraws when there are changes, and a considerable sleep time is inserted between frames. This way, editors using the engine UI only use very little cpu.
  481. .. _class_OS_set_screen_orientation:
  482. - void **set_screen_orientation** **(** :ref:`int<class_int>` orientation **)**
  483. Sets the current screen orientation, the argument value must be one of the SCREEN_ORIENTATION constants in this class.
  484. .. _class_OS_set_thread_name:
  485. - :ref:`int<class_int>` **set_thread_name** **(** :ref:`String<class_string>` name **)**
  486. .. _class_OS_set_use_file_access_save_and_swap:
  487. - void **set_use_file_access_save_and_swap** **(** :ref:`bool<class_bool>` enabled **)**
  488. .. _class_OS_set_use_vsync:
  489. - void **set_use_vsync** **(** :ref:`bool<class_bool>` enable **)**
  490. .. _class_OS_set_window_fullscreen:
  491. - void **set_window_fullscreen** **(** :ref:`bool<class_bool>` enabled **)**
  492. Sets window fullscreen mode to the *enabled* argument, *enabled* is a toggle for the fullscreen mode, calling the function with *enabled* true when the screen is not on fullscreen mode will cause the screen to go to fullscreen mode, calling the function with *enabled* false when the screen is in fullscreen mode will cause the window to exit the fullscreen mode.
  493. .. _class_OS_set_window_maximized:
  494. - void **set_window_maximized** **(** :ref:`bool<class_bool>` enabled **)**
  495. Set the window size to maximized.
  496. .. _class_OS_set_window_minimized:
  497. - void **set_window_minimized** **(** :ref:`bool<class_bool>` enabled **)**
  498. Set whether the window is minimized.
  499. .. _class_OS_set_window_position:
  500. - void **set_window_position** **(** :ref:`Vector2<class_vector2>` position **)**
  501. Sets the position of the window to the specified position (this function could be restricted by the window manager, meaning that there could be some unreachable areas of the screen).
  502. .. _class_OS_set_window_resizable:
  503. - void **set_window_resizable** **(** :ref:`bool<class_bool>` enabled **)**
  504. Set the window resizable state, if the window is not resizable it will preserve the dimensions specified in the project settings.
  505. .. _class_OS_set_window_size:
  506. - void **set_window_size** **(** :ref:`Vector2<class_vector2>` size **)**
  507. Sets the window size to the specified size.
  508. .. _class_OS_set_window_title:
  509. - void **set_window_title** **(** :ref:`String<class_string>` title **)**
  510. Sets the window title to the specified string.
  511. .. _class_OS_shell_open:
  512. - :ref:`int<class_int>` **shell_open** **(** :ref:`String<class_string>` uri **)**
  513. .. _class_OS_show_virtual_keyboard:
  514. - void **show_virtual_keyboard** **(** :ref:`String<class_string>` existing_text="" **)**
  515. Shows the virtual keyboard if the platform has one. The *existing_text* parameter is useful for implementing your own LineEdit, as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).