Commit graph

60 commits

Author SHA1 Message Date
german77
5b6545b141 Modify rumble amplification 2020-11-19 11:30:52 -06:00
Morph
e9e1876e82 input_common: Add VibrationDevice and VibrationDeviceFactory
A vibration device is an input device that returns an unsigned byte as status.
It represents whether the vibration device supports vibration or not.
If the status returns 1, it supports vibration. Otherwise, it does not support vibration.
2020-11-15 23:33:20 -05:00
german
5333db91c1 Add hotplug, rumble and fix 3rd party adapters for the GC adapter 2020-10-28 21:12:34 -05:00
Lioncash
046c0c91a3 input_common/CMakeLists: Make some warnings errors
Makes the input_common code warnings consistent with the rest of the
codebase.
2020-10-15 19:37:51 -04:00
german
c5e257017f Add automap feature for GC adapter 2020-09-18 16:51:16 -05:00
ReinUsesLisp
bc8ace9917 gc_adapter: Disable MSVC nonstandard extension warning on libusb.h
Pragma disable zero-sized array nonstandard extension warning on MSVC.
2020-09-14 19:38:08 -03:00
Lioncash
c715fc4c5e gc_adapter: Make DeviceConnected() a const member function
This doesn't modify instance state, so it can be made const.
2020-09-07 02:49:13 -04:00
bunnei
3b0fe38e86
Merge pull request #4583 from lioncash/trunc
gc_poller: Resolve compilation warnings on MSVC
2020-09-03 20:23:33 -04:00
Morph
de79897f04 input_common: Fix directional deadzone values
The hardware tested value is 0.5 which translates to SHRT_MAX / 2
2020-08-26 02:32:32 -04:00
Morph
f0fac0c7fb Project Mjölnir: Part 1
Co-authored-by: James Rowe <jroweboy@gmail.com>
Co-authored-by: Its-Rei <kupfel@gmail.com>
2020-08-26 02:32:32 -04:00
Lioncash
f60d5aac3e gc_poller: Resolve compilation warnings on MSVC
We just need to make our intentional implicit truncations explicit.
2020-08-25 23:03:12 -04:00
ameerj
d6672501ac Remove UI changes
This PR is now only the Analog devices handling the range value defaulting at 100%
2020-08-10 12:46:14 -04:00
ameerj
9c6ae697f5 Add range slider functionality for gc adapter 2020-08-10 12:46:14 -04:00
Brian J. Tarricone
d840ed90e1 GCAdapter: only join worker thread if running & joinable 2020-07-26 14:54:02 -07:00
Lioncash
ac7e4e2cab gc_adapter: Resolve C++20 deprecation warning 2020-07-25 03:38:22 -04:00
Lioncash
04699c366b gc_poller: Resolve -Wsign-compare warning 2020-07-25 03:37:22 -04:00
Lioncash
e19972dfc4 gc_poller: Resolve -Wredundant-move warning 2020-07-25 03:35:40 -04:00
ameerj
68d6d3e173 Fix axis thresholding while polling
axes were very sensitive when mapping controls.
2020-07-19 11:49:26 -04:00
ameerj
1e7bed0a45 std::size_t where appropriate, make error message more clear if can't read 2020-07-17 12:10:32 -04:00
Ameer
94f5f29573 Refactor adapter code 2020-07-16 13:00:04 -04:00
Ameer
93fe982a0c Rebase to master 2020-07-14 13:04:02 -04:00
Ameer
ab65de2f96 Fix crash if gc configured but adapter not connected 2020-07-14 11:23:10 -04:00
bunnei
393cdb15f5
Merge pull request #4314 from lioncash/input-warn
gcadapter: Tidy up compiler warnings
2020-07-14 10:20:12 -04:00
Jan Beich
883fab2fff input_common: make libusb private to gc_adapter 2020-07-13 18:48:19 +00:00
Lioncash
a1dddca4ab gc_poller: Mark GCButtonFactory::GetNextInput() as const
This doesn't modify class instance state.
2020-07-12 15:43:07 -04:00
Lioncash
839c91cd14 gc_poller: Get rid of undefined behavior in Create()
Ensures that the function always has returns in all control paths.
2020-07-12 15:41:35 -04:00
Lioncash
a8ba6dc3c9 gc_poller: Silence sign conversion warnings 2020-07-12 15:40:22 -04:00
Lioncash
32b6fc4062 gc_adapter: Remove deprecated usage of = in lambda captures
It's deprecated in C++20 to use = to capture the this pointer.

