Simulate holding a key pressed and make it work with ItemList.

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

Hi, I would like to press the control key by simulation, that is, virtually by code and have it recognized by the ItemList to be able to select several items simultaneously without having to actually press the control key.

I have tried to add this code to the project but it does not work, although it appears to me as pressed.

var inputKeySimulate = InputEventKey.new()
inputKeySimulate.set_scancode(16777238)
inputKeySimulate.set_pressed(true)
Input.parse_input_event(inputKeySimulate)

If I ask if it is pressed it returns True.

Input.is_key_pressed(16777238) -> It returns True

I could make some further comment but I would only be speculating or guessing what it might be.

If someone could fix this for me I would be grateful =) as I am stuck.