Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BigBen kid's PS3 gamepad 146b:0902 to filterTrigger() #576

Merged
merged 1 commit into from
Aug 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions es-core/src/guis/GuiInputConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,17 @@ void GuiInputConfig::clearAssignment(int inputId)
bool GuiInputConfig::filterTrigger(Input input, InputConfig* config, int inputId)
{
#if defined(__linux__)
// match PlayStation joystick with 6 axes only
if((strstr(config->getDeviceName().c_str(), "PLAYSTATION") != NULL \
|| strstr(config->getDeviceName().c_str(), "PS3 Ga") != NULL \
|| strstr(config->getDeviceName().c_str(), "PS(R) Ga") != NULL) \
&& InputManager::getInstance()->getAxisCountByDevice(config->getDeviceId()) == 6)
// on Linux, some gamepads return both an analog axis and a digital button for the trigger;
// we want the analog axis only, so this function removes the button press event

if((
// match PlayStation joystick with 6 axes only
strstr(config->getDeviceName().c_str(), "PLAYSTATION") != NULL
|| strstr(config->getDeviceName().c_str(), "PS3 Ga") != NULL
|| strstr(config->getDeviceName().c_str(), "PS(R) Ga") != NULL
// BigBen kid's PS3 gamepad 146b:0902, matched on SDL GUID because its name "Bigben Interactive Bigben Game Pad" may be too generic
|| strcmp(config->getDeviceGUIDString().c_str(), "030000006b1400000209000011010000") == 0
) && InputManager::getInstance()->getAxisCountByDevice(config->getDeviceId()) == 6)
{
// digital triggers are unwanted
if (input.type == TYPE_BUTTON && (input.id == 6 || input.id == 7))
Expand Down