1 /***************************************************************************** 2 * $LastChangedDate: 2009-12-14 20:05:10 -0500 (Mon, 14 Dec 2009) $ 3 * @file 4 * @author Jim E. Brooks http://www.palomino3d.org 5 * @brief Initialize/start module. 6 *//* 7 * LEGAL: COPYRIGHT (C) 2007 JIM E. BROOKS 8 * THIS SOURCE CODE IS RELEASED UNDER THE TERMS 9 * OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2). 10 *****************************************************************************/ 11 12 #define INPUT_MODULE_CC 1 13 #include "base/module.hh" 14 #include "base/module_macros.hh" 15 using namespace base; 16 #include "glue/module.hh" 17 using namespace glue; 18 #include "input/module.hh" 19 #include "input/conf.hh" 20 #include "input/device_keyboard.hh" 21 #include "input/device_joystick.hh" 22 #include "input/device_mouse.hh" 23 24 namespace input { 25 26 /***************************************************************************** 27 * Initialize module. 28 *****************************************************************************/ 29 void Init(const base::InitArgs & initArgs)30Init( const base::InitArgs& initArgs ) 31 { 32 MODULE_INIT_LOAD_CONF_TXT( input ) 33 } 34 35 /***************************************************************************** 36 * Start module. 37 *****************************************************************************/ 38 void Start(void)39Start( void ) 40 { 41 // Enable devices. 42 GET_KEYBOARD_DEVICE().Enable( true ); 43 //GET_JOYSTICK_DEVICE().Enable( true ); // enabled by control::Joystick 44 #if COMPILE_PALOMINO != 3 45 GET_MOUSE_DEVICE().Enable( true ); 46 #endif 47 48 // Configure queues to drop events on slow systems. 49 GET_KEYBOARD_DEVICE().SetQueueOverflow( INPUT_CONF.mKeyboardInputQueueOverflow ); 50 GET_JOYSTICK_DEVICE().SetQueueOverflow( INPUT_CONF.mJoystickInputQueueOverflow ); 51 GET_MOUSE_DEVICE().SetQueueOverflow( INPUT_CONF.mMouseInputQueueOverflow ); 52 } 53 54 } // namespace input 55