Get keys from InputMap in Godot 4.0 GDScript

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Elderlore

In Godot 3.5 this line would have achieved what I want to do.

var key = OS.get_scancode_string(InputMap.get_action_list("Action")[0].scancode)
:bust_in_silhouette: Reply From: ulty
var action_0 = InputMap.get_actions()[0] 
var action_0_events = InputMap.action_get_events( action_0 )
var action_0_event_0 = action_0_events[0]
var button_name = OS.get_keycode_string( action_0_event_0.keycode ) 

Godot 4 Beta 4
This should give you the desired String
Note that scanncode is now keycode