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 support for Xbox Controller S #1737

Merged
merged 1 commit into from Sep 29, 2019

Conversation

@LukeUsher
Copy link
Member

commented Sep 28, 2019

This PR adds support for 'Xbox Controller S' to the input system.

The Xbox Controller S is functionally identical to the standard controller, it has all the same inputs, but the physical layout of the buttons is different: You can see the layouts represented in the XDK Controller Test sample screenshots below.

Device Selection Dialog:
image

XDK Controller Test (Controller S Connected):
image

XDK Controller Test (Controller 'Duke' Connected):
image

@@ -39,7 +39,7 @@ constexpr ControlState INPUT_DETECT_THRESHOLD = 0.55; // arbitrary number, using
InputWindow* g_InputWindow = nullptr;
int dev_num_buttons[to_underlying(XBOX_INPUT_DEVICE::DEVICE_MAX)] = {
XBOX_CTRL_NUM_BUTTONS,
0,
XBOX_CTRL_NUM_BUTTONS,

This comment has been minimized.

Copy link
@LukeUsher

LukeUsher Sep 28, 2019

Author Member

This change adds the button count to the 'S' device type

@LukeUsher

This comment has been minimized.

Copy link
Member Author

commented Sep 28, 2019

Note that the purpose of this task was mostly to familiarize myself with the input system, since I'll need to add support for Sega Chihiro parts soon.

src/common/Settings.cpp Outdated Show resolved Hide resolved
@ergo720

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2019

Code indentation is inconsistent with the surrounding code (tabs/space problem?).

@LukeUsher

This comment has been minimized.

Copy link
Member Author

commented Sep 28, 2019

Code indentation is inconsistent with the surrounding code (tabs/space problem?).

All new code uses spaces, but there is existing code in many places that still uses tabs. I didn't want to change all the surrounding code to match because that would make the log awkward to see what actually changed.

@RadWolfie

This comment has been minimized.

Copy link
Member

commented Sep 28, 2019

I do use spaces unless other function is using tabs, then I just convert my spaces to tabs. It's how I roll for now. 😉

@LukeUsher LukeUsher force-pushed the LukeUsher:xbox-controller-s branch from af06429 to 31078f7 Sep 29, 2019
@LukeUsher

This comment has been minimized.

Copy link
Member Author

commented Sep 29, 2019

Latest commit was a rebase + feedback addressing, although msvc decided to normalize the line-endings in one file...

We should probably fix line-endings globally soon, it's an annoying problem

@ergo720 ergo720 merged commit 89e1909 into Cxbx-Reloaded:develop Sep 29, 2019
3 checks passed
3 checks passed
Cxbx-Reloaded.Cxbx-Reloaded Build #20190929.3 succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@LukeUsher LukeUsher deleted the LukeUsher:xbox-controller-s branch Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.