#include <acess/sys.h>
// === CODE ===
+int Input_Init(void)
+{
+ struct {
+ int Num, Value;
+ } num_value;
+ giMouseFD = open(gsMouseDevice, 3);
+
+ num_value.Num = 0;
+ num_value.Value = giScreenWidth;
+ ioctl(giMouseFD, 6, &num_value);
+
+ num_value.Num = 1;
+ num_value.Value = giScreenHeight;
+ ioctl(giMouseFD, 6, &num_value);
+
+ return 0;
+}
+
void Input_FillSelect(int *nfds, fd_set *set)
{
if(*nfds < giTerminalFD) *nfds = giTerminalFD;
// oops, error
}
// TODO: pass on to message handler
+ _SysDebug("Keypress 0x%x", codepoint);
}
if(FD_ISSET(giMouseFD, set))
} 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
// Handle movement
// Video_SetCursorPos( mouseinfo.Axies[0], mouseinfo.Axies[1] );
+ _SysDebug("Cursor to %i,%i\n", mouseinfo.Axies[0], mouseinfo.Axies[1]);
}
}