summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
98cd183)
- TODO: Implement the cursor (probably as a HW cursor in the video driver)
#include <acess/sys.h>
// === CODE ===
#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;
void Input_FillSelect(int *nfds, fd_set *set)
{
if(*nfds < giTerminalFD) *nfds = giTerminalFD;
// oops, error
}
// TODO: pass on to message handler
// oops, error
}
// TODO: pass on to message handler
+ _SysDebug("Keypress 0x%x", codepoint);
}
if(FD_ISSET(giMouseFD, set))
}
if(FD_ISSET(giMouseFD, set))
} Axies[2];
uint8_t Buttons[3];
} mouseinfo;
} 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
if( read(giMouseFD, sizeof(mouseinfo), &mouseinfo) != sizeof(mouseinfo) )
{
// Not a 3 button mouse, oops
// Handle movement
// Video_SetCursorPos( mouseinfo.Axies[0], mouseinfo.Axies[1] );
// Handle movement
// Video_SetCursorPos( mouseinfo.Axies[0], mouseinfo.Axies[1] );
+ _SysDebug("Cursor to %i,%i\n", mouseinfo.Axies[0], mouseinfo.Axies[1]);
// === IMPORTS ===
extern void WM_Update(void);
// === IMPORTS ===
extern void WM_Update(void);
+extern int Input_Init(void);
// === GLOBALS ===
const char *gsTerminalDevice = NULL;
// === GLOBALS ===
const char *gsTerminalDevice = NULL;
Video_Setup();
Interface_Init();
IPC_Init();
Video_Setup();
Interface_Init();
IPC_Init();