X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2Finput.cpp;h=7519b877fec848b9d8a9937208f5293f60911395;hb=47296e890b2b09cbc46db30d7fe2aeeae11a6d4a;hp=bea47775fc23f8f13425b02a92fc687e84192eab;hpb=340e7923b1e95c39ac85a4b22af7f1b53b315cd9;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/input.cpp b/Usermode/Applications/axwin4_src/Server/input.cpp index bea47775..7519b877 100644 --- a/Usermode/Applications/axwin4_src/Server/input.cpp +++ b/Usermode/Applications/axwin4_src/Server/input.cpp @@ -7,26 +7,38 @@ */ #include #include +#include +#include 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