Skip to content

Commit 433bc7e

Browse files
committed
fix a couple little things
1 parent 10092ed commit 433bc7e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/controller/controldeck/ControlDeck.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ ControlDeck::ControlDeck(std::vector<CONTROLLERBUTTONS_T> additionalBitmasks,
1313
std::shared_ptr<ControllerDefaultMappings> controllerDefaultMappings) {
1414
mConnectedPhysicalDeviceManager = std::make_shared<ConnectedPhysicalDeviceManager>();
1515
mGlobalSDLDeviceSettings = std::make_shared<GlobalSDLDeviceSettings>();
16-
if (controllerDefaultMappings == nullptr) {
17-
mControllerDefaultMappings = std::make_shared<ControllerDefaultMappings>();
18-
}
16+
mControllerDefaultMappings = controllerDefaultMappings == nullptr ? std::make_shared<ControllerDefaultMappings>()
17+
: controllerDefaultMappings;
1918
}
2019

2120
ControlDeck::~ControlDeck() {

src/controller/controldevice/controller/ControllerButton.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,10 @@ bool ControllerButton::ProcessMouseButtonEvent(bool isPressed, MouseBtn button)
266266
}
267267

268268
void ControllerButton::AddDefaultMappings(PhysicalDeviceType physicalDeviceType) {
269-
for (auto mapping : ButtonMappingFactory::CreateDefaultSDLButtonMappings(mPortIndex, mBitmask)) {
270-
AddButtonMapping(mapping);
269+
if (physicalDeviceType == PhysicalDeviceType::SDLGamepad) {
270+
for (auto mapping : ButtonMappingFactory::CreateDefaultSDLButtonMappings(mPortIndex, mBitmask)) {
271+
AddButtonMapping(mapping);
272+
}
271273
}
272274

273275
if (physicalDeviceType == PhysicalDeviceType::Keyboard) {

0 commit comments

Comments
 (0)