2 * Acess GUI (AxWin) Version 2
3 * By John Hodge (thePowersGang)
16 giMouseFD = open(gsMouseDevice, 3);
20 num_value.Value = giScreenWidth;
21 ioctl(giMouseFD, 6, &num_value);
24 num_value.Value = giScreenHeight;
25 ioctl(giMouseFD, 6, &num_value);
30 void Input_FillSelect(int *nfds, fd_set *set)
32 if(*nfds < giTerminalFD) *nfds = giTerminalFD;
33 if(*nfds < giMouseFD) *nfds = giMouseFD;
34 FD_SET(giTerminalFD, set);
35 FD_SET(giMouseFD, set);
38 void Input_HandleSelect(fd_set *set)
40 if(FD_ISSET(giTerminalFD, set))
43 if( read(giTerminalFD, &codepoint, sizeof(codepoint)) != sizeof(codepoint) )
47 // TODO: pass on to message handler
48 _SysDebug("Keypress 0x%x", codepoint);
51 if(FD_ISSET(giMouseFD, set))
65 seek(giMouseFD, 0, SEEK_SET);
66 if( read(giMouseFD, &mouseinfo, sizeof(mouseinfo)) != sizeof(mouseinfo) )
68 // Not a 3 button mouse, oops
72 // _SysDebug("sizeof(uint16_t) = %i, sizeof(int16_t) = %i",
73 // sizeof(uint16_t), sizeof(int16_t));
74 // _SysDebug("NAxies=%i,NButtons=%i", mouseinfo.NAxies, mouseinfo.NButtons);
75 // _SysDebug("offsetof(Axies[0].MinValue) = %i", offsetof(struct sMouseInfo, Axies[0].MinValue));
76 // _SysDebug("[0] = {MinValue=%i,MaxValue=%i,CurValue=%i}",
77 // mouseinfo.Axies[0].MinValue, mouseinfo.Axies[0].MaxValue,
78 // mouseinfo.Axies[0].CurValue
81 // Video_SetCursorPos( mouseinfo.Axies[0], mouseinfo.Axies[1] );
82 _SysDebug("Cursor to %i,%i", mouseinfo.Axies[0].CursorPos, mouseinfo.Axies[1].CursorPos);