~ fixed compiler errors (KeyCode)

This commit is contained in:
Julian Hinxlage 2019-11-26 15:57:54 +01:00
parent 880b4c1985
commit 818ebcdb43
2 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@
*/ */
class GUI_Window : public Fl_Window { class GUI_Window : public Fl_Window {
int x, y, button; int x, y, button;
vkvm::KeyCode* keyCode; vkvm::KeyCode keyCode;
int handle(int e); int handle(int e);
char* position_to_string(int x,int y); char* position_to_string(int x,int y);
public: public:

View File

@ -45,16 +45,16 @@ auto GUI_Window::handle(int e) -> int {
/*keyboardbutton*/ /*keyboardbutton*/
case FL_KEYBOARD: case FL_KEYBOARD:
button = Fl::event_button(); button = Fl::event_button();
keyCode = new vkvm::KeyCode(button); keyCode = vkvm::KeyCode(button);
vkvm::buttonPressed(*keyCode); vkvm::buttonPressed(keyCode);
vkvm::callEvent(vkvm::EventType::KeyDown); vkvm::callEvent(vkvm::EventType::KeyDown);
this->child(2)->label("Event:Key Down"); this->child(2)->label("Event:Key Down");
return 1; return 1;
case FL_KEYUP: case FL_KEYUP:
button = Fl::event_button(); button = Fl::event_button();
std::cout<<button<<std::endl; std::cout<<button<<std::endl;
keyCode = new vkvm::KeyCode(button); keyCode = vkvm::KeyCode(button);
vkvm::buttonPressed(*keyCode); vkvm::buttonPressed(keyCode);
vkvm::callEvent(vkvm::EventType::KeyUp); vkvm::callEvent(vkvm::EventType::KeyUp);
this->child(2)->label("Event:Key Up"); this->child(2)->label("Event:Key Up");
return 1; return 1;