0 votes

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.

Godot version 3.3.2
in Engine by (37 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.