Self is the "this" of C++ ...
Its a handle to the current object, which assumes that there is a current object which quite clearly prevents it from existing in Functions.
I would prefer a class keyboard, which is used to access global, const and functions (as there is the keyword super to access the superclass) and make self bugfree in the meaning of a pure "this" like reference to the current object a method is executed on.
Because right now it is a very bugged intermix sadly. Casting of Self for example is not possible but if you return self from a method, you can cast it, which just implies a core problem with handling of self.
Its a handle to the current object, which assumes that there is a current object which quite clearly prevents it from existing in Functions.
I would prefer a class keyboard, which is used to access global, const and functions (as there is the keyword super to access the superclass) and make self bugfree in the meaning of a pure "this" like reference to the current object a method is executed on.
Because right now it is a very bugged intermix sadly. Casting of Self for example is not possible but if you return self from a method, you can cast it, which just implies a core problem with handling of self.