Usermode/AxWin4 - Server implemenation moving along
[tpg/acess2.git] / Usermode / Applications / axwin4_src / Server / input.cpp
index bea4777..7519b87 100644 (file)
@@ -7,26 +7,38 @@
  */
 #include <CConfigInput.hpp>
 #include <input.hpp>
  */
 #include <CConfigInput.hpp>
 #include <input.hpp>
+#include <CCompositor.hpp>
+#include <algorithm>
 
 namespace AxWin {
 
 
 namespace AxWin {
 
-namespace Input {
-
-void Initialise(const ::AxWin::CConfigInput& config)
+CInput::CInput(const ::AxWin::CConfigInput& config, CCompositor& compositor):
+       m_compositor(compositor),
+       m_keyboardFD(0),
+       m_mouseFD(-1)
 {
        
 }
 
 {
        
 }
 
-int FillSelect(::fd_set& rfds)
+int CInput::FillSelect(::fd_set& rfds)
 {
 {
-       return 0;
+       FD_SET(m_keyboardFD, &rfds);
+       FD_SET(m_mouseFD, &rfds);
+       return ::std::max(m_keyboardFD, m_mouseFD)+1;
 }
 
 }
 
-void HandleSelect(::fd_set& rfds)
+void CInput::HandleSelect(::fd_set& rfds)
 {
 {
+       if( FD_ISSET(m_keyboardFD, &rfds) )
+       {
+               // TODO: Read keystroke and handle
+       }
+       
+       if( FD_ISSET(m_mouseFD, &rfds) )
+       {
+               // TODO: Read mouse event and handle
+       }
 }
 
 }
 
-};
-
 };     // namespace AxWin
 
 };     // namespace AxWin
 

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