2 * Acess GUI (AxWin) Version 2
3 * By John Hodge (thePowersGang)
8 #define JOY_IOCTL_GETSETAXISLIMIT 6
9 #define JOY_IOCTL_GETSETAXISPOSITION 7
19 giMouseFD = open(gsMouseDevice, 3);
23 num_value.Value = giScreenWidth;
24 ioctl(giMouseFD, JOY_IOCTL_GETSETAXISLIMIT, &num_value);
25 num_value.Value = giScreenWidth/2;
26 ioctl(giMouseFD, JOY_IOCTL_GETSETAXISPOSITION, &num_value);
29 num_value.Value = giScreenHeight;
30 ioctl(giMouseFD, JOY_IOCTL_GETSETAXISLIMIT, &num_value);
31 num_value.Value = giScreenHeight/2;
32 ioctl(giMouseFD, JOY_IOCTL_GETSETAXISPOSITION, &num_value);
37 void Input_FillSelect(int *nfds, fd_set *set)
39 if(*nfds < giTerminalFD) *nfds = giTerminalFD;
40 if(*nfds < giMouseFD) *nfds = giMouseFD;
41 FD_SET(giTerminalFD, set);
42 FD_SET(giMouseFD, set);
45 void Input_HandleSelect(fd_set *set)
47 if(FD_ISSET(giTerminalFD, set))
50 if( read(giTerminalFD, &codepoint, sizeof(codepoint)) != sizeof(codepoint) )
54 // TODO: pass on to message handler
55 _SysDebug("Keypress 0x%x", codepoint);
58 if(FD_ISSET(giMouseFD, set))
72 seek(giMouseFD, 0, SEEK_SET);
73 if( read(giMouseFD, &mouseinfo, sizeof(mouseinfo)) != sizeof(mouseinfo) )
75 // Not a 3 button mouse, oops
79 // _SysDebug("sizeof(uint16_t) = %i, sizeof(int16_t) = %i",
80 // sizeof(uint16_t), sizeof(int16_t));
81 // _SysDebug("NAxies=%i,NButtons=%i", mouseinfo.NAxies, mouseinfo.NButtons);
82 // _SysDebug("offsetof(Axies[0].MinValue) = %i", offsetof(struct sMouseInfo, Axies[0].MinValue));
83 // _SysDebug("[0] = {MinValue=%i,MaxValue=%i,CurValue=%i}",
84 // mouseinfo.Axies[0].MinValue, mouseinfo.Axies[0].MaxValue,
85 // mouseinfo.Axies[0].CurValue
88 Video_SetCursorPos( mouseinfo.Axies[0].CursorPos, mouseinfo.Axies[1].CursorPos );
89 // _SysDebug("Cursor to %i,%i", mouseinfo.Axies[0].CursorPos, mouseinfo.Axies[1].CursorPos);