You can probably just set up a mapping yourself. Try maybe something like this:
var map = {}
func _ready():
set_up_action_map()
func set_up_action_map():
for action in InputMap.get_actions():
for input in InputMap.get_action_list(action):
if input is InputEventKey:
map[input.scancode] = action
print(map)
This will give you something like:
{
<scancode_1>: 'ui_down',
<scancode_2>: 'ui_left',
}
where <scancode_*>
is the scancode for the key press input.
then, you can just check if a scancode exists in the map to see if that key is assigned to an action.