Instead, we can simply pass this as an argument to the thread
constructor.
2020-07-12 15:38:19 -04:00
Lioncash
9ce6ea648f gc_adapter: Silence sign conversion warnings 2020-07-12 15:36:27 -04:00
Ameer
042c6602a0 Break out of scan loop if can't find adapter on first run 2020-07-10 11:07:43 -04:00
Ameer
4489ea6f53 Rebase to master, fix merge conflicts 2020-07-08 21:15:49 -04:00
bunnei
5311b562aa
Merge pull request #4266 from jbeich/freebsd
gcadapter: unbreak build on FreeBSD
2020-07-08 16:30:26 -04:00
Ameer
3c7a115afe Address comments for better clarity/signed dev count 2020-07-08 14:18:54 -04:00
Ameer
ec13746e4d Add more libusb error checks 2020-07-08 13:19:33 -04:00
Ameer
b57475887b Address PR feedback, fix axis button thresholding 2020-07-07 12:20:59 -04:00
Jan Beich
1db10b8f4c input_common/gcadapter: add missing C++11 header required by libc++
In file included from src/input_common/gcadapter/gc_adapter.cpp:8:
src/./input_common/gcadapter/gc_adapter.h:77:10: error: no template named 'unordered_map' in namespace 'std'
    std::unordered_map<int, bool> buttons;
    ~~~~~^
src/./input_common/gcadapter/gc_adapter.h:78:10: error: no template named 'unordered_map' in namespace 'std'
    std::unordered_map<int, u16> axes;
    ~~~~~^
2020-07-07 10:02:03 +00:00
Ameer
e3253b5f18 Brace the code! Fix compile error due to class member construction order 2020-07-06 23:01:57 -04:00
Ameer
86abff48e1 Recalibrate reconnected controllers 2020-07-06 22:09:07 -04:00
Ameer
7ad423923d Save origin state of GC controller analog features, compare against origin for input detection 2020-07-06 21:58:31 -04:00
Ameer
d00972fce1 Fix for always firing triggers on some controllers, trigger threshold more universal 2020-07-04 00:40:48 -04:00
Ameer
e69d715e3d Address lioncash feedback: Log formatting, extern const PadButtonArray, little touch ups 2020-07-03 11:52:07 -04:00
Ameer
6b7c8e469b Add LR triggers as axes, half press to initiate a press, add GC axis id in config, clarify some code blocks for better readability 2020-07-02 15:54:44 -04:00
Ameer
34a590e509 Reset adapter state on init, fixes errors relating driver hang from unexpected unplug 2020-07-01 12:52:50 -04:00
Ameer
a76e11e7f0 Address feedback regarding increments, const vars, and general cleanup 2020-06-30 17:28:02 -04:00
Ameer
dfdf87d844 fix implicit conversion of size_t type to int 2020-06-30 11:44:55 -04:00
Ameer J
bd697bef03
left const auto&, comment punctuation.
Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com>
2020-06-26 23:46:49 -04:00
Ameer J
ecbc813711
const& to button in button array
Co-authored-by: VolcaEM <63682805+VolcaEM@users.noreply.github.com>
2020-06-25 19:46:50 -04:00
Ameer
3f739514e3 Stop reading loop if error is encountered 2020-06-25 19:31:51 -04:00
Ameer
c18dc9c707 padbutton enum class and struct initiailization 2020-06-24 11:39:30 -04:00
Ameer
743e1f02a0 cleanup check access, read, and factory GetNextInput funcs. Use size rather than magic number 2020-06-23 17:37:15 -04:00