+ uint32_t codepoint;
+ if( read(giTerminalFD, sizeof(codepoint), &codepoint) != sizeof(codepoint) )
+ {
+ // oops, error
+ }
+ // TODO: pass on to message handler
+ _SysDebug("Keypress 0x%x", codepoint);
+ }
+
+ if(FD_ISSET(giMouseFD, set))
+ {
+ struct sMouseInfo {
+ uint16_t NAxies, NButtons;
+ struct sMouseAxis {
+ int16_t MinValue, MaxValue;
+ int16_t CurValue;
+ uint16_t CursorPos;
+ } Axies[2];
+ uint8_t Buttons[3];
+ } mouseinfo;
+
+ _SysDebug("Cursor event");
+
+ seek(giMouseFD, 0, SEEK_SET);
+ if( read(giMouseFD, sizeof(mouseinfo), &mouseinfo) != sizeof(mouseinfo) )
+ {
+ // Not a 3 button mouse, oops
+ return ;
+ }