Usermode/axwin4 - Continuing
[tpg/acess2.git] / Usermode / Applications / axwin4_src / Server / input.cpp
1 /*
2  * Acess2 GUI v4
3  * - By John Hodge (thePowersGang)
4  *
5  * input.cpp
6  * - Input
7  */
8 #include <CConfigInput.hpp>
9 #include <input.hpp>
10 #include <CCompositor.hpp>
11 #include <algorithm>
12
13 namespace AxWin {
14
15 CInput::CInput(const ::AxWin::CConfigInput& config, CCompositor& compositor):
16         m_compositor(compositor),
17         m_keyboardFD(0),
18         m_mouseFD(-1)
19 {
20         
21 }
22
23 int CInput::FillSelect(::fd_set& rfds)
24 {
25         FD_SET(m_keyboardFD, &rfds);
26         FD_SET(m_mouseFD, &rfds);
27         return ::std::max(m_keyboardFD, m_mouseFD)+1;
28 }
29
30 void CInput::HandleSelect(::fd_set& rfds)
31 {
32         if( FD_ISSET(m_keyboardFD, &rfds) )
33         {
34                 // TODO: Read keystroke and handle
35         }
36         
37         if( FD_ISSET(m_mouseFD, &rfds) )
38         {
39                 // TODO: Read mouse event and handle
40         }
41 }
42
43 };      // namespace AxWin
44

UCC git Repository :: git.ucc.asn.au