How to add a methods/properties to native class Input

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

I couldn’t find any code for adding methods or properties to a native class.
I read somewhere you nee to do like “extend Input” but it gives me error.
If I need to do a script with “extend Input” at the top, how do I run it? I don’t think I can put it just as a node’s script

What do you mean by “native class”, GDNative? Why do you think you need it?
Maybe you’ll state your exact problem?

sash-rc | 2020-11-16 20:43

:bust_in_silhouette: Reply From: magicalogic

I don’t think Input can be extended as it is a singleton which means only a single instance of it should be running at any given time. Am not sure of this though. I have never tried extending it.
Why would you need to extend it anyway.