Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

LineEdit

Inherits: Control < CanvasItem < Node < Object

An input field for single-line text.

Description

LineEdit provides an input field for editing a single line of text. It features many built-in shortcuts that are always available (Ctrl here maps to Cmd on macOS):

  • Ctrl + C: Copy

  • Ctrl + X: Cut

  • Ctrl + V or Ctrl + Y: Paste/"yank"

  • Ctrl + Z: Undo

  • Ctrl + ~: Swap input direction.

  • Ctrl + Shift + Z: Redo

  • Ctrl + U: Delete text from the caret position to the beginning of the line

  • Ctrl + K: Delete text from the caret position to the end of the line

  • Ctrl + A: Select all text

  • Up Arrow/Down Arrow: Move the caret to the beginning/end of the line

On macOS, some extra keyboard shortcuts are available:

  • Cmd + F: Same as Right Arrow, move the caret one character right

  • Cmd + B: Same as Left Arrow, move the caret one character left

  • Cmd + P: Same as Up Arrow, move the caret to the previous line

  • Cmd + N: Same as Down Arrow, move the caret to the next line

  • Cmd + D: Same as Delete, delete the character on the right side of caret

  • Cmd + H: Same as Backspace, delete the character on the left side of the caret

  • Cmd + A: Same as Home, move the caret to the beginning of the line

  • Cmd + E: Same as End, move the caret to the end of the line

  • Cmd + Left Arrow: Same as Home, move the caret to the beginning of the line

  • Cmd + Right Arrow: Same as End, move the caret to the end of the line

Properties

HorizontalAlignment

alignment

0

bool

caret_blink

false

float

caret_blink_interval

0.65

int

caret_column

0

bool

caret_force_displayed

false

bool

caret_mid_grapheme

false

bool

clear_button_enabled

false

bool

context_menu_enabled

true

bool

deselect_on_focus_loss_enabled

true

bool

drag_and_drop_selection_enabled

true

bool

draw_control_chars

false

bool

editable

true

bool