Add in analog stick control handling. Add interface configuration file.
This commit is contained in:
@@ -125,6 +125,27 @@ bool Input::Released(){
|
||||
return false;
|
||||
}
|
||||
|
||||
float Input::Analog(){
|
||||
if(!game->IsFocused())return false;
|
||||
switch(type){
|
||||
case ANALOG:{
|
||||
for(GamePad*gamepad:GamePad::getGamepads()){
|
||||
if(gamepad->stillConnected){
|
||||
float axisVal=gamepad->getAxis(static_cast<GPAxes>(key));
|
||||
if(axisVal!=0.f){
|
||||
usingGamepad=true;
|
||||
return axisVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}break;
|
||||
default:{
|
||||
ERR("Invalid Control Scheme detected for analog controls! We shouldn't be here!! Type is "<<type);
|
||||
}
|
||||
}
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
std::string Input::GetDisplayName(){
|
||||
return GenericKey::keyLiteral.at({type,key});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user