29 lines
No EOL
692 B
C++
29 lines
No EOL
692 B
C++
#ifdef DEBUG
|
|
#ifndef __DEBUG_CPP
|
|
#define __DEBUG_CPP
|
|
|
|
#include "cursor.cpp"
|
|
|
|
/**
|
|
* @brief Prints value of pressed key in top left corner.
|
|
* Additionally it can get offet to see more presses.
|
|
*
|
|
* @param _key char that we got.
|
|
*/
|
|
void debugKey(cursor::key _key) {
|
|
static unsigned short offset = 0;
|
|
cursor::savePosition();
|
|
cursor::setPosition(1, 1);
|
|
// std::cout << " "; // clear debug corner :^)
|
|
cursor::setPosition(offset++ * 4 + 1, 1);
|
|
std::cout << "\033[31;1m";
|
|
// if control flag set
|
|
if (_key.special != 0)
|
|
std::cout << "^";
|
|
std::cout << int(_key.code);
|
|
std::cout << "\033[0m";
|
|
cursor::restorePosition();
|
|
}
|
|
|
|
#endif
|
|
#endif |