Found 2 DirectInput devices:
0: 'Keyboard' axes: 0, hats: 0, buttons: 256 (buffered) 1: 'Mouse' axes: 3, hats: 0, buttons: 8 (buffered) So let's get this straight: Left, Right, and Middle clicks work. Wheel Up and Wheel Down work. X/Y axis doesn't seem to work yet.
This commit is contained in:
+6
-6
@@ -38,7 +38,7 @@ RageInput::RageInput()
|
||||
|
||||
RageInput::~RageInput()
|
||||
{
|
||||
/* Delete optional devices. */
|
||||
// Delete optional devices.
|
||||
for( unsigned i = 0; i < m_InputHandlers.size(); ++i )
|
||||
delete m_InputHandlers[i].m_pDevice;
|
||||
m_InputHandlers.clear();
|
||||
@@ -55,28 +55,28 @@ void RageInput::LoadDrivers()
|
||||
m_InputHandlers.clear();
|
||||
g_mapDeviceToHandler.clear();
|
||||
|
||||
/* Init optional devices. */
|
||||
// Init optional devices.
|
||||
vector<InputHandler *> apDevices;
|
||||
|
||||
InputHandler::Create( g_sInputDrivers, apDevices );
|
||||
for( unsigned i = 0; i < apDevices.size(); ++i )
|
||||
AddHandler( apDevices[i] );
|
||||
|
||||
/* If no input devices are loaded, the user won't be able to input anything. */
|
||||
// If no input devices are loaded, the user won't be able to input anything.
|
||||
if( apDevices.size() == 0 )
|
||||
LOG->Warn( "No input devices were loaded." );
|
||||
}
|
||||
|
||||
void RageInput::Update()
|
||||
{
|
||||
/* Update optional devices. */
|
||||
// Update optional devices.
|
||||
for( unsigned i = 0; i < m_InputHandlers.size(); ++i )
|
||||
m_InputHandlers[i].m_pDevice->Update();
|
||||
}
|
||||
|
||||
bool RageInput::DevicesChanged()
|
||||
{
|
||||
/* Update optional devices. */
|
||||
// Update optional devices.
|
||||
for( unsigned i = 0; i < m_InputHandlers.size(); ++i )
|
||||
{
|
||||
if( m_InputHandlers[i].m_pDevice->DevicesChanged() )
|
||||
@@ -111,7 +111,7 @@ void RageInput::AddHandler( InputHandler *pHandler )
|
||||
g_mapDeviceToHandler[idi->id] = pHandler;
|
||||
}
|
||||
|
||||
/* Return the first InputDriver for the requested InputDevice. */
|
||||
/** @brief Return the first InputDriver for the requested InputDevice. */
|
||||
InputHandler *RageInput::GetHandlerForDevice( const InputDevice id )
|
||||
{
|
||||
map<InputDevice, InputHandler *>::iterator it = g_mapDeviceToHandler.find(id);
|
||||
|
||||
Reference in New Issue
Block a user