-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
/
Copy pathDisplayServer.xml
2184 lines (2180 loc) · 125 KB
/
DisplayServer.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8" ?>
<class name="DisplayServer" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A server interface for low-level window management.
</brief_description>
<description>
[DisplayServer] handles everything related to window management. It is separated from [OS] as a single operating system may support multiple display servers.
[b]Headless mode:[/b] Starting the engine with the [code]--headless[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url] disables all rendering and window management functions. Most functions from [DisplayServer] will return dummy values in this case.
</description>
<tutorials>
</tutorials>
<methods>
<method name="clipboard_get" qualifiers="const">
<return type="String" />
<description>
Returns the user's clipboard as a string if possible.
</description>
</method>
<method name="clipboard_get_image" qualifiers="const">
<return type="Image" />
<description>
Returns the user's clipboard as an image if possible.
[b]Note:[/b] This method uses the copied pixel data, e.g. from a image editing software or a web browser, not an image file copied from file explorer.
</description>
</method>
<method name="clipboard_get_primary" qualifiers="const">
<return type="String" />
<description>
Returns the user's [url=https://unix.stackexchange.com/questions/139191/whats-the-difference-between-primary-selection-and-clipboard-buffer]primary[/url] clipboard as a string if possible. This is the clipboard that is set when the user selects text in any application, rather than when pressing [kbd]Ctrl + C[/kbd]. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism.
[b]Note:[/b] This method is only implemented on Linux (X11/Wayland).
</description>
</method>
<method name="clipboard_has" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if there is a text content on the user's clipboard.
</description>
</method>
<method name="clipboard_has_image" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if there is an image content on the user's clipboard.
</description>
</method>
<method name="clipboard_set">
<return type="void" />
<param index="0" name="clipboard" type="String" />
<description>
Sets the user's clipboard content to the given string.
</description>
</method>
<method name="clipboard_set_primary">
<return type="void" />
<param index="0" name="clipboard_primary" type="String" />
<description>
Sets the user's [url=https://unix.stackexchange.com/questions/139191/whats-the-difference-between-primary-selection-and-clipboard-buffer]primary[/url] clipboard content to the given string. This is the clipboard that is set when the user selects text in any application, rather than when pressing [kbd]Ctrl + C[/kbd]. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism.
[b]Note:[/b] This method is only implemented on Linux (X11/Wayland).
</description>
</method>
<method name="create_status_indicator">
<return type="int" />
<param index="0" name="icon" type="Texture2D" />
<param index="1" name="tooltip" type="String" />
<param index="2" name="callback" type="Callable" />
<description>
Creates a new application status indicator with the specified icon, tooltip, and activation callback.
[param callback] should take two arguments: the pressed mouse button (one of the [enum MouseButton] constants) and the click position in screen coordinates (a [Vector2i]).
</description>
</method>
<method name="cursor_get_shape" qualifiers="const">
<return type="int" enum="DisplayServer.CursorShape" />
<description>
Returns the default mouse cursor shape set by [method cursor_set_shape].
</description>
</method>
<method name="cursor_set_custom_image">
<return type="void" />
<param index="0" name="cursor" type="Resource" />
<param index="1" name="shape" type="int" enum="DisplayServer.CursorShape" default="0" />
<param index="2" name="hotspot" type="Vector2" default="Vector2(0, 0)" />
<description>
Sets a custom mouse cursor image for the given [param shape]. This means the user's operating system and mouse cursor theme will no longer influence the mouse cursor's appearance.
[param cursor] can be either a [Texture2D] or an [Image], and it should not be larger than 256×256 to display correctly. Optionally, [param hotspot] can be set to offset the image's position relative to the click point. By default, [param hotspot] is set to the top-left corner of the image. See also [method cursor_set_shape].
</description>
</method>
<method name="cursor_set_shape">
<return type="void" />
<param index="0" name="shape" type="int" enum="DisplayServer.CursorShape" />
<description>
Sets the default mouse cursor shape. The cursor's appearance will vary depending on the user's operating system and mouse cursor theme. See also [method cursor_get_shape] and [method cursor_set_custom_image].
</description>
</method>
<method name="delete_status_indicator">
<return type="void" />
<param index="0" name="id" type="int" />
<description>
Removes the application status indicator.
</description>
</method>
<method name="dialog_input_text">
<return type="int" enum="Error" />
<param index="0" name="title" type="String" />
<param index="1" name="description" type="String" />
<param index="2" name="existing_text" type="String" />
<param index="3" name="callback" type="Callable" />
<description>
Shows a text input dialog which uses the operating system's native look-and-feel. [param callback] should accept a single [String] parameter which contains the text field's contents.
[b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_INPUT] feature. Supported platforms include macOS and Windows.
</description>
</method>
<method name="dialog_show">
<return type="int" enum="Error" />
<param index="0" name="title" type="String" />
<param index="1" name="description" type="String" />
<param index="2" name="buttons" type="PackedStringArray" />
<param index="3" name="callback" type="Callable" />
<description>
Shows a text dialog which uses the operating system's native look-and-feel. [param callback] should accept a single [int] parameter which corresponds to the index of the pressed button.
[b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG] feature. Supported platforms include macOS and Windows.
</description>
</method>
<method name="enable_for_stealing_focus">
<return type="void" />
<param index="0" name="process_id" type="int" />
<description>
Allows the [param process_id] PID to steal focus from this window. In other words, this disables the operating system's focus stealing protection for the specified PID.
[b]Note:[/b] This method is implemented only on Windows.
</description>
</method>
<method name="file_dialog_show">
<return type="int" enum="Error" />
<param index="0" name="title" type="String" />
<param index="1" name="current_directory" type="String" />
<param index="2" name="filename" type="String" />
<param index="3" name="show_hidden" type="bool" />
<param index="4" name="mode" type="int" enum="DisplayServer.FileDialogMode" />
<param index="5" name="filters" type="PackedStringArray" />
<param index="6" name="callback" type="Callable" />
<description>
Displays OS native dialog for selecting files or directories in the file system.
Each filter string in the [param filters] array should be formatted like this: [code]*.txt,*.doc;Text Files[/code]. The description text of the filter is optional and can be omitted. See also [member FileDialog.filters].
Callbacks have the following arguments: [code]status: bool, selected_paths: PackedStringArray, selected_filter_index: int[/code].
[b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS.
[b]Note:[/b] [param current_directory] might be ignored.
[b]Note:[/b] On Linux, [param show_hidden] is ignored.
[b]Note:[/b] On macOS, native file dialogs have no title.
[b]Note:[/b] On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use [method OS.get_granted_permissions] to get a list of saved bookmarks.
</description>
</method>
<method name="file_dialog_with_options_show">
<return type="int" enum="Error" />
<param index="0" name="title" type="String" />
<param index="1" name="current_directory" type="String" />
<param index="2" name="root" type="String" />
<param index="3" name="filename" type="String" />
<param index="4" name="show_hidden" type="bool" />
<param index="5" name="mode" type="int" enum="DisplayServer.FileDialogMode" />
<param index="6" name="filters" type="PackedStringArray" />
<param index="7" name="options" type="Dictionary[]" />
<param index="8" name="callback" type="Callable" />
<description>
Displays OS native dialog for selecting files or directories in the file system with additional user selectable options.
Each filter string in the [param filters] array should be formatted like this: [code]*.txt,*.doc;Text Files[/code]. The description text of the filter is optional and can be omitted. See also [member FileDialog.filters].
[param options] is array of [Dictionary]s with the following keys:
- [code]"name"[/code] - option's name [String].
- [code]"values"[/code] - [PackedStringArray] of values. If empty, boolean option (check box) is used.
- [code]"default"[/code] - default selected option index ([int]) or default boolean value ([bool]).
Callbacks have the following arguments: [code]status: bool, selected_paths: PackedStringArray, selected_filter_index: int, selected_option: Dictionary[/code].
[b]Note:[/b] This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS.
[b]Note:[/b] [param current_directory] might be ignored.
[b]Note:[/b] On Linux (X11), [param show_hidden] is ignored.
[b]Note:[/b] On macOS, native file dialogs have no title.
[b]Note:[/b] On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use [method OS.get_granted_permissions] to get a list of saved bookmarks.
</description>
</method>
<method name="force_process_and_drop_events">
<return type="void" />
<description>
Forces window manager processing while ignoring all [InputEvent]s. See also [method process_events].
[b]Note:[/b] This method is implemented on Windows and macOS.
</description>
</method>
<method name="get_accent_color" qualifiers="const">
<return type="Color" />
<description>
Returns OS theme accent color. Returns [code]Color(0, 0, 0, 0)[/code], if accent color is unknown.
[b]Note:[/b] This method is implemented on macOS and Windows.
</description>
</method>
<method name="get_base_color" qualifiers="const">
<return type="Color" />
<description>
Returns the OS theme base color (default control background). Returns [code]Color(0, 0, 0, 0)[/code] if the base color is unknown.
[b]Note:[/b] This method is implemented on macOS and Windows.
</description>
</method>
<method name="get_display_cutouts" qualifiers="const">
<return type="Rect2[]" />
<description>
Returns an [Array] of [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 [method get_display_safe_area].
[b]Note:[/b] Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
</description>
</method>
<method name="get_display_safe_area" qualifiers="const">
<return type="Rect2i" />
<description>
Returns the unobscured area of the display where interactive controls should be rendered. See also [method get_display_cutouts].
</description>
</method>
<method name="get_keyboard_focus_screen" qualifiers="const">
<return type="int" />
<description>
Returns the index of the screen containing the window with the keyboard focus, or the primary screen if there's no focused window.
</description>
</method>
<method name="get_name" qualifiers="const">
<return type="String" />
<description>
Returns the name of the [DisplayServer] currently in use. Most operating systems only have a single [DisplayServer], but Linux has access to more than one [DisplayServer] (currently X11 and Wayland).
The names of built-in display servers are [code]Windows[/code], [code]macOS[/code], [code]X11[/code] (Linux), [code]Wayland[/code] (Linux), [code]Android[/code], [code]iOS[/code], [code]web[/code] (HTML5), and [code]headless[/code] (when started with the [code]--headless[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]).
</description>
</method>
<method name="get_primary_screen" qualifiers="const">
<return type="int" />
<description>
Returns index of the primary screen.
</description>
</method>
<method name="get_screen_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of displays available.
</description>
</method>
<method name="get_screen_from_rect" qualifiers="const">
<return type="int" />
<param index="0" name="rect" type="Rect2" />
<description>
Returns index of the screen which contains specified rectangle.
</description>
</method>
<method name="get_swap_cancel_ok">
<return type="bool" />
<description>
Returns [code]true[/code] if positions of [b]OK[/b] and [b]Cancel[/b] buttons are swapped in dialogs. This is enabled by default on Windows to follow interface conventions, and be toggled by changing [member ProjectSettings.gui/common/swap_cancel_ok].
[b]Note:[/b] This doesn't affect native dialogs such as the ones spawned by [method DisplayServer.dialog_show].
</description>
</method>
<method name="get_window_at_screen_position" qualifiers="const">
<return type="int" />
<param index="0" name="position" type="Vector2i" />
<description>
Returns the ID of the window at the specified screen [param position] (in pixels). On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
[codeblock lang=text]
* (0, 0) +-------+
| |
+-------------+ | |
| | | |
| | | |
+-------------+ +-------+
[/codeblock]
</description>
</method>
<method name="get_window_list" qualifiers="const">
<return type="PackedInt32Array" />
<description>
Returns the list of Godot window IDs belonging to this process.
[b]Note:[/b] Native dialogs are not included in this list.
</description>
</method>
<method name="global_menu_add_check_item" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="label" type="String" />
<param index="2" name="callback" type="Callable" default="Callable()" />
<param index="3" name="key_callback" type="Callable" default="Callable()" />
<param index="4" name="tag" type="Variant" default="null" />
<param index="5" name="accelerator" type="int" enum="Key" default="0" />
<param index="6" name="index" type="int" default="-1" />
<description>
Adds a new checkable item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_icon_check_item" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="icon" type="Texture2D" />
<param index="2" name="label" type="String" />
<param index="3" name="callback" type="Callable" default="Callable()" />
<param index="4" name="key_callback" type="Callable" default="Callable()" />
<param index="5" name="tag" type="Variant" default="null" />
<param index="6" name="accelerator" type="int" enum="Key" default="0" />
<param index="7" name="index" type="int" default="-1" />
<description>
Adds a new checkable item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_icon_item" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="icon" type="Texture2D" />
<param index="2" name="label" type="String" />
<param index="3" name="callback" type="Callable" default="Callable()" />
<param index="4" name="key_callback" type="Callable" default="Callable()" />
<param index="5" name="tag" type="Variant" default="null" />
<param index="6" name="accelerator" type="int" enum="Key" default="0" />
<param index="7" name="index" type="int" default="-1" />
<description>
Adds a new item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_icon_radio_check_item" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="icon" type="Texture2D" />
<param index="2" name="label" type="String" />
<param index="3" name="callback" type="Callable" default="Callable()" />
<param index="4" name="key_callback" type="Callable" default="Callable()" />
<param index="5" name="tag" type="Variant" default="null" />
<param index="6" name="accelerator" type="int" enum="Key" default="0" />
<param index="7" name="index" type="int" default="-1" />
<description>
Adds a new radio-checkable item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it.
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_item" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="label" type="String" />
<param index="2" name="callback" type="Callable" default="Callable()" />
<param index="3" name="key_callback" type="Callable" default="Callable()" />
<param index="4" name="tag" type="Variant" default="null" />
<param index="5" name="accelerator" type="int" enum="Key" default="0" />
<param index="6" name="index" type="int" default="-1" />
<description>
Adds a new item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_multistate_item" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="label" type="String" />
<param index="2" name="max_states" type="int" />
<param index="3" name="default_state" type="int" />
<param index="4" name="callback" type="Callable" default="Callable()" />
<param index="5" name="key_callback" type="Callable" default="Callable()" />
<param index="6" name="tag" type="Variant" default="null" />
<param index="7" name="accelerator" type="int" enum="Key" default="0" />
<param index="8" name="index" type="int" default="-1" />
<description>
Adds a new item with text [param label] to the global menu with ID [param menu_root].
Contrarily to normal binary items, multistate items can have more than two states, as defined by [param max_states]. Each press or activate of the item will increase the state by one. The default value is defined by [param default_state].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] By default, there's no indication of the current item state, it should be changed manually.
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_radio_check_item" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="label" type="String" />
<param index="2" name="callback" type="Callable" default="Callable()" />
<param index="3" name="key_callback" type="Callable" default="Callable()" />
<param index="4" name="tag" type="Variant" default="null" />
<param index="5" name="accelerator" type="int" enum="Key" default="0" />
<param index="6" name="index" type="int" default="-1" />
<description>
Adds a new radio-checkable item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it.
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_separator" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="index" type="int" default="-1" />
<description>
Adds a separator between items to the global menu with ID [param menu_root]. Separators also occupy an index.
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_add_submenu_item" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="label" type="String" />
<param index="2" name="submenu" type="String" />
<param index="3" name="index" type="int" default="-1" />
<description>
Adds an item that will act as a submenu of the global menu [param menu_root]. The [param submenu] argument is the ID of the global menu root that will be shown when the item is clicked.
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_clear" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<description>
Removes all items from the global menu with ID [param menu_root].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
[/codeblock]
</description>
</method>
<method name="global_menu_get_item_accelerator" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" enum="Key" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns the accelerator of the item at index [param idx]. Accelerators are special combinations of keys that activate the item, no matter which control is focused.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_callback" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="Callable" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns the callback of the item at index [param idx].
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_count" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<description>
Returns number of items in the global menu with ID [param menu_root].
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_icon" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="Texture2D" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns the icon of the item at index [param idx].
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_indentation_level" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns the horizontal offset of the item at the given [param idx].
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_index_from_tag" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="tag" type="Variant" />
<description>
Returns the index of the item with the specified [param tag]. Indices are automatically assigned to each item by the engine, and cannot be set manually.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_index_from_text" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="text" type="String" />
<description>
Returns the index of the item with the specified [param text]. Indices are automatically assigned to each item by the engine, and cannot be set manually.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_key_callback" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="Callable" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns the callback of the item accelerator at index [param idx].
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_max_states" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns number of states of a multistate item. See [method global_menu_add_multistate_item] for details.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_state" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="int" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns the state of a multistate item. See [method global_menu_add_multistate_item] for details.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_submenu" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="String" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns the submenu ID of the item at index [param idx]. See [method global_menu_add_submenu_item] for more info on how to add a submenu.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_tag" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="Variant" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns the metadata of the specified item, which might be of any type. You can set it with [method global_menu_set_item_tag], which provides a simple way of assigning context data to items.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_text" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="String" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns the text of the item at index [param idx].
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_item_tooltip" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="String" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns the tooltip associated with the specified index [param idx].
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_get_system_menu_roots" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="Dictionary" />
<description>
Returns Dictionary of supported system menu IDs and names.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_is_item_checkable" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="bool" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns [code]true[/code] if the item at index [param idx] is checkable in some way, i.e. if it has a checkbox or radio button.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_is_item_checked" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="bool" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns [code]true[/code] if the item at index [param idx] is checked.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_is_item_disabled" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="bool" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns [code]true[/code] if the item at index [param idx] is disabled. When it is disabled it can't be selected, or its action invoked.
See [method global_menu_set_item_disabled] for more info on how to disable an item.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_is_item_hidden" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="bool" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns [code]true[/code] if the item at index [param idx] is hidden.
See [method global_menu_set_item_hidden] for more info on how to hide an item.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_is_item_radio_checkable" qualifiers="const" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="bool" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns [code]true[/code] if the item at index [param idx] has radio button-style checkability.
[b]Note:[/b] This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_remove_item" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Removes the item at index [param idx] from the global menu [param menu_root].
[b]Note:[/b] The indices of items after the removed item will be shifted by one.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_accelerator" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="keycode" type="int" enum="Key" />
<description>
Sets the accelerator of the item at index [param idx]. [param keycode] can be a single [enum Key], or a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_callback" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="callback" type="Callable" />
<description>
Sets the callback of the item at index [param idx]. Callback is emitted when an item is pressed.
[b]Note:[/b] The [param callback] Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the [code]tag[/code] parameter when the menu item was created.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_checkable" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="checkable" type="bool" />
<description>
Sets whether the item at index [param idx] has a checkbox. If [code]false[/code], sets the type of the item to plain text.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_checked" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="checked" type="bool" />
<description>
Sets the checkstate status of the item at index [param idx].
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_disabled" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="disabled" type="bool" />
<description>
Enables/disables the item at index [param idx]. When it is disabled, it can't be selected and its action can't be invoked.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_hidden" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="hidden" type="bool" />
<description>
Hides/shows the item at index [param idx]. When it is hidden, an item does not appear in a menu and its action cannot be invoked.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_hover_callbacks" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="callback" type="Callable" />
<description>
Sets the callback of the item at index [param idx]. The callback is emitted when an item is hovered.
[b]Note:[/b] The [param callback] Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the [code]tag[/code] parameter when the menu item was created.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_icon" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="icon" type="Texture2D" />
<description>
Replaces the [Texture2D] icon of the specified [param idx].
[b]Note:[/b] This method is implemented only on macOS.
[b]Note:[/b] This method is not supported by macOS "_dock" menu items.
</description>
</method>
<method name="global_menu_set_item_indentation_level" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="level" type="int" />
<description>
Sets the horizontal offset of the item at the given [param idx].
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_key_callback" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="key_callback" type="Callable" />
<description>
Sets the callback of the item at index [param idx]. Callback is emitted when its accelerator is activated.
[b]Note:[/b] The [param key_callback] Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the [code]tag[/code] parameter when the menu item was created.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_max_states" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="max_states" type="int" />
<description>
Sets number of state of a multistate item. See [method global_menu_add_multistate_item] for details.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_radio_checkable" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="checkable" type="bool" />
<description>
Sets the type of the item at the specified index [param idx] to radio button. If [code]false[/code], sets the type of the item to plain text.
[b]Note:[/b] This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_state" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="state" type="int" />
<description>
Sets the state of a multistate item. See [method global_menu_add_multistate_item] for details.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_submenu" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="submenu" type="String" />
<description>
Sets the submenu of the item at index [param idx]. The submenu is the ID of a global menu root that would be shown when the item is clicked.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_tag" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="tag" type="Variant" />
<description>
Sets the metadata of an item, which may be of any type. You can later get it with [method global_menu_get_item_tag], which provides a simple way of assigning context data to items.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_text" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="text" type="String" />
<description>
Sets the text of the item at index [param idx].
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_item_tooltip" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<param index="2" name="tooltip" type="String" />
<description>
Sets the [String] tooltip of the item at the specified index [param idx].
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="global_menu_set_popup_callbacks" deprecated="Use [NativeMenu] or [PopupMenu] instead.">
<return type="void" />
<param index="0" name="menu_root" type="String" />
<param index="1" name="open_callback" type="Callable" />
<param index="2" name="close_callback" type="Callable" />
<description>
Registers callables to emit when the menu is respectively about to show or closed. Callback methods should have zero arguments.
</description>
</method>
<method name="has_additional_outputs" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if any additional outputs have been registered via [method register_additional_output].
</description>
</method>
<method name="has_feature" qualifiers="const">
<return type="bool" />
<param index="0" name="feature" type="int" enum="DisplayServer.Feature" />
<description>
Returns [code]true[/code] if the specified [param feature] is supported by the current [DisplayServer], [code]false[/code] otherwise.
</description>
</method>
<method name="has_hardware_keyboard" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if hardware keyboard is connected.
[b]Note:[/b] This method is implemented on Android and iOS, on other platforms this method always returns [code]true[/code].
</description>
</method>
<method name="help_set_search_callbacks">
<return type="void" />
<param index="0" name="search_callback" type="Callable" />
<param index="1" name="action_callback" type="Callable" />
<description>
Sets native help system search callbacks.
[param search_callback] has the following arguments: [code]String search_string, int result_limit[/code] and return a [Dictionary] with "key, display name" pairs for the search results. Called when the user enters search terms in the [code]Help[/code] menu.
[param action_callback] has the following arguments: [code]String key[/code]. Called when the user selects a search result in the [code]Help[/code] menu.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="ime_get_selection" qualifiers="const">
<return type="Vector2i" />
<description>
Returns the text selection in the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] composition string, with the [Vector2i]'s [code]x[/code] component being the caret position and [code]y[/code] being the length of the selection.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="ime_get_text" qualifiers="const">
<return type="String" />
<description>
Returns the composition string contained within the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] window.
[b]Note:[/b] This method is implemented only on macOS.
</description>
</method>
<method name="is_dark_mode" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if OS is using dark mode.
[b]Note:[/b] This method is implemented on Android, iOS, macOS, Windows, and Linux (X11/Wayland).
</description>
</method>
<method name="is_dark_mode_supported" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if OS supports dark mode.
[b]Note:[/b] This method is implemented on Android, iOS, macOS, Windows, and Linux (X11/Wayland).
</description>
</method>
<method name="is_touchscreen_available" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if touch events are available (Android or iOS), the capability is detected on the Web platform or if [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse] is [code]true[/code].
</description>
</method>
<method name="is_window_transparency_available" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if the window background can be made transparent. This method returns [code]false[/code] if [member ProjectSettings.display/window/per_pixel_transparency/allowed] is set to [code]false[/code], or if transparency is not supported by the renderer or OS compositor.
</description>
</method>
<method name="keyboard_get_current_layout" qualifiers="const">
<return type="int" />
<description>
Returns active keyboard layout index.
[b]Note:[/b] This method is implemented on Linux (X11/Wayland), macOS, and Windows.
</description>
</method>
<method name="keyboard_get_keycode_from_physical" qualifiers="const">
<return type="int" enum="Key" />
<param index="0" name="keycode" type="int" enum="Key" />
<description>
Converts a physical (US QWERTY) [param keycode] to one in the active keyboard layout.
[b]Note:[/b] This method is implemented on Linux (X11/Wayland), macOS and Windows.
</description>
</method>
<method name="keyboard_get_label_from_physical" qualifiers="const">
<return type="int" enum="Key" />
<param index="0" name="keycode" type="int" enum="Key" />
<description>
Converts a physical (US QWERTY) [param keycode] to localized label printed on the key in the active keyboard layout.
[b]Note:[/b] This method is implemented on Linux (X11/Wayland), macOS and Windows.
</description>
</method>
<method name="keyboard_get_layout_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of keyboard layouts.
[b]Note:[/b] This method is implemented on Linux (X11/Wayland), macOS and Windows.
</description>
</method>
<method name="keyboard_get_layout_language" qualifiers="const">
<return type="String" />
<param index="0" name="index" type="int" />
<description>
Returns the ISO-639/BCP-47 language code of the keyboard layout at position [param index].
[b]Note:[/b] This method is implemented on Linux (X11/Wayland), macOS and Windows.
</description>
</method>
<method name="keyboard_get_layout_name" qualifiers="const">
<return type="String" />
<param index="0" name="index" type="int" />
<description>
Returns the localized name of the keyboard layout at position [param index].
[b]Note:[/b] This method is implemented on Linux (X11/Wayland), macOS and Windows.
</description>
</method>
<method name="keyboard_set_current_layout">