write the text at no use nodes

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Timofffee
:warning: Old Version Published before Godot 3 was released.

Good time of day. I have a serious question. How to get the symbol when the key is pressed, but it does not use a LineEdit and other nodes?


rustyStriker | 2017-07-29 12:41

:bust_in_silhouette: Reply From: Dr_TwiSteD

You can have it done by reading the input and converting the scancodes using the built-in KEY_* constants of the global scope.

Simple code snippet would look like this:

func _ready():

func _input(event):

	if event.type == InputEvent.KEY and event.is_pressed():
		print('pressed: ' + str(event.unicode))

		if event.scancode == KEY_A:

As far as I know there’s no direct way to convert scancodes to string, so you can create a dictionary like {scancode: ‘string’} to convert symbols.

Was such a thought, but what about the signs? If letters and numbers - it’s just, the characters each keyboard is different.

Timofffee | 2017-07-31 07:31



I found a solution to a slightly different line.
Thanks for the help. It remains only to convert “Percent” to"%", etc.

Timofffee | 2017-07-31 07:40