log keyeventlistener
This commit is contained in:
@ -1,11 +1,14 @@
|
|||||||
#include "user/event/KeyEventListener.h"
|
#include "user/event/KeyEventListener.h"
|
||||||
#include "kernel/Globals.h"
|
#include "kernel/Globals.h"
|
||||||
|
|
||||||
|
Logger KeyEventListener::log("KEvLis");
|
||||||
|
|
||||||
void KeyEventListener::trigger(char c) {
|
void KeyEventListener::trigger(char c) {
|
||||||
this->lastChar = c;
|
this->lastChar = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
char KeyEventListener::waitForKeyEvent() const {
|
char KeyEventListener::waitForKeyEvent() const {
|
||||||
|
log << DEBUG << "Thread with id: " << tid << " waiting for key event" << endl;
|
||||||
scheduler.block();
|
scheduler.block();
|
||||||
return this->lastChar; // This is only executed after thread is woken up by manager
|
return this->lastChar; // This is only executed after thread is woken up by manager
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,8 @@ class KeyEventListener {
|
|||||||
private:
|
private:
|
||||||
KeyEventListener(const KeyEventListener& copy) = delete;
|
KeyEventListener(const KeyEventListener& copy) = delete;
|
||||||
|
|
||||||
|
static Logger log;
|
||||||
|
|
||||||
char lastChar = '\0';
|
char lastChar = '\0';
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
#include "user/lib/Vector.h"
|
#include "user/lib/Vector.h"
|
||||||
|
|
||||||
// NOTE: Could do this more generally but we only have key events
|
// NOTE: Could do this more generally but we only have key events
|
||||||
|
// Also pretty limited: One thread can have one listener as identification is done over tid
|
||||||
|
|
||||||
class KeyEventManager {
|
class KeyEventManager {
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user