+1 vote

Hello guys. I just want to know when the player takes a print screen, but somehow Godot seems unable to detect that key in particular.

func _input(event):
     if Input.is_key_pressed(KEY_DELETE): #or any other key
          print("works fine")
     if Input.is_key_pressed(KEY_PRINT):
          print("...this not :c")
Godot version v3.2.2
in Engine by (77 points)

1 Answer

+1 vote
Best answer

Try this:

func _input(event):
    if event is InputEventKey:
        if event.scancode == KEY_PRINT:
            print("print screen pressed")

You don't need to use Input.is_key_presssed() inside _input(event) function.

by (2,017 points)
selected by

Thank you very much.

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.