From 66f356c6a14e8762c7480fa26db12f51a48d7854 Mon Sep 17 00:00:00 2001 From: chenhuan Date: Wed, 20 Nov 2019 12:44:13 +0100 Subject: [PATCH] buttonPressed --- src/GUI.hpp | 2 +- src/GUI_Window.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/GUI.hpp b/src/GUI.hpp index e8ab6c7..502f001 100644 --- a/src/GUI.hpp +++ b/src/GUI.hpp @@ -19,7 +19,7 @@ */ class GUI_Window : public Fl_Window { int x, y, button; - + vkvm::KeyCode* keyCode; int handle(int e); public: diff --git a/src/GUI_Window.cpp b/src/GUI_Window.cpp index 5e9b128..e1634a6 100644 --- a/src/GUI_Window.cpp +++ b/src/GUI_Window.cpp @@ -41,12 +41,15 @@ auto GUI_Window::handle(int e) -> int { case FL_KEYBOARD: vkvm::callEvent(vkvm::EventType::KeyDown); button = Fl::event_button(); - std::cout << "Keyboard:" << (unsigned short) button << " down" << std::endl; + keyCode = new vkvm::KeyCode(button); + vkvm::buttonPressed(*keyCode); return 1; case FL_KEYUP: vkvm::callEvent(vkvm::EventType::KeyUp); button = Fl::event_button(); - std::cout << "Keyboard:" << (unsigned short) button << " up" << std::endl; + std::cout<