Return -1 if no InputDevice numbers can be assigned to logical devices.

This commit is contained in:
Steve Checkoway
2006-02-27 00:21:14 +00:00
parent 5a916de95b
commit a63a1284fa
3 changed files with 11 additions and 14 deletions
@@ -48,33 +48,32 @@ void PumpDevice::GetButtonPresses( vector<pair<DeviceInput, bool> >& vPresses, i
}
if( db1 != DeviceButton_Invalid )
{
DeviceInput di( id, db1, pressed1 ? 1.0f : 0.0f , now );
DeviceInput di( m_Id, db1, pressed1 ? 1.0f : 0.0f , now );
vPresses.push_back( pair<DeviceInput, bool>(di, pressed1) );
}
if( db2 != DeviceButton_Invalid )
{
DeviceInput di( id, db2, pressed2 ? 1.0f : 0.0f , now );
DeviceInput di( m_Id, db2, pressed2 ? 1.0f : 0.0f , now );
vPresses.push_back( pair<DeviceInput, bool>(di, pressed2) );
}
}
int PumpDevice::AssignIDs( InputDevice startID )
{
id = DEVICE_NONE;
if( startID < DEVICE_PUMP1 || startID > DEVICE_PUMP2 )
return 0;
id = startID;
return -1;
m_Id = startID;
return 1;
}
void PumpDevice::GetDevicesAndDescriptions( vector<InputDevice>& dev, vector<RString>& desc ) const
{
dev.push_back( id );
dev.push_back( m_Id );
desc.push_back( "Pump USB" );
}
/*
* (c) 2005-2006 Steve Checkoway
* (c) 2006 Steve Checkoway
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a