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:
AJ Kelly
2011-02-14 17:08:29 -06:00
parent 5597b86887
commit 641777ddf7
8 changed files with 168 additions and 101 deletions
+6 -6
View File
@@ -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);