Ich hab das jetzt so gemacht:
typedef int (*(KeyDown_T)(char scan1, char scan2, unsigned char shift));
typedef int (*(KeyPress_T)(char Ascii));
typedef int (*(KeyUp_T)(char scan1, char scan2, unsigned char shift));
struct key_func
{
KeyDown_T Key_down;
KeyPress_T Key_press;
KeyUp_T Key_up;
unsigned char Activ;
} Key_Functionen;
void Add_Keydown(KeyDown_T Func)
{
Key_Functionen.Key_down = Func;
}
void Add_Keydown(KeyPress_T Func)
{
Key_Functionen.Key_press = Func;
}
void Add_Keydown(KeyUp_T Func)
{
Key_Functionen.Key_up = Func;
}
Und dann kommen diese Fehlermedungen heraus:
driver.cpp:255: error: invalid use of member (did you forget the '&' ?)
driver.cpp: In function 'void Add_Keydown(int* (*)(char))':
driver.cpp:260: error: invalid use of member (did you forget the '&' ?)
driver.cpp: In function 'void Add_Keydown(int* (*)(char, char, unsigned char))':
driver.cpp:263: error: redefinition of 'void Add_Keydown(int* (*)(char, char, un
signed char))'
driver.cpp:253: error: 'void Add_Keydown(int* (*)(char, char, unsigned char))' p
reviously defined here
driver.cpp:265: error: invalid use of member (did you forget the '&' ?)