For the Backspace key, you really just need to remove the last character in the visible string (if it contains characters). Here's a simple example using a button to add an "A" character, a button to "Delete" and a label to display the current text.
To use it, you'll need a scene with the following nodes:
Control
ButtonA
ButtonDel
Label
Just wire the pressed()
event of the two buttons to their handler functions in the below script.
extends Control
func _on_ButtonA_pressed():
$Label.text += "A"
func _on_ButtonDel_pressed():
var txt = $Label.text
if txt.length() > 0:
$Label.text = txt.substr(0, txt.length() - 1)