Control that provides single-line string editing. LineEdit provides a single-line string editor, used for text fields. It features many built-in shortcuts which will always be available ([kbd]Ctrl[/kbd] here maps to [kbd]Cmd[/kbd] on macOS): - [kbd]Ctrl + C[/kbd]: Copy - [kbd]Ctrl + X[/kbd]: Cut - [kbd]Ctrl + V[/kbd] or [kbd]Ctrl + Y[/kbd]: Paste/"yank" - [kbd]Ctrl + Z[/kbd]: Undo - [kbd]Ctrl + ~[/kbd]: Swap input direction. - [kbd]Ctrl + Shift + Z[/kbd]: Redo - [kbd]Ctrl + U[/kbd]: Delete text from the cursor position to the beginning of the line - [kbd]Ctrl + K[/kbd]: Delete text from the cursor position to the end of the line - [kbd]Ctrl + A[/kbd]: Select all text - [kbd]Up Arrow[/kbd]/[kbd]Down Arrow[/kbd]: Move the cursor to the beginning/end of the line On macOS, some extra keyboard shortcuts are available: - [kbd]Ctrl + F[/kbd]: Same as [kbd]Right Arrow[/kbd], move the cursor one character right - [kbd]Ctrl + B[/kbd]: Same as [kbd]Left Arrow[/kbd], move the cursor one character left - [kbd]Ctrl + P[/kbd]: Same as [kbd]Up Arrow[/kbd], move the cursor to the previous line - [kbd]Ctrl + N[/kbd]: Same as [kbd]Down Arrow[/kbd], move the cursor to the next line - [kbd]Ctrl + D[/kbd]: Same as [kbd]Delete[/kbd], delete the character on the right side of cursor - [kbd]Ctrl + H[/kbd]: Same as [kbd]Backspace[/kbd], delete the character on the left side of the cursor - [kbd]Ctrl + A[/kbd]: Same as [kbd]Home[/kbd], move the cursor to the beginning of the line - [kbd]Ctrl + E[/kbd]: Same as [kbd]End[/kbd], move the cursor to the end of the line - [kbd]Cmd + Left Arrow[/kbd]: Same as [kbd]Home[/kbd], move the cursor to the beginning of the line - [kbd]Cmd + Right Arrow[/kbd]: Same as [kbd]End[/kbd], move the cursor to the end of the line Adds [code]text[/code] after the cursor. If the resulting value is longer than [member max_length], nothing happens. Erases the [LineEdit]'s [member text]. Removes all OpenType features. Deletes one character at the cursor's current position (equivalent to pressing [kbd]Delete[/kbd]). Deletes a section of the [member text] going from position [code]from_column[/code] to [code]to_column[/code]. Both parameters should be within the text's length. Clears the current selection. Returns the [PopupMenu] of this [LineEdit]. By default, this menu is displayed when right-clicking on the [LineEdit]. Returns OpenType feature [code]tag[/code]. Returns the scroll offset due to [member caret_position], as a number of characters. Executes a given action as defined in the [enum MenuItems] enum. Selects characters inside [LineEdit] between [code]from[/code] and [code]to[/code]. By default, [code]from[/code] is at the beginning and [code]to[/code] at the end. [codeblocks] [gdscript] text = "Welcome" select() # Will select "Welcome". select(4) # Will select "ome". select(2, 5) # Will select "lco". [/gdscript] [csharp] Text = "Welcome"; Select(); // Will select "Welcome". Select(4); // Will select "ome". Select(2, 5); // Will select "lco". [/csharp] [/codeblocks] Selects the whole [String]. Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. Text alignment as defined in the [enum Align] enum. If [code]true[/code], the caret (visual cursor) blinks. Duration (in seconds) of a caret's blinking cycle. Allow moving caret, selecting and removing the individual composite character components. Note: [kbd]Backspace[/kbd] is always removing individual composite character components. The cursor's position inside the [LineEdit]. When set, the text may scroll to accommodate it. If [code]true[/code], the [LineEdit] will show a clear button if [code]text[/code] is not empty, which can be used to clear the text quickly. If [code]true[/code], the context menu will appear when right-clicked. If [code]true[/code], control characters are displayed. If [code]false[/code], existing text cannot be modified and new text cannot be added. If [code]true[/code], the [LineEdit] width will increase to stay longer than the [member text]. It will [b]not[/b] compress if the [member text] is shortened. Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. Maximum amount of characters that can be entered inside the [LineEdit]. If [code]0[/code], there is no limit. Opacity of the [member placeholder_text]. From [code]0[/code] to [code]1[/code]. Text shown when the [LineEdit] is empty. It is [b]not[/b] the [LineEdit]'s default value (see [member text]). Sets the icon that will appear in the right end of the [LineEdit] if there's no [member text], or always, if [member clear_button_enabled] is set to [code]false[/code]. If [code]true[/code], every character is replaced with the secret character (see [member secret_character]). The character to use to mask secret input (defaults to "*"). Only a single character can be used as the secret character. If [code]false[/code], it's impossible to select the text using mouse nor keyboard. If [code]false[/code], using shortcuts will be disabled. Set BiDi algorithm override for the structured text. Set additional options for BiDi override. String value of the [LineEdit]. [b]Note:[/b] Changing text using this property won't emit the [signal text_changed] signal. Base text writing direction. If [code]true[/code], the native virtual keyboard is shown when focused on platforms that support it. Emitted when trying to append text that would overflow the [member max_length]. Emitted when the text changes. Emitted when the user presses [constant KEY_ENTER] on the [LineEdit]. Aligns the text on the left-hand side of the [LineEdit]. Centers the text in the middle of the [LineEdit]. Aligns the text on the right-hand side of the [LineEdit]. Expand row to fit the [LineEdit]'s width. Cuts (copies and clears) the selected text. Copies the selected text. Pastes the clipboard text over the selected text (or at the cursor's position). Non-printable escape characters are automatically stripped from the OS clipboard via [method String.strip_escapes]. Erases the whole [LineEdit] text. Selects the whole [LineEdit] text. Undoes the previous action. Reverse the last undo action. Sets text direction to inherited. Sets text direction to automatic. Sets text direction to left-to-right. Sets text direction to right-to-left. Toggles control character display. Inserts left-to-right mark (LRM) character. Inserts right-to-left mark (RLM) character. Inserts start of left-to-right embedding (LRE) character. Inserts start of right-to-left embedding (RLE) character. Inserts start of left-to-right override (LRO) character. Inserts start of right-to-left override (RLO) character. Inserts pop direction formatting (PDF) character. Inserts Arabic letter mark (ALM) character. Inserts left-to-right isolate (LRI) character. Inserts right-to-left isolate (RLI) character. Inserts first strong isolate (FSI) character. Inserts pop direction isolate (PDI) character. Inserts zero width joiner (ZWJ) character. Inserts zero width non-joiner (ZWNJ) character. Inserts word joiner (WJ) character. Inserts soft hyphen (SHY) character. Represents the size of the [enum MenuItems] enum. Texture for the clear button. See [member clear_button_enabled]. Color used as default tint for the clear button. Color used for the clear button when it's pressed. Color of the [LineEdit]'s visual cursor (caret). Background used when [LineEdit] has GUI focus. Font used for the text. Default font color. The tint of text outline of the [LineEdit]. Font color for selected text (inside the selection rectangle). Font size of the [LineEdit]'s text. Font color when editing is disabled. Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of 'M' characters (i.e. this amount of 'M' characters can be displayed without scrolling). Default background for the [LineEdit]. The size of the text outline. Background used when [LineEdit] is in read-only mode ([member editable] is set to [code]false[/code]). Color of the selection rectangle.