feedback
This commit is contained in:
@@ -108,18 +108,20 @@ void init() {
|
||||
}
|
||||
|
||||
bool fetch(Key &pressed) {
|
||||
// TODO: You have to implement this method
|
||||
uint8_t status_reg = ctrl_port.inb();
|
||||
if(status_reg & IS_MOUSE || !(status_reg & HAS_OUTPUT) )
|
||||
if(!(status_reg & HAS_OUTPUT) )
|
||||
return false; // TODO Remove mouse events from buffer
|
||||
DBG_VERBOSE << "status: " << hex << static_cast<int>(status_reg) << "\n" << flush;
|
||||
|
||||
uint8_t out_buffer = data_port.inb();
|
||||
DBG_VERBOSE << "scancode: " << hex << static_cast<int>(out_buffer) << "\n" << flush;
|
||||
|
||||
if (status_reg & IS_MOUSE)
|
||||
return false;
|
||||
|
||||
pressed = key_decoder.decode(out_buffer);
|
||||
|
||||
if (pressed.alt() || pressed.ctrl() || pressed.shift || !pressed.valid())
|
||||
if (pressed.alt() || pressed.ctrl() || !pressed.valid())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "textstream.h"
|
||||
#include "../arch/lapic.h"
|
||||
#include "../arch/core.h"
|
||||
|
||||
TextStream::TextStream(unsigned from_col,
|
||||
unsigned to_col,
|
||||
@@ -17,7 +17,7 @@ TextStream::TextStream(unsigned from_col,
|
||||
|
||||
|
||||
void TextStream::flush() {
|
||||
CGA::Color fg = static_cast<CGA::Color>((LAPIC::getID() + 1 ));
|
||||
CGA::Color fg = static_cast<CGA::Color>((Core::getID() + 1 ));
|
||||
print(buffer,pos,CGA::Attribute(CGA::LIGHT_GREEN, fg, false));
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user