class_os.rst 177 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/OS.xml.
  6. .. _class_OS:
  7. OS
  8. ==
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Operating System functions.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Operating System functions. OS wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, date and time, timers, environment variables, execution of binaries, command line, etc.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - `OS Test Demo <https://godotengine.org/asset-library/asset/677>`__
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  25. | :ref:`String<class_String>` | :ref:`clipboard<class_OS_property_clipboard>` | ``""`` |
  26. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  27. | :ref:`int<class_int>` | :ref:`current_screen<class_OS_property_current_screen>` | ``0`` |
  28. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  29. | :ref:`bool<class_bool>` | :ref:`delta_smoothing<class_OS_property_delta_smoothing>` | ``true`` |
  30. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  31. | :ref:`int<class_int>` | :ref:`exit_code<class_OS_property_exit_code>` | ``0`` |
  32. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  33. | :ref:`bool<class_bool>` | :ref:`keep_screen_on<class_OS_property_keep_screen_on>` | ``true`` |
  34. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  35. | :ref:`bool<class_bool>` | :ref:`low_processor_usage_mode<class_OS_property_low_processor_usage_mode>` | ``false`` |
  36. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  37. | :ref:`int<class_int>` | :ref:`low_processor_usage_mode_sleep_usec<class_OS_property_low_processor_usage_mode_sleep_usec>` | ``6900`` |
  38. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  39. | :ref:`Vector2<class_Vector2>` | :ref:`max_window_size<class_OS_property_max_window_size>` | ``Vector2( 0, 0 )`` |
  40. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  41. | :ref:`Vector2<class_Vector2>` | :ref:`min_window_size<class_OS_property_min_window_size>` | ``Vector2( 0, 0 )`` |
  42. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  43. | :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` | :ref:`screen_orientation<class_OS_property_screen_orientation>` | ``0`` |
  44. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  45. | :ref:`String<class_String>` | :ref:`tablet_driver<class_OS_property_tablet_driver>` | ``""`` |
  46. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  47. | :ref:`bool<class_bool>` | :ref:`vsync_enabled<class_OS_property_vsync_enabled>` | ``true`` |
  48. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  49. | :ref:`bool<class_bool>` | :ref:`vsync_via_compositor<class_OS_property_vsync_via_compositor>` | ``false`` |
  50. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  51. | :ref:`bool<class_bool>` | :ref:`window_borderless<class_OS_property_window_borderless>` | ``false`` |
  52. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  53. | :ref:`bool<class_bool>` | :ref:`window_fullscreen<class_OS_property_window_fullscreen>` | ``false`` |
  54. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  55. | :ref:`bool<class_bool>` | :ref:`window_maximized<class_OS_property_window_maximized>` | ``false`` |
  56. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  57. | :ref:`bool<class_bool>` | :ref:`window_minimized<class_OS_property_window_minimized>` | ``false`` |
  58. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  59. | :ref:`bool<class_bool>` | :ref:`window_per_pixel_transparency_enabled<class_OS_property_window_per_pixel_transparency_enabled>` | ``false`` |
  60. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  61. | :ref:`Vector2<class_Vector2>` | :ref:`window_position<class_OS_property_window_position>` | ``Vector2( 0, 0 )`` |
  62. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  63. | :ref:`bool<class_bool>` | :ref:`window_resizable<class_OS_property_window_resizable>` | ``true`` |
  64. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  65. | :ref:`Vector2<class_Vector2>` | :ref:`window_size<class_OS_property_window_size>` | ``Vector2( 0, 0 )`` |
  66. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  67. .. rst-class:: classref-reftable-group
  68. Methods
  69. -------
  70. .. table::
  71. :widths: auto
  72. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`alert<class_OS_method_alert>` **(** :ref:`String<class_String>` text, :ref:`String<class_String>` title="Alert!" **)** |
  74. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`can_draw<class_OS_method_can_draw>` **(** **)** |const| |
  76. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`bool<class_bool>` | :ref:`can_use_threads<class_OS_method_can_use_threads>` **(** **)** |const| |
  78. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`center_window<class_OS_method_center_window>` **(** **)** |
  80. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`close_midi_inputs<class_OS_method_close_midi_inputs>` **(** **)** |
  82. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`crash<class_OS_method_crash>` **(** :ref:`String<class_String>` message **)** |
  84. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`delay_msec<class_OS_method_delay_msec>` **(** :ref:`int<class_int>` msec **)** |const| |
  86. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`delay_usec<class_OS_method_delay_usec>` **(** :ref:`int<class_int>` usec **)** |const| |
  88. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`dump_memory_to_file<class_OS_method_dump_memory_to_file>` **(** :ref:`String<class_String>` file **)** |
  90. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`dump_resources_to_file<class_OS_method_dump_resources_to_file>` **(** :ref:`String<class_String>` file **)** |
  92. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`int<class_int>` | :ref:`execute<class_OS_method_execute>` **(** :ref:`String<class_String>` path, :ref:`PoolStringArray<class_PoolStringArray>` arguments, :ref:`bool<class_bool>` blocking=true, :ref:`Array<class_Array>` output=[ ], :ref:`bool<class_bool>` read_stderr=false, :ref:`bool<class_bool>` open_console=false **)** |
  94. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`int<class_int>` | :ref:`find_scancode_from_string<class_OS_method_find_scancode_from_string>` **(** :ref:`String<class_String>` string **)** |const| |
  96. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`int<class_int>` | :ref:`get_audio_driver_count<class_OS_method_get_audio_driver_count>` **(** **)** |const| |
  98. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`String<class_String>` | :ref:`get_audio_driver_name<class_OS_method_get_audio_driver_name>` **(** :ref:`int<class_int>` driver **)** |const| |
  100. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`String<class_String>` | :ref:`get_cache_dir<class_OS_method_get_cache_dir>` **(** **)** |const| |
  102. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_cmdline_args<class_OS_method_get_cmdline_args>` **(** **)** |
  104. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`String<class_String>` | :ref:`get_config_dir<class_OS_method_get_config_dir>` **(** **)** |const| |
  106. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_connected_midi_inputs<class_OS_method_get_connected_midi_inputs>` **(** **)** |
  108. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`VideoDriver<enum_OS_VideoDriver>` | :ref:`get_current_video_driver<class_OS_method_get_current_video_driver>` **(** **)** |const| |
  110. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`String<class_String>` | :ref:`get_data_dir<class_OS_method_get_data_dir>` **(** **)** |const| |
  112. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_date<class_OS_method_get_date>` **(** :ref:`bool<class_bool>` utc=false **)** |const| |
  114. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_datetime<class_OS_method_get_datetime>` **(** :ref:`bool<class_bool>` utc=false **)** |const| |
  116. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_datetime_from_unix_time<class_OS_method_get_datetime_from_unix_time>` **(** :ref:`int<class_int>` unix_time_val **)** |const| |
  118. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`Array<class_Array>` | :ref:`get_display_cutouts<class_OS_method_get_display_cutouts>` **(** **)** |const| |
  120. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`int<class_int>` | :ref:`get_dynamic_memory_usage<class_OS_method_get_dynamic_memory_usage>` **(** **)** |const| |
  122. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`String<class_String>` | :ref:`get_environment<class_OS_method_get_environment>` **(** :ref:`String<class_String>` variable **)** |const| |
  124. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`String<class_String>` | :ref:`get_executable_path<class_OS_method_get_executable_path>` **(** **)** |const| |
  126. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_granted_permissions<class_OS_method_get_granted_permissions>` **(** **)** |const| |
  128. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`Vector2<class_Vector2>` | :ref:`get_ime_selection<class_OS_method_get_ime_selection>` **(** **)** |const| |
  130. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`String<class_String>` | :ref:`get_ime_text<class_OS_method_get_ime_text>` **(** **)** |const| |
  132. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`String<class_String>` | :ref:`get_latin_keyboard_variant<class_OS_method_get_latin_keyboard_variant>` **(** **)** |const| |
  134. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`String<class_String>` | :ref:`get_locale<class_OS_method_get_locale>` **(** **)** |const| |
  136. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`String<class_String>` | :ref:`get_locale_language<class_OS_method_get_locale_language>` **(** **)** |const| |
  138. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | :ref:`int<class_int>` | :ref:`get_main_thread_id<class_OS_method_get_main_thread_id>` **(** **)** |const| |
  140. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | :ref:`String<class_String>` | :ref:`get_model_name<class_OS_method_get_model_name>` **(** **)** |const| |
  142. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`String<class_String>` | :ref:`get_name<class_OS_method_get_name>` **(** **)** |const| |
  144. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`int<class_int>` | :ref:`get_native_handle<class_OS_method_get_native_handle>` **(** :ref:`HandleType<enum_OS_HandleType>` handle_type **)** |
  146. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`int<class_int>` | :ref:`get_power_percent_left<class_OS_method_get_power_percent_left>` **(** **)** |
  148. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`int<class_int>` | :ref:`get_power_seconds_left<class_OS_method_get_power_seconds_left>` **(** **)** |
  150. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`PowerState<enum_OS_PowerState>` | :ref:`get_power_state<class_OS_method_get_power_state>` **(** **)** |
  152. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | :ref:`int<class_int>` | :ref:`get_process_id<class_OS_method_get_process_id>` **(** **)** |const| |
  154. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | :ref:`int<class_int>` | :ref:`get_processor_count<class_OS_method_get_processor_count>` **(** **)** |const| |
  156. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | :ref:`String<class_String>` | :ref:`get_processor_name<class_OS_method_get_processor_name>` **(** **)** |const| |
  158. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | :ref:`Vector2<class_Vector2>` | :ref:`get_real_window_size<class_OS_method_get_real_window_size>` **(** **)** |const| |
  160. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | :ref:`String<class_String>` | :ref:`get_scancode_string<class_OS_method_get_scancode_string>` **(** :ref:`int<class_int>` code **)** |const| |
  162. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | :ref:`int<class_int>` | :ref:`get_screen_count<class_OS_method_get_screen_count>` **(** **)** |const| |
  164. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | :ref:`int<class_int>` | :ref:`get_screen_dpi<class_OS_method_get_screen_dpi>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  166. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | :ref:`float<class_float>` | :ref:`get_screen_max_scale<class_OS_method_get_screen_max_scale>` **(** **)** |const| |
  168. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | :ref:`Vector2<class_Vector2>` | :ref:`get_screen_position<class_OS_method_get_screen_position>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  170. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | :ref:`float<class_float>` | :ref:`get_screen_refresh_rate<class_OS_method_get_screen_refresh_rate>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  172. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | :ref:`float<class_float>` | :ref:`get_screen_scale<class_OS_method_get_screen_scale>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  174. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | :ref:`Vector2<class_Vector2>` | :ref:`get_screen_size<class_OS_method_get_screen_size>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  176. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | :ref:`int<class_int>` | :ref:`get_splash_tick_msec<class_OS_method_get_splash_tick_msec>` **(** **)** |const| |
  178. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | :ref:`int<class_int>` | :ref:`get_static_memory_peak_usage<class_OS_method_get_static_memory_peak_usage>` **(** **)** |const| |
  180. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | :ref:`int<class_int>` | :ref:`get_static_memory_usage<class_OS_method_get_static_memory_usage>` **(** **)** |const| |
  182. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | :ref:`String<class_String>` | :ref:`get_system_dir<class_OS_method_get_system_dir>` **(** :ref:`SystemDir<enum_OS_SystemDir>` dir, :ref:`bool<class_bool>` shared_storage=true **)** |const| |
  184. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | :ref:`int<class_int>` | :ref:`get_system_time_msecs<class_OS_method_get_system_time_msecs>` **(** **)** |const| |
  186. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | :ref:`int<class_int>` | :ref:`get_system_time_secs<class_OS_method_get_system_time_secs>` **(** **)** |const| |
  188. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | :ref:`int<class_int>` | :ref:`get_tablet_driver_count<class_OS_method_get_tablet_driver_count>` **(** **)** |const| |
  190. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | :ref:`String<class_String>` | :ref:`get_tablet_driver_name<class_OS_method_get_tablet_driver_name>` **(** :ref:`int<class_int>` idx **)** |const| |
  192. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | :ref:`int<class_int>` | :ref:`get_thread_caller_id<class_OS_method_get_thread_caller_id>` **(** **)** |const| |
  194. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. | :ref:`int<class_int>` | :ref:`get_ticks_msec<class_OS_method_get_ticks_msec>` **(** **)** |const| |
  196. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  197. | :ref:`int<class_int>` | :ref:`get_ticks_usec<class_OS_method_get_ticks_usec>` **(** **)** |const| |
  198. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  199. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_time<class_OS_method_get_time>` **(** :ref:`bool<class_bool>` utc=false **)** |const| |
  200. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  201. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_time_zone_info<class_OS_method_get_time_zone_info>` **(** **)** |const| |
  202. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  203. | :ref:`String<class_String>` | :ref:`get_unique_id<class_OS_method_get_unique_id>` **(** **)** |const| |
  204. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  205. | :ref:`int<class_int>` | :ref:`get_unix_time<class_OS_method_get_unix_time>` **(** **)** |const| |
  206. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  207. | :ref:`int<class_int>` | :ref:`get_unix_time_from_datetime<class_OS_method_get_unix_time_from_datetime>` **(** :ref:`Dictionary<class_Dictionary>` datetime **)** |const| |
  208. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  209. | :ref:`String<class_String>` | :ref:`get_user_data_dir<class_OS_method_get_user_data_dir>` **(** **)** |const| |
  210. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  211. | :ref:`int<class_int>` | :ref:`get_video_driver_count<class_OS_method_get_video_driver_count>` **(** **)** |const| |
  212. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  213. | :ref:`String<class_String>` | :ref:`get_video_driver_name<class_OS_method_get_video_driver_name>` **(** :ref:`VideoDriver<enum_OS_VideoDriver>` driver **)** |const| |
  214. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  215. | :ref:`int<class_int>` | :ref:`get_virtual_keyboard_height<class_OS_method_get_virtual_keyboard_height>` **(** **)** |
  216. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  217. | :ref:`Rect2<class_Rect2>` | :ref:`get_window_safe_area<class_OS_method_get_window_safe_area>` **(** **)** |const| |
  218. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  219. | void | :ref:`global_menu_add_item<class_OS_method_global_menu_add_item>` **(** :ref:`String<class_String>` menu, :ref:`String<class_String>` label, :ref:`Variant<class_Variant>` id, :ref:`Variant<class_Variant>` meta **)** |
  220. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  221. | void | :ref:`global_menu_add_separator<class_OS_method_global_menu_add_separator>` **(** :ref:`String<class_String>` menu **)** |
  222. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  223. | void | :ref:`global_menu_clear<class_OS_method_global_menu_clear>` **(** :ref:`String<class_String>` menu **)** |
  224. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  225. | void | :ref:`global_menu_remove_item<class_OS_method_global_menu_remove_item>` **(** :ref:`String<class_String>` menu, :ref:`int<class_int>` idx **)** |
  226. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  227. | :ref:`bool<class_bool>` | :ref:`has_clipboard<class_OS_method_has_clipboard>` **(** **)** |const| |
  228. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  229. | :ref:`bool<class_bool>` | :ref:`has_environment<class_OS_method_has_environment>` **(** :ref:`String<class_String>` variable **)** |const| |
  230. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  231. | :ref:`bool<class_bool>` | :ref:`has_feature<class_OS_method_has_feature>` **(** :ref:`String<class_String>` tag_name **)** |const| |
  232. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  233. | :ref:`bool<class_bool>` | :ref:`has_touchscreen_ui_hint<class_OS_method_has_touchscreen_ui_hint>` **(** **)** |const| |
  234. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  235. | :ref:`bool<class_bool>` | :ref:`has_virtual_keyboard<class_OS_method_has_virtual_keyboard>` **(** **)** |const| |
  236. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  237. | void | :ref:`hide_virtual_keyboard<class_OS_method_hide_virtual_keyboard>` **(** **)** |
  238. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  239. | :ref:`bool<class_bool>` | :ref:`is_debug_build<class_OS_method_is_debug_build>` **(** **)** |const| |
  240. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  241. | :ref:`bool<class_bool>` | :ref:`is_ok_left_and_cancel_right<class_OS_method_is_ok_left_and_cancel_right>` **(** **)** |const| |
  242. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  243. | :ref:`bool<class_bool>` | :ref:`is_process_running<class_OS_method_is_process_running>` **(** :ref:`int<class_int>` pid **)** |const| |
  244. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  245. | :ref:`bool<class_bool>` | :ref:`is_scancode_unicode<class_OS_method_is_scancode_unicode>` **(** :ref:`int<class_int>` code **)** |const| |
  246. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  247. | :ref:`bool<class_bool>` | :ref:`is_stdout_verbose<class_OS_method_is_stdout_verbose>` **(** **)** |const| |
  248. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  249. | :ref:`bool<class_bool>` | :ref:`is_userfs_persistent<class_OS_method_is_userfs_persistent>` **(** **)** |const| |
  250. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  251. | :ref:`bool<class_bool>` | :ref:`is_window_always_on_top<class_OS_method_is_window_always_on_top>` **(** **)** |const| |
  252. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  253. | :ref:`bool<class_bool>` | :ref:`is_window_focused<class_OS_method_is_window_focused>` **(** **)** |const| |
  254. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  255. | :ref:`int<class_int>` | :ref:`keyboard_get_current_layout<class_OS_method_keyboard_get_current_layout>` **(** **)** |const| |
  256. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  257. | :ref:`int<class_int>` | :ref:`keyboard_get_layout_count<class_OS_method_keyboard_get_layout_count>` **(** **)** |const| |
  258. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  259. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_language<class_OS_method_keyboard_get_layout_language>` **(** :ref:`int<class_int>` index **)** |const| |
  260. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  261. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_name<class_OS_method_keyboard_get_layout_name>` **(** :ref:`int<class_int>` index **)** |const| |
  262. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  263. | :ref:`int<class_int>` | :ref:`keyboard_get_scancode_from_physical<class_OS_method_keyboard_get_scancode_from_physical>` **(** :ref:`int<class_int>` scancode **)** |const| |
  264. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  265. | void | :ref:`keyboard_set_current_layout<class_OS_method_keyboard_set_current_layout>` **(** :ref:`int<class_int>` index **)** |
  266. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  267. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`kill<class_OS_method_kill>` **(** :ref:`int<class_int>` pid **)** |
  268. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  269. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`move_to_trash<class_OS_method_move_to_trash>` **(** :ref:`String<class_String>` path **)** |const| |
  270. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  271. | void | :ref:`move_window_to_foreground<class_OS_method_move_window_to_foreground>` **(** **)** |
  272. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  273. | :ref:`bool<class_bool>` | :ref:`native_video_is_playing<class_OS_method_native_video_is_playing>` **(** **)** |
  274. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  275. | void | :ref:`native_video_pause<class_OS_method_native_video_pause>` **(** **)** |
  276. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  277. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`native_video_play<class_OS_method_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 **)** |
  278. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  279. | void | :ref:`native_video_stop<class_OS_method_native_video_stop>` **(** **)** |
  280. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  281. | void | :ref:`native_video_unpause<class_OS_method_native_video_unpause>` **(** **)** |
  282. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  283. | void | :ref:`open_midi_inputs<class_OS_method_open_midi_inputs>` **(** **)** |
  284. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  285. | void | :ref:`print_all_resources<class_OS_method_print_all_resources>` **(** :ref:`String<class_String>` tofile="" **)** |
  286. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  287. | void | :ref:`print_all_textures_by_size<class_OS_method_print_all_textures_by_size>` **(** **)** |
  288. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  289. | void | :ref:`print_resources_by_type<class_OS_method_print_resources_by_type>` **(** :ref:`PoolStringArray<class_PoolStringArray>` types **)** |
  290. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  291. | void | :ref:`print_resources_in_use<class_OS_method_print_resources_in_use>` **(** :ref:`bool<class_bool>` short=false **)** |
  292. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  293. | void | :ref:`request_attention<class_OS_method_request_attention>` **(** **)** |
  294. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  295. | :ref:`bool<class_bool>` | :ref:`request_permission<class_OS_method_request_permission>` **(** :ref:`String<class_String>` name **)** |
  296. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  297. | :ref:`bool<class_bool>` | :ref:`request_permissions<class_OS_method_request_permissions>` **(** **)** |
  298. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  299. | :ref:`bool<class_bool>` | :ref:`set_environment<class_OS_method_set_environment>` **(** :ref:`String<class_String>` variable, :ref:`String<class_String>` value **)** |const| |
  300. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  301. | void | :ref:`set_icon<class_OS_method_set_icon>` **(** :ref:`Image<class_Image>` icon **)** |
  302. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  303. | void | :ref:`set_ime_active<class_OS_method_set_ime_active>` **(** :ref:`bool<class_bool>` active **)** |
  304. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  305. | void | :ref:`set_ime_position<class_OS_method_set_ime_position>` **(** :ref:`Vector2<class_Vector2>` position **)** |
  306. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  307. | void | :ref:`set_native_icon<class_OS_method_set_native_icon>` **(** :ref:`String<class_String>` filename **)** |
  308. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  309. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`set_thread_name<class_OS_method_set_thread_name>` **(** :ref:`String<class_String>` name **)** |
  310. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  311. | void | :ref:`set_use_file_access_save_and_swap<class_OS_method_set_use_file_access_save_and_swap>` **(** :ref:`bool<class_bool>` enabled **)** |
  312. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  313. | void | :ref:`set_window_always_on_top<class_OS_method_set_window_always_on_top>` **(** :ref:`bool<class_bool>` enabled **)** |
  314. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  315. | void | :ref:`set_window_mouse_passthrough<class_OS_method_set_window_mouse_passthrough>` **(** :ref:`PoolVector2Array<class_PoolVector2Array>` region **)** |
  316. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  317. | void | :ref:`set_window_title<class_OS_method_set_window_title>` **(** :ref:`String<class_String>` title **)** |
  318. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  319. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`shell_open<class_OS_method_shell_open>` **(** :ref:`String<class_String>` uri **)** |
  320. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  321. | void | :ref:`show_virtual_keyboard<class_OS_method_show_virtual_keyboard>` **(** :ref:`String<class_String>` existing_text="", :ref:`bool<class_bool>` multiline=false **)** |
  322. +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  323. .. rst-class:: classref-section-separator
  324. ----
  325. .. rst-class:: classref-descriptions-group
  326. Enumerations
  327. ------------
  328. .. _enum_OS_VideoDriver:
  329. .. rst-class:: classref-enumeration
  330. enum **VideoDriver**:
  331. .. _class_OS_constant_VIDEO_DRIVER_GLES2:
  332. .. rst-class:: classref-enumeration-constant
  333. :ref:`VideoDriver<enum_OS_VideoDriver>` **VIDEO_DRIVER_GLES2** = ``1``
  334. The GLES2 rendering backend. It uses OpenGL ES 2.0 on mobile devices, OpenGL 2.1 on desktop platforms and WebGL 1.0 on the web.
  335. .. _class_OS_constant_VIDEO_DRIVER_GLES3:
  336. .. rst-class:: classref-enumeration-constant
  337. :ref:`VideoDriver<enum_OS_VideoDriver>` **VIDEO_DRIVER_GLES3** = ``0``
  338. The GLES3 rendering backend. It uses OpenGL ES 3.0 on mobile devices, OpenGL 3.3 on desktop platforms and WebGL 2.0 on the web.
  339. .. rst-class:: classref-item-separator
  340. ----
  341. .. _enum_OS_Weekday:
  342. .. rst-class:: classref-enumeration
  343. enum **Weekday**:
  344. .. _class_OS_constant_DAY_SUNDAY:
  345. .. rst-class:: classref-enumeration-constant
  346. :ref:`Weekday<enum_OS_Weekday>` **DAY_SUNDAY** = ``0``
  347. Sunday.
  348. .. _class_OS_constant_DAY_MONDAY:
  349. .. rst-class:: classref-enumeration-constant
  350. :ref:`Weekday<enum_OS_Weekday>` **DAY_MONDAY** = ``1``
  351. Monday.
  352. .. _class_OS_constant_DAY_TUESDAY:
  353. .. rst-class:: classref-enumeration-constant
  354. :ref:`Weekday<enum_OS_Weekday>` **DAY_TUESDAY** = ``2``
  355. Tuesday.
  356. .. _class_OS_constant_DAY_WEDNESDAY:
  357. .. rst-class:: classref-enumeration-constant
  358. :ref:`Weekday<enum_OS_Weekday>` **DAY_WEDNESDAY** = ``3``
  359. Wednesday.
  360. .. _class_OS_constant_DAY_THURSDAY:
  361. .. rst-class:: classref-enumeration-constant
  362. :ref:`Weekday<enum_OS_Weekday>` **DAY_THURSDAY** = ``4``
  363. Thursday.
  364. .. _class_OS_constant_DAY_FRIDAY:
  365. .. rst-class:: classref-enumeration-constant
  366. :ref:`Weekday<enum_OS_Weekday>` **DAY_FRIDAY** = ``5``
  367. Friday.
  368. .. _class_OS_constant_DAY_SATURDAY:
  369. .. rst-class:: classref-enumeration-constant
  370. :ref:`Weekday<enum_OS_Weekday>` **DAY_SATURDAY** = ``6``
  371. Saturday.
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _enum_OS_Month:
  375. .. rst-class:: classref-enumeration
  376. enum **Month**:
  377. .. _class_OS_constant_MONTH_JANUARY:
  378. .. rst-class:: classref-enumeration-constant
  379. :ref:`Month<enum_OS_Month>` **MONTH_JANUARY** = ``1``
  380. January.
  381. .. _class_OS_constant_MONTH_FEBRUARY:
  382. .. rst-class:: classref-enumeration-constant
  383. :ref:`Month<enum_OS_Month>` **MONTH_FEBRUARY** = ``2``
  384. February.
  385. .. _class_OS_constant_MONTH_MARCH:
  386. .. rst-class:: classref-enumeration-constant
  387. :ref:`Month<enum_OS_Month>` **MONTH_MARCH** = ``3``
  388. March.
  389. .. _class_OS_constant_MONTH_APRIL:
  390. .. rst-class:: classref-enumeration-constant
  391. :ref:`Month<enum_OS_Month>` **MONTH_APRIL** = ``4``
  392. April.
  393. .. _class_OS_constant_MONTH_MAY:
  394. .. rst-class:: classref-enumeration-constant
  395. :ref:`Month<enum_OS_Month>` **MONTH_MAY** = ``5``
  396. May.
  397. .. _class_OS_constant_MONTH_JUNE:
  398. .. rst-class:: classref-enumeration-constant
  399. :ref:`Month<enum_OS_Month>` **MONTH_JUNE** = ``6``
  400. June.
  401. .. _class_OS_constant_MONTH_JULY:
  402. .. rst-class:: classref-enumeration-constant
  403. :ref:`Month<enum_OS_Month>` **MONTH_JULY** = ``7``
  404. July.
  405. .. _class_OS_constant_MONTH_AUGUST:
  406. .. rst-class:: classref-enumeration-constant
  407. :ref:`Month<enum_OS_Month>` **MONTH_AUGUST** = ``8``
  408. August.
  409. .. _class_OS_constant_MONTH_SEPTEMBER:
  410. .. rst-class:: classref-enumeration-constant
  411. :ref:`Month<enum_OS_Month>` **MONTH_SEPTEMBER** = ``9``
  412. September.
  413. .. _class_OS_constant_MONTH_OCTOBER:
  414. .. rst-class:: classref-enumeration-constant
  415. :ref:`Month<enum_OS_Month>` **MONTH_OCTOBER** = ``10``
  416. October.
  417. .. _class_OS_constant_MONTH_NOVEMBER:
  418. .. rst-class:: classref-enumeration-constant
  419. :ref:`Month<enum_OS_Month>` **MONTH_NOVEMBER** = ``11``
  420. November.
  421. .. _class_OS_constant_MONTH_DECEMBER:
  422. .. rst-class:: classref-enumeration-constant
  423. :ref:`Month<enum_OS_Month>` **MONTH_DECEMBER** = ``12``
  424. December.
  425. .. rst-class:: classref-item-separator
  426. ----
  427. .. _enum_OS_HandleType:
  428. .. rst-class:: classref-enumeration
  429. enum **HandleType**:
  430. .. _class_OS_constant_APPLICATION_HANDLE:
  431. .. rst-class:: classref-enumeration-constant
  432. :ref:`HandleType<enum_OS_HandleType>` **APPLICATION_HANDLE** = ``0``
  433. Application handle:
  434. - Windows: ``HINSTANCE`` of the application
  435. - MacOS: ``NSApplication*`` of the application (not yet implemented)
  436. - Android: ``JNIEnv*`` of the application (not yet implemented)
  437. .. _class_OS_constant_DISPLAY_HANDLE:
  438. .. rst-class:: classref-enumeration-constant
  439. :ref:`HandleType<enum_OS_HandleType>` **DISPLAY_HANDLE** = ``1``
  440. Display handle:
  441. - Linux: ``X11::Display*`` for the display
  442. .. _class_OS_constant_WINDOW_HANDLE:
  443. .. rst-class:: classref-enumeration-constant
  444. :ref:`HandleType<enum_OS_HandleType>` **WINDOW_HANDLE** = ``2``
  445. Window handle:
  446. - Windows: ``HWND`` of the main window
  447. - Linux: ``X11::Window*`` of the main window
  448. - MacOS: ``NSWindow*`` of the main window (not yet implemented)
  449. - Android: ``jObject`` the main android activity (not yet implemented)
  450. .. _class_OS_constant_WINDOW_VIEW:
  451. .. rst-class:: classref-enumeration-constant
  452. :ref:`HandleType<enum_OS_HandleType>` **WINDOW_VIEW** = ``3``
  453. Window view:
  454. - Windows: ``HDC`` of the main window drawing context
  455. - MacOS: ``NSView*`` of the main windows view (not yet implemented)
  456. .. _class_OS_constant_OPENGL_CONTEXT:
  457. .. rst-class:: classref-enumeration-constant
  458. :ref:`HandleType<enum_OS_HandleType>` **OPENGL_CONTEXT** = ``4``
  459. OpenGL Context:
  460. - Windows: ``HGLRC``\
  461. - Linux: ``X11::GLXContext``\
  462. - MacOS: ``NSOpenGLContext*`` (not yet implemented)
  463. .. rst-class:: classref-item-separator
  464. ----
  465. .. _enum_OS_ScreenOrientation:
  466. .. rst-class:: classref-enumeration
  467. enum **ScreenOrientation**:
  468. .. _class_OS_constant_SCREEN_ORIENTATION_LANDSCAPE:
  469. .. rst-class:: classref-enumeration-constant
  470. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_LANDSCAPE** = ``0``
  471. Landscape screen orientation.
  472. .. _class_OS_constant_SCREEN_ORIENTATION_PORTRAIT:
  473. .. rst-class:: classref-enumeration-constant
  474. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_PORTRAIT** = ``1``
  475. Portrait screen orientation.
  476. .. _class_OS_constant_SCREEN_ORIENTATION_REVERSE_LANDSCAPE:
  477. .. rst-class:: classref-enumeration-constant
  478. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_REVERSE_LANDSCAPE** = ``2``
  479. Reverse landscape screen orientation.
  480. .. _class_OS_constant_SCREEN_ORIENTATION_REVERSE_PORTRAIT:
  481. .. rst-class:: classref-enumeration-constant
  482. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_REVERSE_PORTRAIT** = ``3``
  483. Reverse portrait screen orientation.
  484. .. _class_OS_constant_SCREEN_ORIENTATION_SENSOR_LANDSCAPE:
  485. .. rst-class:: classref-enumeration-constant
  486. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_SENSOR_LANDSCAPE** = ``4``
  487. Uses landscape or reverse landscape based on the hardware sensor.
  488. .. _class_OS_constant_SCREEN_ORIENTATION_SENSOR_PORTRAIT:
  489. .. rst-class:: classref-enumeration-constant
  490. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_SENSOR_PORTRAIT** = ``5``
  491. Uses portrait or reverse portrait based on the hardware sensor.
  492. .. _class_OS_constant_SCREEN_ORIENTATION_SENSOR:
  493. .. rst-class:: classref-enumeration-constant
  494. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_SENSOR** = ``6``
  495. Uses most suitable orientation based on the hardware sensor.
  496. .. rst-class:: classref-item-separator
  497. ----
  498. .. _enum_OS_SystemDir:
  499. .. rst-class:: classref-enumeration
  500. enum **SystemDir**:
  501. .. _class_OS_constant_SYSTEM_DIR_DESKTOP:
  502. .. rst-class:: classref-enumeration-constant
  503. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_DESKTOP** = ``0``
  504. Desktop directory path.
  505. .. _class_OS_constant_SYSTEM_DIR_DCIM:
  506. .. rst-class:: classref-enumeration-constant
  507. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_DCIM** = ``1``
  508. DCIM (Digital Camera Images) directory path.
  509. .. _class_OS_constant_SYSTEM_DIR_DOCUMENTS:
  510. .. rst-class:: classref-enumeration-constant
  511. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_DOCUMENTS** = ``2``
  512. Documents directory path.
  513. .. _class_OS_constant_SYSTEM_DIR_DOWNLOADS:
  514. .. rst-class:: classref-enumeration-constant
  515. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_DOWNLOADS** = ``3``
  516. Downloads directory path.
  517. .. _class_OS_constant_SYSTEM_DIR_MOVIES:
  518. .. rst-class:: classref-enumeration-constant
  519. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_MOVIES** = ``4``
  520. Movies directory path.
  521. .. _class_OS_constant_SYSTEM_DIR_MUSIC:
  522. .. rst-class:: classref-enumeration-constant
  523. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_MUSIC** = ``5``
  524. Music directory path.
  525. .. _class_OS_constant_SYSTEM_DIR_PICTURES:
  526. .. rst-class:: classref-enumeration-constant
  527. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_PICTURES** = ``6``
  528. Pictures directory path.
  529. .. _class_OS_constant_SYSTEM_DIR_RINGTONES:
  530. .. rst-class:: classref-enumeration-constant
  531. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_RINGTONES** = ``7``
  532. Ringtones directory path.
  533. .. rst-class:: classref-item-separator
  534. ----
  535. .. _enum_OS_PowerState:
  536. .. rst-class:: classref-enumeration
  537. enum **PowerState**:
  538. .. _class_OS_constant_POWERSTATE_UNKNOWN:
  539. .. rst-class:: classref-enumeration-constant
  540. :ref:`PowerState<enum_OS_PowerState>` **POWERSTATE_UNKNOWN** = ``0``
  541. Unknown powerstate.
  542. .. _class_OS_constant_POWERSTATE_ON_BATTERY:
  543. .. rst-class:: classref-enumeration-constant
  544. :ref:`PowerState<enum_OS_PowerState>` **POWERSTATE_ON_BATTERY** = ``1``
  545. Unplugged, running on battery.
  546. .. _class_OS_constant_POWERSTATE_NO_BATTERY:
  547. .. rst-class:: classref-enumeration-constant
  548. :ref:`PowerState<enum_OS_PowerState>` **POWERSTATE_NO_BATTERY** = ``2``
  549. Plugged in, no battery available.
  550. .. _class_OS_constant_POWERSTATE_CHARGING:
  551. .. rst-class:: classref-enumeration-constant
  552. :ref:`PowerState<enum_OS_PowerState>` **POWERSTATE_CHARGING** = ``3``
  553. Plugged in, battery charging.
  554. .. _class_OS_constant_POWERSTATE_CHARGED:
  555. .. rst-class:: classref-enumeration-constant
  556. :ref:`PowerState<enum_OS_PowerState>` **POWERSTATE_CHARGED** = ``4``
  557. Plugged in, battery fully charged.
  558. .. rst-class:: classref-section-separator
  559. ----
  560. .. rst-class:: classref-descriptions-group
  561. Property Descriptions
  562. ---------------------
  563. .. _class_OS_property_clipboard:
  564. .. rst-class:: classref-property
  565. :ref:`String<class_String>` **clipboard** = ``""``
  566. .. rst-class:: classref-property-setget
  567. - void **set_clipboard** **(** :ref:`String<class_String>` value **)**
  568. - :ref:`String<class_String>` **get_clipboard** **(** **)**
  569. The clipboard from the host OS. Might be unavailable on some platforms.
  570. .. rst-class:: classref-item-separator
  571. ----
  572. .. _class_OS_property_current_screen:
  573. .. rst-class:: classref-property
  574. :ref:`int<class_int>` **current_screen** = ``0``
  575. .. rst-class:: classref-property-setget
  576. - void **set_current_screen** **(** :ref:`int<class_int>` value **)**
  577. - :ref:`int<class_int>` **get_current_screen** **(** **)**
  578. The current screen index (starting from 0).
  579. .. rst-class:: classref-item-separator
  580. ----
  581. .. _class_OS_property_delta_smoothing:
  582. .. rst-class:: classref-property
  583. :ref:`bool<class_bool>` **delta_smoothing** = ``true``
  584. .. rst-class:: classref-property-setget
  585. - void **set_delta_smoothing** **(** :ref:`bool<class_bool>` value **)**
  586. - :ref:`bool<class_bool>` **is_delta_smoothing_enabled** **(** **)**
  587. If ``true``, the engine filters the time delta measured between each frame, and attempts to compensate for random variation. This will only operate on systems where V-Sync is active.
  588. .. rst-class:: classref-item-separator
  589. ----
  590. .. _class_OS_property_exit_code:
  591. .. rst-class:: classref-property
  592. :ref:`int<class_int>` **exit_code** = ``0``
  593. .. rst-class:: classref-property-setget
  594. - void **set_exit_code** **(** :ref:`int<class_int>` value **)**
  595. - :ref:`int<class_int>` **get_exit_code** **(** **)**
  596. The exit code passed to the OS when the main loop exits. By convention, an exit code of ``0`` indicates success whereas a non-zero exit code indicates an error. For portability reasons, the exit code should be set between 0 and 125 (inclusive).
  597. \ **Note:** This value will be ignored if using :ref:`SceneTree.quit<class_SceneTree_method_quit>` with an ``exit_code`` argument passed.
  598. .. rst-class:: classref-item-separator
  599. ----
  600. .. _class_OS_property_keep_screen_on:
  601. .. rst-class:: classref-property
  602. :ref:`bool<class_bool>` **keep_screen_on** = ``true``
  603. .. rst-class:: classref-property-setget
  604. - void **set_keep_screen_on** **(** :ref:`bool<class_bool>` value **)**
  605. - :ref:`bool<class_bool>` **is_keep_screen_on** **(** **)**
  606. If ``true``, the engine tries to keep the screen on while the game is running. Useful on mobile.
  607. .. rst-class:: classref-item-separator
  608. ----
  609. .. _class_OS_property_low_processor_usage_mode:
  610. .. rst-class:: classref-property
  611. :ref:`bool<class_bool>` **low_processor_usage_mode** = ``false``
  612. .. rst-class:: classref-property-setget
  613. - void **set_low_processor_usage_mode** **(** :ref:`bool<class_bool>` value **)**
  614. - :ref:`bool<class_bool>` **is_in_low_processor_usage_mode** **(** **)**
  615. If ``true``, the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile.
  616. .. rst-class:: classref-item-separator
  617. ----
  618. .. _class_OS_property_low_processor_usage_mode_sleep_usec:
  619. .. rst-class:: classref-property
  620. :ref:`int<class_int>` **low_processor_usage_mode_sleep_usec** = ``6900``
  621. .. rst-class:: classref-property-setget
  622. - void **set_low_processor_usage_mode_sleep_usec** **(** :ref:`int<class_int>` value **)**
  623. - :ref:`int<class_int>` **get_low_processor_usage_mode_sleep_usec** **(** **)**
  624. The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage.
  625. .. rst-class:: classref-item-separator
  626. ----
  627. .. _class_OS_property_max_window_size:
  628. .. rst-class:: classref-property
  629. :ref:`Vector2<class_Vector2>` **max_window_size** = ``Vector2( 0, 0 )``
  630. .. rst-class:: classref-property-setget
  631. - void **set_max_window_size** **(** :ref:`Vector2<class_Vector2>` value **)**
  632. - :ref:`Vector2<class_Vector2>` **get_max_window_size** **(** **)**
  633. The maximum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to ``(0, 0)`` to reset to the system default value.
  634. .. rst-class:: classref-item-separator
  635. ----
  636. .. _class_OS_property_min_window_size:
  637. .. rst-class:: classref-property
  638. :ref:`Vector2<class_Vector2>` **min_window_size** = ``Vector2( 0, 0 )``
  639. .. rst-class:: classref-property-setget
  640. - void **set_min_window_size** **(** :ref:`Vector2<class_Vector2>` value **)**
  641. - :ref:`Vector2<class_Vector2>` **get_min_window_size** **(** **)**
  642. The minimum size of the window in pixels (without counting window manager decorations). Does not affect fullscreen mode. Set to ``(0, 0)`` to reset to the system's default value.
  643. \ **Note:** By default, the project window has a minimum size of ``Vector2(64, 64)``. This prevents issues that can arise when the window is resized to a near-zero size.
  644. .. rst-class:: classref-item-separator
  645. ----
  646. .. _class_OS_property_screen_orientation:
  647. .. rst-class:: classref-property
  648. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **screen_orientation** = ``0``
  649. .. rst-class:: classref-property-setget
  650. - void **set_screen_orientation** **(** :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` value **)**
  651. - :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **get_screen_orientation** **(** **)**
  652. The current screen orientation.
  653. .. rst-class:: classref-item-separator
  654. ----
  655. .. _class_OS_property_tablet_driver:
  656. .. rst-class:: classref-property
  657. :ref:`String<class_String>` **tablet_driver** = ``""``
  658. .. rst-class:: classref-property-setget
  659. - void **set_current_tablet_driver** **(** :ref:`String<class_String>` value **)**
  660. - :ref:`String<class_String>` **get_current_tablet_driver** **(** **)**
  661. The current tablet driver in use.
  662. .. rst-class:: classref-item-separator
  663. ----
  664. .. _class_OS_property_vsync_enabled:
  665. .. rst-class:: classref-property
  666. :ref:`bool<class_bool>` **vsync_enabled** = ``true``
  667. .. rst-class:: classref-property-setget
  668. - void **set_use_vsync** **(** :ref:`bool<class_bool>` value **)**
  669. - :ref:`bool<class_bool>` **is_vsync_enabled** **(** **)**
  670. If ``true``, vertical synchronization (Vsync) is enabled.
  671. .. rst-class:: classref-item-separator
  672. ----
  673. .. _class_OS_property_vsync_via_compositor:
  674. .. rst-class:: classref-property
  675. :ref:`bool<class_bool>` **vsync_via_compositor** = ``false``
  676. .. rst-class:: classref-property-setget
  677. - void **set_vsync_via_compositor** **(** :ref:`bool<class_bool>` value **)**
  678. - :ref:`bool<class_bool>` **is_vsync_via_compositor_enabled** **(** **)**
  679. If ``true`` and ``vsync_enabled`` is true, the operating system's window compositor will be used for vsync when the compositor is enabled and the game is in windowed mode.
  680. \ **Note:** This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it.
  681. \ **Note:** This property is only implemented on Windows.
  682. .. rst-class:: classref-item-separator
  683. ----
  684. .. _class_OS_property_window_borderless:
  685. .. rst-class:: classref-property
  686. :ref:`bool<class_bool>` **window_borderless** = ``false``
  687. .. rst-class:: classref-property-setget
  688. - void **set_borderless_window** **(** :ref:`bool<class_bool>` value **)**
  689. - :ref:`bool<class_bool>` **get_borderless_window** **(** **)**
  690. If ``true``, removes the window frame.
  691. \ **Note:** Setting ``window_borderless`` to ``false`` disables per-pixel transparency.
  692. .. rst-class:: classref-item-separator
  693. ----
  694. .. _class_OS_property_window_fullscreen:
  695. .. rst-class:: classref-property
  696. :ref:`bool<class_bool>` **window_fullscreen** = ``false``
  697. .. rst-class:: classref-property-setget
  698. - void **set_window_fullscreen** **(** :ref:`bool<class_bool>` value **)**
  699. - :ref:`bool<class_bool>` **is_window_fullscreen** **(** **)**
  700. If ``true``, the window is fullscreen.
  701. .. rst-class:: classref-item-separator
  702. ----
  703. .. _class_OS_property_window_maximized:
  704. .. rst-class:: classref-property
  705. :ref:`bool<class_bool>` **window_maximized** = ``false``
  706. .. rst-class:: classref-property-setget
  707. - void **set_window_maximized** **(** :ref:`bool<class_bool>` value **)**
  708. - :ref:`bool<class_bool>` **is_window_maximized** **(** **)**
  709. If ``true``, the window is maximized.
  710. .. rst-class:: classref-item-separator
  711. ----
  712. .. _class_OS_property_window_minimized:
  713. .. rst-class:: classref-property
  714. :ref:`bool<class_bool>` **window_minimized** = ``false``
  715. .. rst-class:: classref-property-setget
  716. - void **set_window_minimized** **(** :ref:`bool<class_bool>` value **)**
  717. - :ref:`bool<class_bool>` **is_window_minimized** **(** **)**
  718. If ``true``, the window is minimized.
  719. .. rst-class:: classref-item-separator
  720. ----
  721. .. _class_OS_property_window_per_pixel_transparency_enabled:
  722. .. rst-class:: classref-property
  723. :ref:`bool<class_bool>` **window_per_pixel_transparency_enabled** = ``false``
  724. .. rst-class:: classref-property-setget
  725. - void **set_window_per_pixel_transparency_enabled** **(** :ref:`bool<class_bool>` value **)**
  726. - :ref:`bool<class_bool>` **get_window_per_pixel_transparency_enabled** **(** **)**
  727. If ``true``, the window background is transparent and the window frame is removed.
  728. Use ``get_tree().get_root().set_transparent_background(true)`` to disable main viewport background rendering.
  729. \ **Note:** This property has no effect if :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed<class_ProjectSettings_property_display/window/per_pixel_transparency/allowed>` setting is disabled.
  730. \ **Note:** This property is implemented on HTML5, Linux, macOS, Windows, and Android. It can't be changed at runtime for Android. Use :ref:`ProjectSettings.display/window/per_pixel_transparency/enabled<class_ProjectSettings_property_display/window/per_pixel_transparency/enabled>` to set it at startup instead.
  731. .. rst-class:: classref-item-separator
  732. ----
  733. .. _class_OS_property_window_position:
  734. .. rst-class:: classref-property
  735. :ref:`Vector2<class_Vector2>` **window_position** = ``Vector2( 0, 0 )``
  736. .. rst-class:: classref-property-setget
  737. - void **set_window_position** **(** :ref:`Vector2<class_Vector2>` value **)**
  738. - :ref:`Vector2<class_Vector2>` **get_window_position** **(** **)**
  739. 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.
  740. .. rst-class:: classref-item-separator
  741. ----
  742. .. _class_OS_property_window_resizable:
  743. .. rst-class:: classref-property
  744. :ref:`bool<class_bool>` **window_resizable** = ``true``
  745. .. rst-class:: classref-property-setget
  746. - void **set_window_resizable** **(** :ref:`bool<class_bool>` value **)**
  747. - :ref:`bool<class_bool>` **is_window_resizable** **(** **)**
  748. If ``true``, the window is resizable by the user.
  749. .. rst-class:: classref-item-separator
  750. ----
  751. .. _class_OS_property_window_size:
  752. .. rst-class:: classref-property
  753. :ref:`Vector2<class_Vector2>` **window_size** = ``Vector2( 0, 0 )``
  754. .. rst-class:: classref-property-setget
  755. - void **set_window_size** **(** :ref:`Vector2<class_Vector2>` value **)**
  756. - :ref:`Vector2<class_Vector2>` **get_window_size** **(** **)**
  757. The size of the window (without counting window manager decorations).
  758. .. rst-class:: classref-section-separator
  759. ----
  760. .. rst-class:: classref-descriptions-group
  761. Method Descriptions
  762. -------------------
  763. .. _class_OS_method_alert:
  764. .. rst-class:: classref-method
  765. void **alert** **(** :ref:`String<class_String>` text, :ref:`String<class_String>` title="Alert!" **)**
  766. Displays a modal dialog box using the host OS' facilities. Execution is blocked until the dialog is closed.
  767. .. rst-class:: classref-item-separator
  768. ----
  769. .. _class_OS_method_can_draw:
  770. .. rst-class:: classref-method
  771. :ref:`bool<class_bool>` **can_draw** **(** **)** |const|
  772. Returns ``true`` if the host OS allows drawing.
  773. .. rst-class:: classref-item-separator
  774. ----
  775. .. _class_OS_method_can_use_threads:
  776. .. rst-class:: classref-method
  777. :ref:`bool<class_bool>` **can_use_threads** **(** **)** |const|
  778. Returns ``true`` if the current host platform is using multiple threads.
  779. .. rst-class:: classref-item-separator
  780. ----
  781. .. _class_OS_method_center_window:
  782. .. rst-class:: classref-method
  783. void **center_window** **(** **)**
  784. Centers the window on the screen if in windowed mode.
  785. .. rst-class:: classref-item-separator
  786. ----
  787. .. _class_OS_method_close_midi_inputs:
  788. .. rst-class:: classref-method
  789. void **close_midi_inputs** **(** **)**
  790. Shuts down system MIDI driver.
  791. \ **Note:** This method is implemented on Linux, macOS and Windows.
  792. .. rst-class:: classref-item-separator
  793. ----
  794. .. _class_OS_method_crash:
  795. .. rst-class:: classref-method
  796. void **crash** **(** :ref:`String<class_String>` message **)**
  797. Crashes the engine (or the editor if called within a ``tool`` script). This should *only* be used for testing the system's crash handler, not for any other purpose. For general error reporting, use (in order of preference) :ref:`@GDScript.assert<class_@GDScript_method_assert>`, :ref:`@GDScript.push_error<class_@GDScript_method_push_error>` or :ref:`alert<class_OS_method_alert>`. See also :ref:`kill<class_OS_method_kill>`.
  798. .. rst-class:: classref-item-separator
  799. ----
  800. .. _class_OS_method_delay_msec:
  801. .. rst-class:: classref-method
  802. void **delay_msec** **(** :ref:`int<class_int>` msec **)** |const|
  803. Delays execution of the current thread by ``msec`` milliseconds. ``msec`` must be greater than or equal to ``0``. Otherwise, :ref:`delay_msec<class_OS_method_delay_msec>` will do nothing and will print an error message.
  804. \ **Note:** :ref:`delay_msec<class_OS_method_delay_msec>` is a *blocking* way to delay code execution. To delay code execution in a non-blocking way, see :ref:`SceneTree.create_timer<class_SceneTree_method_create_timer>`. Yielding with :ref:`SceneTree.create_timer<class_SceneTree_method_create_timer>` will delay the execution of code placed below the ``yield`` without affecting the rest of the project (or editor, for :ref:`EditorPlugin<class_EditorPlugin>`\ s and :ref:`EditorScript<class_EditorScript>`\ s).
  805. \ **Note:** When :ref:`delay_msec<class_OS_method_delay_msec>` is called on the main thread, it will freeze the project and will prevent it from redrawing and registering input until the delay has passed. When using :ref:`delay_msec<class_OS_method_delay_msec>` as part of an :ref:`EditorPlugin<class_EditorPlugin>` or :ref:`EditorScript<class_EditorScript>`, it will freeze the editor but won't freeze the project if it is currently running (since the project is an independent child process).
  806. .. rst-class:: classref-item-separator
  807. ----
  808. .. _class_OS_method_delay_usec:
  809. .. rst-class:: classref-method
  810. void **delay_usec** **(** :ref:`int<class_int>` usec **)** |const|
  811. Delays execution of the current thread by ``usec`` microseconds. ``usec`` must be greater than or equal to ``0``. Otherwise, :ref:`delay_usec<class_OS_method_delay_usec>` will do nothing and will print an error message.
  812. \ **Note:** :ref:`delay_usec<class_OS_method_delay_usec>` is a *blocking* way to delay code execution. To delay code execution in a non-blocking way, see :ref:`SceneTree.create_timer<class_SceneTree_method_create_timer>`. Yielding with :ref:`SceneTree.create_timer<class_SceneTree_method_create_timer>` will delay the execution of code placed below the ``yield`` without affecting the rest of the project (or editor, for :ref:`EditorPlugin<class_EditorPlugin>`\ s and :ref:`EditorScript<class_EditorScript>`\ s).
  813. \ **Note:** When :ref:`delay_usec<class_OS_method_delay_usec>` is called on the main thread, it will freeze the project and will prevent it from redrawing and registering input until the delay has passed. When using :ref:`delay_usec<class_OS_method_delay_usec>` as part of an :ref:`EditorPlugin<class_EditorPlugin>` or :ref:`EditorScript<class_EditorScript>`, it will freeze the editor but won't freeze the project if it is currently running (since the project is an independent child process).
  814. .. rst-class:: classref-item-separator
  815. ----
  816. .. _class_OS_method_dump_memory_to_file:
  817. .. rst-class:: classref-method
  818. void **dump_memory_to_file** **(** :ref:`String<class_String>` file **)**
  819. Dumps the memory allocation ringlist to a file (only works in debug).
  820. Entry format per line: "Address - Size - Description".
  821. .. rst-class:: classref-item-separator
  822. ----
  823. .. _class_OS_method_dump_resources_to_file:
  824. .. rst-class:: classref-method
  825. void **dump_resources_to_file** **(** :ref:`String<class_String>` file **)**
  826. Dumps all used resources to file (only works in debug).
  827. Entry format per line: "Resource Type : Resource Location".
  828. At the end of the file is a statistic of all used Resource Types.
  829. .. rst-class:: classref-item-separator
  830. ----
  831. .. _class_OS_method_execute:
  832. .. rst-class:: classref-method
  833. :ref:`int<class_int>` **execute** **(** :ref:`String<class_String>` path, :ref:`PoolStringArray<class_PoolStringArray>` arguments, :ref:`bool<class_bool>` blocking=true, :ref:`Array<class_Array>` output=[ ], :ref:`bool<class_bool>` read_stderr=false, :ref:`bool<class_bool>` open_console=false **)**
  834. Execute the file at the given path with the arguments passed as an array of strings. Platform path resolution will take place. The resolved file must exist and be executable.
  835. The arguments are used in the given order and separated by a space, so ``OS.execute("ping", ["-w", "3", "godotengine.org"], false)`` will resolve to ``ping -w 3 godotengine.org`` in the system's shell.
  836. This method has slightly different behavior based on whether the ``blocking`` mode is enabled.
  837. If ``blocking`` is ``true``, the Godot thread will pause its execution while waiting for the process to terminate. The shell output of the process will be written to the ``output`` array as a single string. When the process terminates, the Godot thread will resume execution.
  838. If ``blocking`` is ``false``, the Godot thread will continue while the new process runs. It is not possible to retrieve the shell output in non-blocking mode, so ``output`` will be empty.
  839. On Windows, if ``open_console`` is ``true`` and process is console app, new terminal window will be opened, it's ignored on other platforms.
  840. The return value also depends on the blocking mode. When blocking, the method will return an exit code of the process. When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with :ref:`kill<class_OS_method_kill>`). If the process forking (non-blocking) or opening (blocking) fails, the method will return ``-1`` or another exit code.
  841. Example of blocking mode and retrieving the shell output:
  842. ::
  843. var output = []
  844. var exit_code = OS.execute("ls", ["-l", "/tmp"], true, output)
  845. Example of non-blocking mode, running another instance of the project and storing its process ID:
  846. ::
  847. var pid = OS.execute(OS.get_executable_path(), [], false)
  848. If you wish to access a shell built-in or perform a composite command, a platform-specific shell can be invoked. For example:
  849. ::
  850. OS.execute("CMD.exe", ["/C", "cd %TEMP% && dir"], true, output)
  851. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows.
  852. \ **Note:** To execute a Windows command interpreter built-in command, specify ``cmd.exe`` in ``path``, ``/c`` as the first argument, and the desired command as the second argument.
  853. \ **Note:** To execute a PowerShell built-in command, specify ``powershell.exe`` in ``path``, ``-Command`` as the first argument, and the desired command as the second argument.
  854. \ **Note:** To execute a Unix shell built-in command, specify shell executable name in ``path``, ``-c`` as the first argument, and the desired command as the second argument.
  855. .. rst-class:: classref-item-separator
  856. ----
  857. .. _class_OS_method_find_scancode_from_string:
  858. .. rst-class:: classref-method
  859. :ref:`int<class_int>` **find_scancode_from_string** **(** :ref:`String<class_String>` string **)** |const|
  860. Returns the scancode of the given string (e.g. "Escape").
  861. .. rst-class:: classref-item-separator
  862. ----
  863. .. _class_OS_method_get_audio_driver_count:
  864. .. rst-class:: classref-method
  865. :ref:`int<class_int>` **get_audio_driver_count** **(** **)** |const|
  866. Returns the total number of available audio drivers.
  867. .. rst-class:: classref-item-separator
  868. ----
  869. .. _class_OS_method_get_audio_driver_name:
  870. .. rst-class:: classref-method
  871. :ref:`String<class_String>` **get_audio_driver_name** **(** :ref:`int<class_int>` driver **)** |const|
  872. Returns the audio driver name for the given index.
  873. .. rst-class:: classref-item-separator
  874. ----
  875. .. _class_OS_method_get_cache_dir:
  876. .. rst-class:: classref-method
  877. :ref:`String<class_String>` **get_cache_dir** **(** **)** |const|
  878. Returns the *global* cache data directory according to the operating system's standards. On Linux, this path can be overridden by setting the ``XDG_CACHE_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_config_dir<class_OS_method_get_config_dir>` and :ref:`get_data_dir<class_OS_method_get_data_dir>`.
  879. Not to be confused with :ref:`get_user_data_dir<class_OS_method_get_user_data_dir>`, which returns the *project-specific* user data path.
  880. .. rst-class:: classref-item-separator
  881. ----
  882. .. _class_OS_method_get_cmdline_args:
  883. .. rst-class:: classref-method
  884. :ref:`PoolStringArray<class_PoolStringArray>` **get_cmdline_args** **(** **)**
  885. Returns the command-line arguments passed to the engine.
  886. Command-line arguments can be written in any form, including both ``--key value`` and ``--key=value`` forms so they can be properly parsed, as long as custom command-line arguments do not conflict with engine arguments.
  887. You can also incorporate environment variables using the :ref:`get_environment<class_OS_method_get_environment>` method.
  888. You can set :ref:`ProjectSettings.editor/main_run_args<class_ProjectSettings_property_editor/main_run_args>` to define command-line arguments to be passed by the editor when running the project.
  889. Here's a minimal example on how to parse command-line arguments into a dictionary using the ``--key=value`` form for arguments:
  890. ::
  891. var arguments = {}
  892. for argument in OS.get_cmdline_args():
  893. if argument.find("=") > -1:
  894. var key_value = argument.split("=")
  895. arguments[key_value[0].lstrip("--")] = key_value[1]
  896. else:
  897. # Options without an argument will be present in the dictionary,
  898. # with the value set to an empty string.
  899. arguments[argument.lstrip("--")] = ""
  900. .. rst-class:: classref-item-separator
  901. ----
  902. .. _class_OS_method_get_config_dir:
  903. .. rst-class:: classref-method
  904. :ref:`String<class_String>` **get_config_dir** **(** **)** |const|
  905. Returns the *global* user configuration directory according to the operating system's standards. On Linux, this path can be overridden by setting the ``XDG_CONFIG_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_cache_dir<class_OS_method_get_cache_dir>` and :ref:`get_data_dir<class_OS_method_get_data_dir>`.
  906. Not to be confused with :ref:`get_user_data_dir<class_OS_method_get_user_data_dir>`, which returns the *project-specific* user data path.
  907. .. rst-class:: classref-item-separator
  908. ----
  909. .. _class_OS_method_get_connected_midi_inputs:
  910. .. rst-class:: classref-method
  911. :ref:`PoolStringArray<class_PoolStringArray>` **get_connected_midi_inputs** **(** **)**
  912. Returns an array of MIDI device names.
  913. The returned array will be empty if the system MIDI driver has not previously been initialised with :ref:`open_midi_inputs<class_OS_method_open_midi_inputs>`.
  914. \ **Note:** This method is implemented on Linux, macOS and Windows.
  915. .. rst-class:: classref-item-separator
  916. ----
  917. .. _class_OS_method_get_current_video_driver:
  918. .. rst-class:: classref-method
  919. :ref:`VideoDriver<enum_OS_VideoDriver>` **get_current_video_driver** **(** **)** |const|
  920. Returns the currently used video driver, using one of the values from :ref:`VideoDriver<enum_OS_VideoDriver>`.
  921. .. rst-class:: classref-item-separator
  922. ----
  923. .. _class_OS_method_get_data_dir:
  924. .. rst-class:: classref-method
  925. :ref:`String<class_String>` **get_data_dir** **(** **)** |const|
  926. Returns the *global* user data directory according to the operating system's standards. On Linux, this path can be overridden by setting the ``XDG_DATA_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_cache_dir<class_OS_method_get_cache_dir>` and :ref:`get_config_dir<class_OS_method_get_config_dir>`.
  927. Not to be confused with :ref:`get_user_data_dir<class_OS_method_get_user_data_dir>`, which returns the *project-specific* user data path.
  928. .. rst-class:: classref-item-separator
  929. ----
  930. .. _class_OS_method_get_date:
  931. .. rst-class:: classref-method
  932. :ref:`Dictionary<class_Dictionary>` **get_date** **(** :ref:`bool<class_bool>` utc=false **)** |const|
  933. Deprecated, use :ref:`Time.get_date_dict_from_system<class_Time_method_get_date_dict_from_system>` instead.
  934. Returns current date as a dictionary of keys: ``year``, ``month``, ``day``, ``weekday``, ``dst`` (Daylight Savings Time).
  935. .. rst-class:: classref-item-separator
  936. ----
  937. .. _class_OS_method_get_datetime:
  938. .. rst-class:: classref-method
  939. :ref:`Dictionary<class_Dictionary>` **get_datetime** **(** :ref:`bool<class_bool>` utc=false **)** |const|
  940. Deprecated, use :ref:`Time.get_datetime_dict_from_system<class_Time_method_get_datetime_dict_from_system>` instead.
  941. Returns current datetime as a dictionary of keys: ``year``, ``month``, ``day``, ``weekday``, ``dst`` (Daylight Savings Time), ``hour``, ``minute``, ``second``.
  942. .. rst-class:: classref-item-separator
  943. ----
  944. .. _class_OS_method_get_datetime_from_unix_time:
  945. .. rst-class:: classref-method
  946. :ref:`Dictionary<class_Dictionary>` **get_datetime_from_unix_time** **(** :ref:`int<class_int>` unix_time_val **)** |const|
  947. Deprecated, use :ref:`Time.get_datetime_dict_from_unix_time<class_Time_method_get_datetime_dict_from_unix_time>` instead.
  948. Gets a dictionary of time values corresponding to the given UNIX epoch time (in seconds).
  949. The returned Dictionary's values will be the same as :ref:`get_datetime<class_OS_method_get_datetime>`, with the exception of Daylight Savings Time as it cannot be determined from the epoch.
  950. .. rst-class:: classref-item-separator
  951. ----
  952. .. _class_OS_method_get_display_cutouts:
  953. .. rst-class:: classref-method
  954. :ref:`Array<class_Array>` **get_display_cutouts** **(** **)** |const|
  955. Returns an :ref:`Array<class_Array>` of :ref:`Rect2<class_Rect2>`, each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also :ref:`get_window_safe_area<class_OS_method_get_window_safe_area>`.
  956. \ **Note:** Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
  957. .. rst-class:: classref-item-separator
  958. ----
  959. .. _class_OS_method_get_dynamic_memory_usage:
  960. .. rst-class:: classref-method
  961. :ref:`int<class_int>` **get_dynamic_memory_usage** **(** **)** |const|
  962. Returns the total amount of dynamic memory used (only works in debug).
  963. .. rst-class:: classref-item-separator
  964. ----
  965. .. _class_OS_method_get_environment:
  966. .. rst-class:: classref-method
  967. :ref:`String<class_String>` **get_environment** **(** :ref:`String<class_String>` variable **)** |const|
  968. Returns the value of an environment variable. Returns an empty string if the environment variable doesn't exist.
  969. \ **Note:** Double-check the casing of ``variable``. Environment variable names are case-sensitive on all platforms except Windows.
  970. .. rst-class:: classref-item-separator
  971. ----
  972. .. _class_OS_method_get_executable_path:
  973. .. rst-class:: classref-method
  974. :ref:`String<class_String>` **get_executable_path** **(** **)** |const|
  975. Returns the path to the current engine executable.
  976. .. rst-class:: classref-item-separator
  977. ----
  978. .. _class_OS_method_get_granted_permissions:
  979. .. rst-class:: classref-method
  980. :ref:`PoolStringArray<class_PoolStringArray>` **get_granted_permissions** **(** **)** |const|
  981. With this function, you can get the list of dangerous permissions that have been granted to the Android application.
  982. \ **Note:** This method is implemented on Android.
  983. .. rst-class:: classref-item-separator
  984. ----
  985. .. _class_OS_method_get_ime_selection:
  986. .. rst-class:: classref-method
  987. :ref:`Vector2<class_Vector2>` **get_ime_selection** **(** **)** |const|
  988. Returns the IME cursor position (the currently-edited portion of the string) relative to the characters in the composition string.
  989. \ :ref:`MainLoop.NOTIFICATION_OS_IME_UPDATE<class_MainLoop_constant_NOTIFICATION_OS_IME_UPDATE>` is sent to the application to notify it of changes to the IME cursor position.
  990. \ **Note:** This method is implemented on macOS.
  991. .. rst-class:: classref-item-separator
  992. ----
  993. .. _class_OS_method_get_ime_text:
  994. .. rst-class:: classref-method
  995. :ref:`String<class_String>` **get_ime_text** **(** **)** |const|
  996. Returns the IME intermediate composition string.
  997. \ :ref:`MainLoop.NOTIFICATION_OS_IME_UPDATE<class_MainLoop_constant_NOTIFICATION_OS_IME_UPDATE>` is sent to the application to notify it of changes to the IME composition string.
  998. \ **Note:** This method is implemented on macOS.
  999. .. rst-class:: classref-item-separator
  1000. ----
  1001. .. _class_OS_method_get_latin_keyboard_variant:
  1002. .. rst-class:: classref-method
  1003. :ref:`String<class_String>` **get_latin_keyboard_variant** **(** **)** |const|
  1004. Returns the current latin keyboard variant as a String.
  1005. Possible return values are: ``"QWERTY"``, ``"AZERTY"``, ``"QZERTY"``, ``"DVORAK"``, ``"NEO"``, ``"COLEMAK"`` or ``"ERROR"``.
  1006. \ **Note:** This method is implemented on Linux, macOS and Windows. Returns ``"QWERTY"`` on unsupported platforms.
  1007. .. rst-class:: classref-item-separator
  1008. ----
  1009. .. _class_OS_method_get_locale:
  1010. .. rst-class:: classref-method
  1011. :ref:`String<class_String>` **get_locale** **(** **)** |const|
  1012. Returns the host OS locale as a string of the form ``language_Script_COUNTRY_VARIANT@extra``. If you want only the language code and not the fully specified locale from the OS, you can use :ref:`get_locale_language<class_OS_method_get_locale_language>`.
  1013. \ ``language`` - 2 or 3-letter `language code <https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes>`__, in lower case.
  1014. \ ``Script`` - optional, 4-letter `script code <https://en.wikipedia.org/wiki/ISO_15924>`__, in title case.
  1015. \ ``COUNTRY`` - optional, 2 or 3-letter `country code <https://en.wikipedia.org/wiki/ISO_3166-1>`__, in upper case.
  1016. \ ``VARIANT`` - optional, language variant, region and sort order. Variant can have any number of underscored keywords.
  1017. \ ``extra`` - optional, semicolon separated list of additional key words. Currency, calendar, sort order and numbering system information.
  1018. .. rst-class:: classref-item-separator
  1019. ----
  1020. .. _class_OS_method_get_locale_language:
  1021. .. rst-class:: classref-method
  1022. :ref:`String<class_String>` **get_locale_language** **(** **)** |const|
  1023. Returns the host OS locale's 2 or 3-letter `language code <https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes>`__ as a string which should be consistent on all platforms. This is equivalent to extracting the ``language`` part of the :ref:`get_locale<class_OS_method_get_locale>` string.
  1024. This can be used to narrow down fully specified locale strings to only the "common" language code, when you don't need the additional information about country code or variants. For example, for a French Canadian user with ``fr_CA`` locale, this would return ``fr``.
  1025. .. rst-class:: classref-item-separator
  1026. ----
  1027. .. _class_OS_method_get_main_thread_id:
  1028. .. rst-class:: classref-method
  1029. :ref:`int<class_int>` **get_main_thread_id** **(** **)** |const|
  1030. Returns the ID of the main thread. See :ref:`get_thread_caller_id<class_OS_method_get_thread_caller_id>`.
  1031. \ **Note:** Thread IDs are not deterministic and may be reused across application restarts.
  1032. .. rst-class:: classref-item-separator
  1033. ----
  1034. .. _class_OS_method_get_model_name:
  1035. .. rst-class:: classref-method
  1036. :ref:`String<class_String>` **get_model_name** **(** **)** |const|
  1037. Returns the model name of the current device.
  1038. \ **Note:** This method is implemented on Android and iOS. Returns ``"GenericDevice"`` on unsupported platforms.
  1039. .. rst-class:: classref-item-separator
  1040. ----
  1041. .. _class_OS_method_get_name:
  1042. .. rst-class:: classref-method
  1043. :ref:`String<class_String>` **get_name** **(** **)** |const|
  1044. Returns the name of the host OS. Possible values are: ``"Android"``, ``"iOS"``, ``"HTML5"``, ``"OSX"``, ``"Server"``, ``"Windows"``, ``"UWP"``, ``"X11"``.
  1045. .. rst-class:: classref-item-separator
  1046. ----
  1047. .. _class_OS_method_get_native_handle:
  1048. .. rst-class:: classref-method
  1049. :ref:`int<class_int>` **get_native_handle** **(** :ref:`HandleType<enum_OS_HandleType>` handle_type **)**
  1050. Returns internal structure pointers for use in GDNative plugins.
  1051. \ **Note:** This method is implemented on Linux and Windows (other OSs will soon be supported).
  1052. .. rst-class:: classref-item-separator
  1053. ----
  1054. .. _class_OS_method_get_power_percent_left:
  1055. .. rst-class:: classref-method
  1056. :ref:`int<class_int>` **get_power_percent_left** **(** **)**
  1057. Returns the amount of battery left in the device as a percentage. Returns ``-1`` if power state is unknown.
  1058. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1059. .. rst-class:: classref-item-separator
  1060. ----
  1061. .. _class_OS_method_get_power_seconds_left:
  1062. .. rst-class:: classref-method
  1063. :ref:`int<class_int>` **get_power_seconds_left** **(** **)**
  1064. Returns an estimate of the time left in seconds before the device runs out of battery. Returns ``-1`` if power state is unknown.
  1065. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1066. .. rst-class:: classref-item-separator
  1067. ----
  1068. .. _class_OS_method_get_power_state:
  1069. .. rst-class:: classref-method
  1070. :ref:`PowerState<enum_OS_PowerState>` **get_power_state** **(** **)**
  1071. Returns the current state of the device regarding battery and power. See :ref:`PowerState<enum_OS_PowerState>` constants.
  1072. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1073. .. rst-class:: classref-item-separator
  1074. ----
  1075. .. _class_OS_method_get_process_id:
  1076. .. rst-class:: classref-method
  1077. :ref:`int<class_int>` **get_process_id** **(** **)** |const|
  1078. Returns the project's process ID.
  1079. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows.
  1080. .. rst-class:: classref-item-separator
  1081. ----
  1082. .. _class_OS_method_get_processor_count:
  1083. .. rst-class:: classref-method
  1084. :ref:`int<class_int>` **get_processor_count** **(** **)** |const|
  1085. Returns the number of *logical* CPU cores available on the host machine. On CPUs with HyperThreading enabled, this number will be greater than the number of *physical* CPU cores.
  1086. .. rst-class:: classref-item-separator
  1087. ----
  1088. .. _class_OS_method_get_processor_name:
  1089. .. rst-class:: classref-method
  1090. :ref:`String<class_String>` **get_processor_name** **(** **)** |const|
  1091. Returns the name of the CPU model on the host machine (e.g. "Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz").
  1092. \ **Note:** This method is only implemented on Windows, macOS, Linux and iOS. On Android, HTML5 and UWP, :ref:`get_processor_name<class_OS_method_get_processor_name>` returns an empty string.
  1093. .. rst-class:: classref-item-separator
  1094. ----
  1095. .. _class_OS_method_get_real_window_size:
  1096. .. rst-class:: classref-method
  1097. :ref:`Vector2<class_Vector2>` **get_real_window_size** **(** **)** |const|
  1098. Returns the window size including decorations like window borders.
  1099. .. rst-class:: classref-item-separator
  1100. ----
  1101. .. _class_OS_method_get_scancode_string:
  1102. .. rst-class:: classref-method
  1103. :ref:`String<class_String>` **get_scancode_string** **(** :ref:`int<class_int>` code **)** |const|
  1104. Returns the given scancode as a string (e.g. Return values: ``"Escape"``, ``"Shift+Escape"``).
  1105. See also :ref:`InputEventKey.scancode<class_InputEventKey_property_scancode>` and :ref:`InputEventKey.get_scancode_with_modifiers<class_InputEventKey_method_get_scancode_with_modifiers>`.
  1106. .. rst-class:: classref-item-separator
  1107. ----
  1108. .. _class_OS_method_get_screen_count:
  1109. .. rst-class:: classref-method
  1110. :ref:`int<class_int>` **get_screen_count** **(** **)** |const|
  1111. Returns the number of displays attached to the host machine.
  1112. .. rst-class:: classref-item-separator
  1113. ----
  1114. .. _class_OS_method_get_screen_dpi:
  1115. .. rst-class:: classref-method
  1116. :ref:`int<class_int>` **get_screen_dpi** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1117. Returns the dots per inch density of the specified screen. If ``screen`` is ``-1`` (the default value), the current screen will be used.
  1118. \ **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used.
  1119. \ **Note:** On Android devices, the actual screen densities are grouped into six generalized densities:
  1120. ::
  1121. ldpi - 120 dpi
  1122. mdpi - 160 dpi
  1123. hdpi - 240 dpi
  1124. xhdpi - 320 dpi
  1125. xxhdpi - 480 dpi
  1126. xxxhdpi - 640 dpi
  1127. \ **Note:** This method is implemented on Android, Linux, macOS and Windows. Returns ``72`` on unsupported platforms.
  1128. .. rst-class:: classref-item-separator
  1129. ----
  1130. .. _class_OS_method_get_screen_max_scale:
  1131. .. rst-class:: classref-method
  1132. :ref:`float<class_float>` **get_screen_max_scale** **(** **)** |const|
  1133. Return the greatest scale factor of all screens.
  1134. \ **Note:** On macOS returned value is ``2.0`` if there is at least one hiDPI (Retina) screen in the system, and ``1.0`` in all other cases.
  1135. \ **Note:** This method is implemented on macOS.
  1136. .. rst-class:: classref-item-separator
  1137. ----
  1138. .. _class_OS_method_get_screen_position:
  1139. .. rst-class:: classref-method
  1140. :ref:`Vector2<class_Vector2>` **get_screen_position** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1141. Returns the position of the specified screen by index. If ``screen`` is ``-1`` (the default value), the current screen will be used.
  1142. .. rst-class:: classref-item-separator
  1143. ----
  1144. .. _class_OS_method_get_screen_refresh_rate:
  1145. .. rst-class:: classref-method
  1146. :ref:`float<class_float>` **get_screen_refresh_rate** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1147. Returns the current refresh rate of the specified screen. If ``screen`` is ``-1`` (the default value), the current screen will be used.
  1148. \ **Note:** Returns ``-1.0`` if Godot fails to find the refresh rate for the specified screen. On HTML5, :ref:`get_screen_refresh_rate<class_OS_method_get_screen_refresh_rate>` will always return ``-1.0`` as there is no way to retrieve the refresh rate on that platform.
  1149. To fallback to a default refresh rate if the method fails, try:
  1150. ::
  1151. var refresh_rate = OS.get_screen_refresh_rate()
  1152. if refresh_rate < 0:
  1153. refresh_rate = 60.0
  1154. .. rst-class:: classref-item-separator
  1155. ----
  1156. .. _class_OS_method_get_screen_scale:
  1157. .. rst-class:: classref-method
  1158. :ref:`float<class_float>` **get_screen_scale** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1159. Return the scale factor of the specified screen by index. If ``screen`` is ``-1`` (the default value), the current screen will be used.
  1160. \ **Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases.
  1161. \ **Note:** This method is implemented on macOS.
  1162. .. rst-class:: classref-item-separator
  1163. ----
  1164. .. _class_OS_method_get_screen_size:
  1165. .. rst-class:: classref-method
  1166. :ref:`Vector2<class_Vector2>` **get_screen_size** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1167. Returns the dimensions in pixels of the specified screen. If ``screen`` is ``-1`` (the default value), the current screen will be used.
  1168. .. rst-class:: classref-item-separator
  1169. ----
  1170. .. _class_OS_method_get_splash_tick_msec:
  1171. .. rst-class:: classref-method
  1172. :ref:`int<class_int>` **get_splash_tick_msec** **(** **)** |const|
  1173. Returns the amount of time in milliseconds it took for the boot logo to appear.
  1174. .. rst-class:: classref-item-separator
  1175. ----
  1176. .. _class_OS_method_get_static_memory_peak_usage:
  1177. .. rst-class:: classref-method
  1178. :ref:`int<class_int>` **get_static_memory_peak_usage** **(** **)** |const|
  1179. Returns the maximum amount of static memory used (only works in debug).
  1180. .. rst-class:: classref-item-separator
  1181. ----
  1182. .. _class_OS_method_get_static_memory_usage:
  1183. .. rst-class:: classref-method
  1184. :ref:`int<class_int>` **get_static_memory_usage** **(** **)** |const|
  1185. Returns the amount of static memory being used by the program in bytes (only works in debug).
  1186. .. rst-class:: classref-item-separator
  1187. ----
  1188. .. _class_OS_method_get_system_dir:
  1189. .. rst-class:: classref-method
  1190. :ref:`String<class_String>` **get_system_dir** **(** :ref:`SystemDir<enum_OS_SystemDir>` dir, :ref:`bool<class_bool>` shared_storage=true **)** |const|
  1191. Returns the actual path to commonly used folders across different platforms. Available locations are specified in :ref:`SystemDir<enum_OS_SystemDir>`.
  1192. \ **Note:** This method is implemented on Android, Linux, macOS and Windows.
  1193. \ **Note:** Shared storage is implemented on Android and allows to differentiate between app specific and shared directories. Shared directories have additional restrictions on Android.
  1194. .. rst-class:: classref-item-separator
  1195. ----
  1196. .. _class_OS_method_get_system_time_msecs:
  1197. .. rst-class:: classref-method
  1198. :ref:`int<class_int>` **get_system_time_msecs** **(** **)** |const|
  1199. Returns the epoch time of the operating system in milliseconds.
  1200. .. rst-class:: classref-item-separator
  1201. ----
  1202. .. _class_OS_method_get_system_time_secs:
  1203. .. rst-class:: classref-method
  1204. :ref:`int<class_int>` **get_system_time_secs** **(** **)** |const|
  1205. Returns the epoch time of the operating system in seconds.
  1206. .. rst-class:: classref-item-separator
  1207. ----
  1208. .. _class_OS_method_get_tablet_driver_count:
  1209. .. rst-class:: classref-method
  1210. :ref:`int<class_int>` **get_tablet_driver_count** **(** **)** |const|
  1211. Returns the total number of available tablet drivers.
  1212. \ **Note:** This method is implemented on Windows.
  1213. .. rst-class:: classref-item-separator
  1214. ----
  1215. .. _class_OS_method_get_tablet_driver_name:
  1216. .. rst-class:: classref-method
  1217. :ref:`String<class_String>` **get_tablet_driver_name** **(** :ref:`int<class_int>` idx **)** |const|
  1218. Returns the tablet driver name for the given index.
  1219. \ **Note:** This method is implemented on Windows.
  1220. .. rst-class:: classref-item-separator
  1221. ----
  1222. .. _class_OS_method_get_thread_caller_id:
  1223. .. rst-class:: classref-method
  1224. :ref:`int<class_int>` **get_thread_caller_id** **(** **)** |const|
  1225. Returns the ID of the current thread. This can be used in logs to ease debugging of multi-threaded applications.
  1226. \ **Note:** Thread IDs are not deterministic and may be reused across application restarts.
  1227. .. rst-class:: classref-item-separator
  1228. ----
  1229. .. _class_OS_method_get_ticks_msec:
  1230. .. rst-class:: classref-method
  1231. :ref:`int<class_int>` **get_ticks_msec** **(** **)** |const|
  1232. Deprecated, use :ref:`Time.get_ticks_msec<class_Time_method_get_ticks_msec>` instead.
  1233. Returns the amount of time passed in milliseconds since the engine started.
  1234. .. rst-class:: classref-item-separator
  1235. ----
  1236. .. _class_OS_method_get_ticks_usec:
  1237. .. rst-class:: classref-method
  1238. :ref:`int<class_int>` **get_ticks_usec** **(** **)** |const|
  1239. Deprecated, use :ref:`Time.get_ticks_usec<class_Time_method_get_ticks_usec>` instead.
  1240. Returns the amount of time passed in microseconds since the engine started.
  1241. .. rst-class:: classref-item-separator
  1242. ----
  1243. .. _class_OS_method_get_time:
  1244. .. rst-class:: classref-method
  1245. :ref:`Dictionary<class_Dictionary>` **get_time** **(** :ref:`bool<class_bool>` utc=false **)** |const|
  1246. Deprecated, use :ref:`Time.get_time_dict_from_system<class_Time_method_get_time_dict_from_system>` instead.
  1247. Returns current time as a dictionary of keys: hour, minute, second.
  1248. .. rst-class:: classref-item-separator
  1249. ----
  1250. .. _class_OS_method_get_time_zone_info:
  1251. .. rst-class:: classref-method
  1252. :ref:`Dictionary<class_Dictionary>` **get_time_zone_info** **(** **)** |const|
  1253. Returns the current time zone as a dictionary with the keys: bias and name.
  1254. .. rst-class:: classref-item-separator
  1255. ----
  1256. .. _class_OS_method_get_unique_id:
  1257. .. rst-class:: classref-method
  1258. :ref:`String<class_String>` **get_unique_id** **(** **)** |const|
  1259. Returns a string that is unique to the device.
  1260. \ **Note:** This string may change without notice if the user reinstalls/upgrades their operating system or changes their hardware. This means it should generally not be used to encrypt persistent data as the data saved before an unexpected ID change would become inaccessible. The returned string may also be falsified using external programs, so do not rely on the string returned by :ref:`get_unique_id<class_OS_method_get_unique_id>` for security purposes.
  1261. \ **Note:** Returns an empty string on HTML5 and UWP, as this method isn't implemented on those platforms yet.
  1262. .. rst-class:: classref-item-separator
  1263. ----
  1264. .. _class_OS_method_get_unix_time:
  1265. .. rst-class:: classref-method
  1266. :ref:`int<class_int>` **get_unix_time** **(** **)** |const|
  1267. Returns the current UNIX epoch timestamp in seconds.
  1268. \ **Important:** This is the system clock that the user can manually set. **Never use** this method for precise time calculation since its results are also subject to automatic adjustments by the operating system. **Always use** :ref:`get_ticks_usec<class_OS_method_get_ticks_usec>` or :ref:`get_ticks_msec<class_OS_method_get_ticks_msec>` for precise time calculation instead, since they are guaranteed to be monotonic (i.e. never decrease).
  1269. \ **Note:** To get a floating point timestamp with sub-second precision, use :ref:`Time.get_unix_time_from_system<class_Time_method_get_unix_time_from_system>`.
  1270. .. rst-class:: classref-item-separator
  1271. ----
  1272. .. _class_OS_method_get_unix_time_from_datetime:
  1273. .. rst-class:: classref-method
  1274. :ref:`int<class_int>` **get_unix_time_from_datetime** **(** :ref:`Dictionary<class_Dictionary>` datetime **)** |const|
  1275. Gets an epoch time value from a dictionary of time values.
  1276. \ ``datetime`` must be populated with the following keys: ``year``, ``month``, ``day``, ``hour``, ``minute``, ``second``.
  1277. If the dictionary is empty ``0`` is returned. If some keys are omitted, they default to the equivalent values for the UNIX epoch timestamp 0 (1970-01-01 at 00:00:00 UTC).
  1278. You can pass the output from :ref:`get_datetime_from_unix_time<class_OS_method_get_datetime_from_unix_time>` directly into this function. Daylight Savings Time (``dst``), if present, is ignored.
  1279. .. rst-class:: classref-item-separator
  1280. ----
  1281. .. _class_OS_method_get_user_data_dir:
  1282. .. rst-class:: classref-method
  1283. :ref:`String<class_String>` **get_user_data_dir** **(** **)** |const|
  1284. Returns the absolute directory path where user data is written (``user://``).
  1285. On Linux, this is ``~/.local/share/godot/app_userdata/[project_name]``, or ``~/.local/share/[custom_name]`` if ``use_custom_user_dir`` is set.
  1286. On macOS, this is ``~/Library/Application Support/Godot/app_userdata/[project_name]``, or ``~/Library/Application Support/[custom_name]`` if ``use_custom_user_dir`` is set.
  1287. On Windows, this is ``%APPDATA%\Godot\app_userdata\[project_name]``, or ``%APPDATA%\[custom_name]`` if ``use_custom_user_dir`` is set. ``%APPDATA%`` expands to ``%USERPROFILE%\AppData\Roaming``.
  1288. If the project name is empty, ``user://`` falls back to ``res://``.
  1289. Not to be confused with :ref:`get_data_dir<class_OS_method_get_data_dir>`, which returns the *global* (non-project-specific) user data directory.
  1290. .. rst-class:: classref-item-separator
  1291. ----
  1292. .. _class_OS_method_get_video_driver_count:
  1293. .. rst-class:: classref-method
  1294. :ref:`int<class_int>` **get_video_driver_count** **(** **)** |const|
  1295. Returns the number of video drivers supported on the current platform.
  1296. .. rst-class:: classref-item-separator
  1297. ----
  1298. .. _class_OS_method_get_video_driver_name:
  1299. .. rst-class:: classref-method
  1300. :ref:`String<class_String>` **get_video_driver_name** **(** :ref:`VideoDriver<enum_OS_VideoDriver>` driver **)** |const|
  1301. Returns the name of the video driver matching the given ``driver`` index. This index is a value from :ref:`VideoDriver<enum_OS_VideoDriver>`, and you can use :ref:`get_current_video_driver<class_OS_method_get_current_video_driver>` to get the current backend's index.
  1302. .. rst-class:: classref-item-separator
  1303. ----
  1304. .. _class_OS_method_get_virtual_keyboard_height:
  1305. .. rst-class:: classref-method
  1306. :ref:`int<class_int>` **get_virtual_keyboard_height** **(** **)**
  1307. Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
  1308. .. rst-class:: classref-item-separator
  1309. ----
  1310. .. _class_OS_method_get_window_safe_area:
  1311. .. rst-class:: classref-method
  1312. :ref:`Rect2<class_Rect2>` **get_window_safe_area** **(** **)** |const|
  1313. Returns unobscured area of the window where interactive controls should be rendered.
  1314. .. rst-class:: classref-item-separator
  1315. ----
  1316. .. _class_OS_method_global_menu_add_item:
  1317. .. rst-class:: classref-method
  1318. void **global_menu_add_item** **(** :ref:`String<class_String>` menu, :ref:`String<class_String>` label, :ref:`Variant<class_Variant>` id, :ref:`Variant<class_Variant>` meta **)**
  1319. Add a new item with text "label" to global menu. Use "_dock" menu to add item to the macOS dock icon menu.
  1320. \ **Note:** This method is implemented on macOS.
  1321. .. rst-class:: classref-item-separator
  1322. ----
  1323. .. _class_OS_method_global_menu_add_separator:
  1324. .. rst-class:: classref-method
  1325. void **global_menu_add_separator** **(** :ref:`String<class_String>` menu **)**
  1326. Add a separator between items. Separators also occupy an index.
  1327. \ **Note:** This method is implemented on macOS.
  1328. .. rst-class:: classref-item-separator
  1329. ----
  1330. .. _class_OS_method_global_menu_clear:
  1331. .. rst-class:: classref-method
  1332. void **global_menu_clear** **(** :ref:`String<class_String>` menu **)**
  1333. Clear the global menu, in effect removing all items.
  1334. \ **Note:** This method is implemented on macOS.
  1335. .. rst-class:: classref-item-separator
  1336. ----
  1337. .. _class_OS_method_global_menu_remove_item:
  1338. .. rst-class:: classref-method
  1339. void **global_menu_remove_item** **(** :ref:`String<class_String>` menu, :ref:`int<class_int>` idx **)**
  1340. Removes the item at index "idx" from the global menu. Note that the indexes of items after the removed item are going to be shifted by one.
  1341. \ **Note:** This method is implemented on macOS.
  1342. .. rst-class:: classref-item-separator
  1343. ----
  1344. .. _class_OS_method_has_clipboard:
  1345. .. rst-class:: classref-method
  1346. :ref:`bool<class_bool>` **has_clipboard** **(** **)** |const|
  1347. Returns ``true`` if there is content on the clipboard.
  1348. .. rst-class:: classref-item-separator
  1349. ----
  1350. .. _class_OS_method_has_environment:
  1351. .. rst-class:: classref-method
  1352. :ref:`bool<class_bool>` **has_environment** **(** :ref:`String<class_String>` variable **)** |const|
  1353. Returns ``true`` if the environment variable with the name ``variable`` exists.
  1354. \ **Note:** Double-check the casing of ``variable``. Environment variable names are case-sensitive on all platforms except Windows.
  1355. .. rst-class:: classref-item-separator
  1356. ----
  1357. .. _class_OS_method_has_feature:
  1358. .. rst-class:: classref-method
  1359. :ref:`bool<class_bool>` **has_feature** **(** :ref:`String<class_String>` tag_name **)** |const|
  1360. Returns ``true`` if the feature for the given feature tag is supported in the currently running instance, depending on the platform, build etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the :doc:`Feature Tags <../tutorials/export/feature_tags>` documentation for more details.
  1361. \ **Note:** Tag names are case-sensitive.
  1362. .. rst-class:: classref-item-separator
  1363. ----
  1364. .. _class_OS_method_has_touchscreen_ui_hint:
  1365. .. rst-class:: classref-method
  1366. :ref:`bool<class_bool>` **has_touchscreen_ui_hint** **(** **)** |const|
  1367. Returns ``true`` if the device has a touchscreen or emulates one.
  1368. .. rst-class:: classref-item-separator
  1369. ----
  1370. .. _class_OS_method_has_virtual_keyboard:
  1371. .. rst-class:: classref-method
  1372. :ref:`bool<class_bool>` **has_virtual_keyboard** **(** **)** |const|
  1373. Returns ``true`` if the platform has a virtual keyboard, ``false`` otherwise.
  1374. .. rst-class:: classref-item-separator
  1375. ----
  1376. .. _class_OS_method_hide_virtual_keyboard:
  1377. .. rst-class:: classref-method
  1378. void **hide_virtual_keyboard** **(** **)**
  1379. Hides the virtual keyboard if it is shown, does nothing otherwise.
  1380. .. rst-class:: classref-item-separator
  1381. ----
  1382. .. _class_OS_method_is_debug_build:
  1383. .. rst-class:: classref-method
  1384. :ref:`bool<class_bool>` **is_debug_build** **(** **)** |const|
  1385. Returns ``true`` if the Godot binary used to run the project is a *debug* export template, or when running in the editor.
  1386. Returns ``false`` if the Godot binary used to run the project is a *release* export template.
  1387. To check whether the Godot binary used to run the project is an export template (debug or release), use ``OS.has_feature("standalone")`` instead.
  1388. .. rst-class:: classref-item-separator
  1389. ----
  1390. .. _class_OS_method_is_ok_left_and_cancel_right:
  1391. .. rst-class:: classref-method
  1392. :ref:`bool<class_bool>` **is_ok_left_and_cancel_right** **(** **)** |const|
  1393. Returns ``true`` if the **OK** button should appear on the left and **Cancel** on the right.
  1394. .. rst-class:: classref-item-separator
  1395. ----
  1396. .. _class_OS_method_is_process_running:
  1397. .. rst-class:: classref-method
  1398. :ref:`bool<class_bool>` **is_process_running** **(** :ref:`int<class_int>` pid **)** |const|
  1399. Returns ``true`` if the child process ID (``pid``) is still running or ``false`` if it has terminated.
  1400. Must be a valid ID generated from :ref:`execute<class_OS_method_execute>`.
  1401. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows.
  1402. .. rst-class:: classref-item-separator
  1403. ----
  1404. .. _class_OS_method_is_scancode_unicode:
  1405. .. rst-class:: classref-method
  1406. :ref:`bool<class_bool>` **is_scancode_unicode** **(** :ref:`int<class_int>` code **)** |const|
  1407. Returns ``true`` if the input scancode corresponds to a Unicode character.
  1408. .. rst-class:: classref-item-separator
  1409. ----
  1410. .. _class_OS_method_is_stdout_verbose:
  1411. .. rst-class:: classref-method
  1412. :ref:`bool<class_bool>` **is_stdout_verbose** **(** **)** |const|
  1413. Returns ``true`` if the engine was executed with ``-v`` (verbose stdout).
  1414. .. rst-class:: classref-item-separator
  1415. ----
  1416. .. _class_OS_method_is_userfs_persistent:
  1417. .. rst-class:: classref-method
  1418. :ref:`bool<class_bool>` **is_userfs_persistent** **(** **)** |const|
  1419. If ``true``, the ``user://`` file system is persistent, so that its state is the same after a player quits and starts the game again. Relevant to the HTML5 platform, where this persistence may be unavailable.
  1420. .. rst-class:: classref-item-separator
  1421. ----
  1422. .. _class_OS_method_is_window_always_on_top:
  1423. .. rst-class:: classref-method
  1424. :ref:`bool<class_bool>` **is_window_always_on_top** **(** **)** |const|
  1425. Returns ``true`` if the window should always be on top of other windows.
  1426. .. rst-class:: classref-item-separator
  1427. ----
  1428. .. _class_OS_method_is_window_focused:
  1429. .. rst-class:: classref-method
  1430. :ref:`bool<class_bool>` **is_window_focused** **(** **)** |const|
  1431. Returns ``true`` if the window is currently focused.
  1432. \ **Note:** Only implemented on desktop platforms. On other platforms, it will always return ``true``.
  1433. .. rst-class:: classref-item-separator
  1434. ----
  1435. .. _class_OS_method_keyboard_get_current_layout:
  1436. .. rst-class:: classref-method
  1437. :ref:`int<class_int>` **keyboard_get_current_layout** **(** **)** |const|
  1438. Returns active keyboard layout index.
  1439. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1440. .. rst-class:: classref-item-separator
  1441. ----
  1442. .. _class_OS_method_keyboard_get_layout_count:
  1443. .. rst-class:: classref-method
  1444. :ref:`int<class_int>` **keyboard_get_layout_count** **(** **)** |const|
  1445. Returns the number of keyboard layouts.
  1446. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1447. .. rst-class:: classref-item-separator
  1448. ----
  1449. .. _class_OS_method_keyboard_get_layout_language:
  1450. .. rst-class:: classref-method
  1451. :ref:`String<class_String>` **keyboard_get_layout_language** **(** :ref:`int<class_int>` index **)** |const|
  1452. Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``.
  1453. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1454. .. rst-class:: classref-item-separator
  1455. ----
  1456. .. _class_OS_method_keyboard_get_layout_name:
  1457. .. rst-class:: classref-method
  1458. :ref:`String<class_String>` **keyboard_get_layout_name** **(** :ref:`int<class_int>` index **)** |const|
  1459. Returns the localized name of the keyboard layout at position ``index``.
  1460. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1461. .. rst-class:: classref-item-separator
  1462. ----
  1463. .. _class_OS_method_keyboard_get_scancode_from_physical:
  1464. .. rst-class:: classref-method
  1465. :ref:`int<class_int>` **keyboard_get_scancode_from_physical** **(** :ref:`int<class_int>` scancode **)** |const|
  1466. Converts a physical (US QWERTY) ``scancode`` to one in the active keyboard layout.
  1467. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1468. .. rst-class:: classref-item-separator
  1469. ----
  1470. .. _class_OS_method_keyboard_set_current_layout:
  1471. .. rst-class:: classref-method
  1472. void **keyboard_set_current_layout** **(** :ref:`int<class_int>` index **)**
  1473. Sets active keyboard layout.
  1474. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1475. .. rst-class:: classref-item-separator
  1476. ----
  1477. .. _class_OS_method_kill:
  1478. .. rst-class:: classref-method
  1479. :ref:`Error<enum_@GlobalScope_Error>` **kill** **(** :ref:`int<class_int>` pid **)**
  1480. Kill (terminate) the process identified by the given process ID (``pid``), e.g. the one returned by :ref:`execute<class_OS_method_execute>` in non-blocking mode. See also :ref:`crash<class_OS_method_crash>`.
  1481. \ **Note:** This method can also be used to kill processes that were not spawned by the game.
  1482. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows.
  1483. .. rst-class:: classref-item-separator
  1484. ----
  1485. .. _class_OS_method_move_to_trash:
  1486. .. rst-class:: classref-method
  1487. :ref:`Error<enum_@GlobalScope_Error>` **move_to_trash** **(** :ref:`String<class_String>` path **)** |const|
  1488. Moves the file or directory to the system's recycle bin. See also :ref:`Directory.remove<class_Directory_method_remove>`.
  1489. The method takes only global paths, so you may need to use :ref:`ProjectSettings.globalize_path<class_ProjectSettings_method_globalize_path>`. Do not use it for files in ``res://`` as it will not work in exported project.
  1490. \ **Note:** If the user has disabled the recycle bin on their system, the file will be permanently deleted instead.
  1491. ::
  1492. var file_to_remove = "user://slot1.sav"
  1493. OS.move_to_trash(ProjectSettings.globalize_path(file_to_remove))
  1494. .. rst-class:: classref-item-separator
  1495. ----
  1496. .. _class_OS_method_move_window_to_foreground:
  1497. .. rst-class:: classref-method
  1498. void **move_window_to_foreground** **(** **)**
  1499. Moves the window to the front.
  1500. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1501. .. rst-class:: classref-item-separator
  1502. ----
  1503. .. _class_OS_method_native_video_is_playing:
  1504. .. rst-class:: classref-method
  1505. :ref:`bool<class_bool>` **native_video_is_playing** **(** **)**
  1506. Returns ``true`` if native video is playing.
  1507. \ **Note:** This method is only implemented on iOS.
  1508. .. rst-class:: classref-item-separator
  1509. ----
  1510. .. _class_OS_method_native_video_pause:
  1511. .. rst-class:: classref-method
  1512. void **native_video_pause** **(** **)**
  1513. Pauses native video playback.
  1514. \ **Note:** This method is only implemented on iOS.
  1515. .. rst-class:: classref-item-separator
  1516. ----
  1517. .. _class_OS_method_native_video_play:
  1518. .. rst-class:: classref-method
  1519. :ref:`Error<enum_@GlobalScope_Error>` **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 **)**
  1520. Plays native video from the specified path, at the given volume and with audio and subtitle tracks.
  1521. \ **Note:** This method is only implemented on iOS.
  1522. .. rst-class:: classref-item-separator
  1523. ----
  1524. .. _class_OS_method_native_video_stop:
  1525. .. rst-class:: classref-method
  1526. void **native_video_stop** **(** **)**
  1527. Stops native video playback.
  1528. \ **Note:** This method is implemented on iOS.
  1529. .. rst-class:: classref-item-separator
  1530. ----
  1531. .. _class_OS_method_native_video_unpause:
  1532. .. rst-class:: classref-method
  1533. void **native_video_unpause** **(** **)**
  1534. Resumes native video playback.
  1535. \ **Note:** This method is implemented on iOS.
  1536. .. rst-class:: classref-item-separator
  1537. ----
  1538. .. _class_OS_method_open_midi_inputs:
  1539. .. rst-class:: classref-method
  1540. void **open_midi_inputs** **(** **)**
  1541. Initialises the singleton for the system MIDI driver.
  1542. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1543. .. rst-class:: classref-item-separator
  1544. ----
  1545. .. _class_OS_method_print_all_resources:
  1546. .. rst-class:: classref-method
  1547. void **print_all_resources** **(** :ref:`String<class_String>` tofile="" **)**
  1548. Shows all resources in the game. Optionally, the list can be written to a file by specifying a file path in ``tofile``.
  1549. .. rst-class:: classref-item-separator
  1550. ----
  1551. .. _class_OS_method_print_all_textures_by_size:
  1552. .. rst-class:: classref-method
  1553. void **print_all_textures_by_size** **(** **)**
  1554. Shows the list of loaded textures sorted by size in memory.
  1555. .. rst-class:: classref-item-separator
  1556. ----
  1557. .. _class_OS_method_print_resources_by_type:
  1558. .. rst-class:: classref-method
  1559. void **print_resources_by_type** **(** :ref:`PoolStringArray<class_PoolStringArray>` types **)**
  1560. Shows the number of resources loaded by the game of the given types.
  1561. .. rst-class:: classref-item-separator
  1562. ----
  1563. .. _class_OS_method_print_resources_in_use:
  1564. .. rst-class:: classref-method
  1565. void **print_resources_in_use** **(** :ref:`bool<class_bool>` short=false **)**
  1566. Shows all resources currently used by the game.
  1567. .. rst-class:: classref-item-separator
  1568. ----
  1569. .. _class_OS_method_request_attention:
  1570. .. rst-class:: classref-method
  1571. void **request_attention** **(** **)**
  1572. Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX.
  1573. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1574. .. rst-class:: classref-item-separator
  1575. ----
  1576. .. _class_OS_method_request_permission:
  1577. .. rst-class:: classref-method
  1578. :ref:`bool<class_bool>` **request_permission** **(** :ref:`String<class_String>` name **)**
  1579. At the moment this function is only used by ``AudioDriverOpenSL`` to request permission for ``RECORD_AUDIO`` on Android.
  1580. .. rst-class:: classref-item-separator
  1581. ----
  1582. .. _class_OS_method_request_permissions:
  1583. .. rst-class:: classref-method
  1584. :ref:`bool<class_bool>` **request_permissions** **(** **)**
  1585. With this function, you can request dangerous permissions since normal permissions are automatically granted at install time in Android applications.
  1586. \ **Note:** This method is implemented on Android.
  1587. .. rst-class:: classref-item-separator
  1588. ----
  1589. .. _class_OS_method_set_environment:
  1590. .. rst-class:: classref-method
  1591. :ref:`bool<class_bool>` **set_environment** **(** :ref:`String<class_String>` variable, :ref:`String<class_String>` value **)** |const|
  1592. Sets the value of the environment variable ``variable`` to ``value``. The environment variable will be set for the Godot process and any process executed with :ref:`execute<class_OS_method_execute>` after running :ref:`set_environment<class_OS_method_set_environment>`. The environment variable will *not* persist to processes run after the Godot process was terminated.
  1593. \ **Note:** Double-check the casing of ``variable``. Environment variable names are case-sensitive on all platforms except Windows.
  1594. .. rst-class:: classref-item-separator
  1595. ----
  1596. .. _class_OS_method_set_icon:
  1597. .. rst-class:: classref-method
  1598. void **set_icon** **(** :ref:`Image<class_Image>` icon **)**
  1599. Sets the game's icon using an :ref:`Image<class_Image>` resource.
  1600. The same image is used for window caption, taskbar/dock and window selection dialog. Image is scaled as needed.
  1601. \ **Note:** This method is implemented on HTML5, Linux, macOS and Windows.
  1602. .. rst-class:: classref-item-separator
  1603. ----
  1604. .. _class_OS_method_set_ime_active:
  1605. .. rst-class:: classref-method
  1606. void **set_ime_active** **(** :ref:`bool<class_bool>` active **)**
  1607. Sets whether IME input mode should be enabled.
  1608. If active IME handles key events before the application and creates an composition string and suggestion list.
  1609. Application can retrieve the composition status by using :ref:`get_ime_selection<class_OS_method_get_ime_selection>` and :ref:`get_ime_text<class_OS_method_get_ime_text>` functions.
  1610. Completed composition string is committed when input is finished.
  1611. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1612. .. rst-class:: classref-item-separator
  1613. ----
  1614. .. _class_OS_method_set_ime_position:
  1615. .. rst-class:: classref-method
  1616. void **set_ime_position** **(** :ref:`Vector2<class_Vector2>` position **)**
  1617. Sets position of IME suggestion list popup (in window coordinates).
  1618. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1619. .. rst-class:: classref-item-separator
  1620. ----
  1621. .. _class_OS_method_set_native_icon:
  1622. .. rst-class:: classref-method
  1623. void **set_native_icon** **(** :ref:`String<class_String>` filename **)**
  1624. Sets the game's icon using a multi-size platform-specific icon file (``*.ico`` on Windows and ``*.icns`` on macOS).
  1625. Appropriate size sub-icons are used for window caption, taskbar/dock and window selection dialog.
  1626. \ **Note:** This method is implemented on macOS and Windows.
  1627. .. rst-class:: classref-item-separator
  1628. ----
  1629. .. _class_OS_method_set_thread_name:
  1630. .. rst-class:: classref-method
  1631. :ref:`Error<enum_@GlobalScope_Error>` **set_thread_name** **(** :ref:`String<class_String>` name **)**
  1632. Sets the name of the current thread.
  1633. .. rst-class:: classref-item-separator
  1634. ----
  1635. .. _class_OS_method_set_use_file_access_save_and_swap:
  1636. .. rst-class:: classref-method
  1637. void **set_use_file_access_save_and_swap** **(** :ref:`bool<class_bool>` enabled **)**
  1638. Enables backup saves if ``enabled`` is ``true``.
  1639. .. rst-class:: classref-item-separator
  1640. ----
  1641. .. _class_OS_method_set_window_always_on_top:
  1642. .. rst-class:: classref-method
  1643. void **set_window_always_on_top** **(** :ref:`bool<class_bool>` enabled **)**
  1644. Sets whether the window should always be on top.
  1645. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1646. .. rst-class:: classref-item-separator
  1647. ----
  1648. .. _class_OS_method_set_window_mouse_passthrough:
  1649. .. rst-class:: classref-method
  1650. void **set_window_mouse_passthrough** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` region **)**
  1651. Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
  1652. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
  1653. ::
  1654. # Set region, using Path2D node.
  1655. OS.set_window_mouse_passthrough($Path2D.curve.get_baked_points())
  1656. # Set region, using Polygon2D node.
  1657. OS.set_window_mouse_passthrough($Polygon2D.polygon)
  1658. # Reset region to default.
  1659. OS.set_window_mouse_passthrough([])
  1660. \ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is.
  1661. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1662. .. rst-class:: classref-item-separator
  1663. ----
  1664. .. _class_OS_method_set_window_title:
  1665. .. rst-class:: classref-method
  1666. void **set_window_title** **(** :ref:`String<class_String>` title **)**
  1667. Sets the window title to the specified string.
  1668. \ **Note:** This should be used sporadically. Don't set this every frame, as that will negatively affect performance on some window managers.
  1669. \ **Note:** This method is implemented on HTML5, Linux, macOS and Windows.
  1670. .. rst-class:: classref-item-separator
  1671. ----
  1672. .. _class_OS_method_shell_open:
  1673. .. rst-class:: classref-method
  1674. :ref:`Error<enum_@GlobalScope_Error>` **shell_open** **(** :ref:`String<class_String>` uri **)**
  1675. Requests the OS to open a resource with the most appropriate program. For example:
  1676. - ``OS.shell_open("C:\\Users\name\Downloads")`` on Windows opens the file explorer at the user's Downloads folder.
  1677. - ``OS.shell_open("https://godotengine.org")`` opens the default web browser on the official Godot website.
  1678. - ``OS.shell_open("mailto:[email protected]")`` opens the default email client with the "To" field set to ``[email protected]``. See `RFC 2368 - The [code]mailto[/code] URL scheme <https://datatracker.ietf.org/doc/html/rfc2368>`__ for a list of fields that can be added.
  1679. Use :ref:`ProjectSettings.globalize_path<class_ProjectSettings_method_globalize_path>` to convert a ``res://`` or ``user://`` path into a system path for use with this method.
  1680. \ **Note:** Use :ref:`String.percent_encode<class_String_method_percent_encode>` to encode characters within URLs in a URL-safe, portable way. This is especially required for line breaks. Otherwise, :ref:`shell_open<class_OS_method_shell_open>` may not work correctly in a project exported to the Web platform.
  1681. \ **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows.
  1682. .. rst-class:: classref-item-separator
  1683. ----
  1684. .. _class_OS_method_show_virtual_keyboard:
  1685. .. rst-class:: classref-method
  1686. void **show_virtual_keyboard** **(** :ref:`String<class_String>` existing_text="", :ref:`bool<class_bool>` multiline=false **)**
  1687. Shows the virtual keyboard if the platform has one.
  1688. The ``existing_text`` parameter is useful for implementing your own :ref:`LineEdit<class_LineEdit>` or :ref:`TextEdit<class_TextEdit>`, as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).
  1689. The ``multiline`` parameter needs to be set to ``true`` to be able to enter multiple lines of text, as in :ref:`TextEdit<class_TextEdit>`.
  1690. \ **Note:** This method is implemented on Android, iOS and UWP.
  1691. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1692. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1693. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1694. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`