void * onPressFunction(void); void * onReleaseFunction(void);
These above do not declare a pointer to a function, but they create a member function, each of which returns a pointer to a void, I think you meant this:
void (* onPressFunction)(void); void (* onReleaseFunction)(void);
Also, for function pointers, I would recommend using typedefs , or std::function
Typedef example
typedef void(*onReleaseFunction)(void);
And it can be used as follows:
onReleaseFunction func = &functionname;
source share