Closed
Bug 1107801
Opened 11 years ago
Closed 11 years ago
Improve gamepad support on MacOS
Categories
(Core :: Hardware Abstraction Layer (HAL), defect)
Tracking
()
RESOLVED
FIXED
mozilla39
| Tracking | Status | |
|---|---|---|
| firefox39 | --- | fixed |
People
(Reporter: rbarker, Assigned: rbarker)
Details
Attachments
(1 file, 2 obsolete files)
On MacOS, the gamepad API does not support a number of buttons on the device. Buttons missing include: left and right shoulder triggers, home and back button, thumb stick buttons. Additionally, analog buttons are not supported.
| Assignee | ||
Comment 1•11 years ago
|
||
| Assignee | ||
Comment 2•11 years ago
|
||
Comment on attachment 8532371 [details] [diff] [review]
Gamepad patch v1
While playing with the gamepad API on MacOS, I encountered a crash in nightly when a thumb stick button was pressed. The code was hitting an assert because the button ids on MacOS are not sequential. While fixing this issue I noticed the full gamepad was not supported. This patch adds missing buttons and adds support for analog buttons. I think the d-pad/hatswitch is the only thing not supported now.
Attachment #8532371 -
Flags: feedback?(ted)
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → rbarker
| Assignee | ||
Comment 3•11 years ago
|
||
Added dpad support from :ted
Attachment #8532371 -
Attachment is obsolete: true
Attachment #8532371 -
Flags: feedback?(ted)
| Assignee | ||
Comment 4•11 years ago
|
||
Comment on attachment 8532733 [details] [diff] [review]
Gamepad patch v2
Updated patch to include dpad support.
Attachment #8532733 -
Flags: review?(ted)
| Assignee | ||
Comment 5•11 years ago
|
||
Comment 6•11 years ago
|
||
Comment on attachment 8532733 [details] [diff] [review]
Gamepad patch v2
Review of attachment 8532733 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for fixing this up!
::: hal/cocoa/CocoaGamepad.cpp
@@ +32,5 @@
> + id(aId),
> + analog((aMax - aMin) > 1),
> + element(aElement),
> + min(aMin),
> + max(aMax) {;}
The semicolon here seems extraneous.
@@ +90,5 @@
> // Index given by our superclass.
> uint32_t mSuperIndex;
>
> + const bool isDpad(IOHIDElementRef element) const
> + {
The positioning of open curly braces is inconsistent with the rest of the file. I don't know what the Mozilla style guide recommends, but can you figure that out and just make them all match the style guide?
@@ +173,5 @@
> + usage == kBrakeUsage)) ||
> + (usagePage == kButtonUsagePage) ||
> + (usagePage == kConsumerPage &&
> + (usage == kHomeUsage ||
> + usage == kBackUsage))) {
This is pretty depressing, but that's life with the USB HID.
Attachment #8532733 -
Flags: review?(ted) → review+
Comment 7•11 years ago
|
||
(In reply to Randall Barker [:rbarker] from comment #0)
> On MacOS, the gamepad API does not support a number of buttons on the
> device. Buttons missing include: left and right shoulder triggers, home and
> back button, thumb stick buttons. Additionally, analog buttons are not
> supported.
To clarify: USB HID is weird, and devices make use of it in weird ways, and Randall was testing with a controller that I don't have that does things in an exceptionally weird way.
Comment 8•11 years ago
|
||
I bet we want a similar fix on Windows. If you have access to a Windows machine I could point you at what to fix. If not I might just have to get one of those controllers.
Comment 9•11 years ago
|
||
Were you going to land this? I got one of these gamepads and was playing around with it and it still crashes. :-(
Flags: needinfo?(rbarker)
| Assignee | ||
Comment 10•11 years ago
|
||
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #9)
> Were you going to land this? I got one of these gamepads and was playing
> around with it and it still crashes. :-(
Yes, I saw that the e10s work was being done and files were being moved around and was going to update the patch after than landed. Should I stop waiting and just land?
Flags: needinfo?(rbarker)
Comment 11•11 years ago
|
||
Yeah, just land it, qdot can rebase around your changes.
| Assignee | ||
Comment 12•11 years ago
|
||
Rebased to latest code. Addressed comments. Carry forward r+ from :ted.mielczarek
Attachment #8532733 -
Attachment is obsolete: true
| Assignee | ||
Comment 13•11 years ago
|
||
| Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 14•11 years ago
|
||
Keywords: checkin-needed
I had to back this out for a test failure in https://hg.mozilla.org/integration/mozilla-inbound/rev/812ea3cdd997
https://treeherder.mozilla.org/logviewer.html#?job_id=7954903&repo=mozilla-inbound
Flags: needinfo?(ted)
Flags: needinfo?(rbarker)
Relanded in https://hg.mozilla.org/integration/mozilla-inbound/rev/242d0bc4a44c as the failure happened on another repository where this patch didn't exist, so this couldn't be at fault.
Sorry for jumping the gun.
Flags: needinfo?(ted)
Flags: needinfo?(rbarker)
Comment 17•11 years ago
|
||
Given the test that was failing I don't blame you!
Comment 18•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•