Commit graph

228 commits

Author SHA1 Message Date
Jun Wu
5dd969da05 Read Joycon inputs in a non-blocking way
This makes sure ReceiveRaw() won't block forever, so Poll() has chance
to SendRumble().

Practically, it seems the Joycons frequently send inputs so it's not
necessary, at least for the bluetooth version I got.
2019-02-02 01:36:28 -08:00
Jun Wu
85f77cb91c SendRumble less frequently to reduce input lag
I was using two Joycons as a single controller. One (often right, sometimes
both, sometimes left) of the Joycons seems to have random lags.
This patch reliably removes the lag for me.

Potentially fixes #32.

More context:

I first excluded the possibility that the Bluetooth connection is lagging,
because when I click the "locate" button, both Joycons can rumble
immediately without lag.

Reading the existing issues seems to suggest something was wrong with
threading. When I tried moving both Joycons' "Poll" to a single thread,
by calling both ReceiveRaw() and other.ReceiveRaw() in a single Joycon
Poll thread, and removing "lock { ...}"s), lag still exists.

I then suspected the I/O loop is too busy so the code does not have time
to consume events in time. By adding some debug prints, I was able to
confirm that at the time the code receives an event (after hid_read),
it was already too late. However, it is strange that a) hid_read almost
always returns immediately, b) a single "poll" still takes a few
milliseconds. Finally, I found "SendRumble" is the culprit causing
the majority of the few milliseconds delay. Therefore the patch.

The 5 seconds is not a scientific choice. It works for me. I don't have
a USB controller to test it right now.
2019-02-02 01:31:17 -08:00
David Khachaturov
edd72be31a
Update README.md 2019-01-31 10:56:18 +00:00
David Khachaturov
3f2e82e9ba
Update README.md 2019-01-27 13:42:26 +00:00
David Khachaturov
665a76bb94 Merge branch 'master' of https://github.com/Davidobot/BetterJoyForCemu 2019-01-24 18:29:22 +00:00
David Khachaturov
a451fa94fc Added battery indicator in the form of a background colour (Green->Orange->Red->Dark Red->Black) and in UdpServer info.
Improved stick calculations. Thanks eWaster.
2019-01-24 18:28:49 +00:00
David Khachaturov
c4e4794020
Update README.md 2019-01-19 15:36:34 +00:00
David Khachaturov
920a2a049d Added PurgeAffectedDevices option. 2019-01-19 14:47:08 +00:00
David Khachaturov
4fbc316371
Merge pull request #95 from marco-calautti/master
Add option to start the application minimized to tray; add a proper nuget dependency for ViGEmClient
2019-01-13 13:35:15 +00:00
Marco Calautti
fa194be3cc Fixed bracket style. 2019-01-12 12:02:39 +00:00
Marco Calautti
72fccace33 Add option from starting the application minimized to tray. Alsso added proper nuget dependency for ViGEmClient. 2019-01-12 12:00:15 +00:00
David Khachaturov
7fcfa1f383
Merge pull request #90 from brakhane/gyro-drift
prevent gyro drift on some controllers
2019-01-06 16:50:27 +01:00
unknown
95a35e39bd prevent gyro drift on some controllers
On some original Nintendo controllers gyro drift occurs (moves
constantly to the right, for example).

Not dividing the neutral point by 2 seems to fix the problem, and
it doesn't seem to effect other controllers negatively (tested
with 8bitDo N30 pro and SF30 Pro).
2019-01-05 22:52:09 +01:00
David Khachaturov
9a678b6fac
Update README.md
More problem solutions.
2018-09-06 16:32:22 +02:00
David Khachaturov
01d5a91ba9
Update README.md 2018-09-05 11:35:45 +02:00
David Khachaturov
2c19d9c837
Update README.md
Added solution to common problem of controllers not being recognised after using program.
2018-09-05 11:35:22 +02:00
David Khachaturov
2fc34799ce
Update README.md
Changed forgotten defaults.
2018-09-04 11:17:23 +02:00
David Khachaturov
af21ac1cfe
Update README.md 2018-08-23 16:57:48 +03:00
David Khachaturov
68b6928d86 Fixed gyro in single joycon mode.
Added tooltip on button.
2018-08-23 16:36:55 +03:00
David Khachaturov
37aba95e81 Added ability to toggle for single/double joycon mode.
Reworked UI further.
Final commit for v5.
2018-08-23 15:48:19 +03:00
David Khachaturov
be3c73bc96 Reworked UI.
Improved USB support.
Improved rumble.

(all in all, the program is becoming actually nice to use)
2018-08-22 12:52:41 +03:00
David Khachaturov
64946ed444 Implemented Progressive Scan. (can leave program running and (dis)connect controllers whenever)
Fixed controllers timing out randomly.
2018-08-18 20:52:34 +03:00
David Khachaturov
82fbf36796 Added new configuration manager.
More misc changes.
2018-08-18 14:21:20 +03:00
David Khachaturov
96e3da735d Merge branch 'master' of https://github.com/Davidobot/BetterJoyForCemu 2018-08-14 10:42:16 +03:00
David Khachaturov
9509e44ae3 Fixed Pro Controller timing out on USB mode due to new rumble implementation.
Fixed Pro Controller sticks. (broken due to single joycon mode)

Finally made program close correctly every time / start correctly every time.
2018-08-14 10:42:00 +03:00
David Khachaturov
4b3205af2d
Update README.md
Update on v5 and donation link.
2018-08-11 08:59:40 +07:00
David Khachaturov
c296b5cf2e Added options to turn off HidGuardian and XInput emulation 2018-07-27 09:54:08 +03:00
David Khachaturov
00e51bc4d1 Added single joycon mode. (v5 progress) 2018-07-16 22:03:51 +03:00
David Khachaturov
e8ba346245
Update README.md
Added calibration advice
2018-05-12 10:07:44 +01:00
David Khachaturov
8549cb6acb
Update README.md 2018-05-04 09:02:42 +01:00
David Khachaturov
42b3e1172e
Version 4 README 2018-05-02 19:11:32 +01:00
David Khachaturov
02b55f6a35 Merge branch 'master' of https://github.com/Davidobot/BetterJoyForCemu 2018-05-02 18:58:18 +01:00
David Khachaturov
db90d8357b Version 4 - Added HidGuardian support and implemented a GUI 2018-05-02 18:57:47 +01:00
David Khachaturov
d3b9feae60
Merge pull request #24 from Davidobot/add-license-1
Create LICENSE
2018-05-01 19:40:47 +01:00
David Khachaturov
864141b7ca
Create LICENSE 2018-05-01 19:40:27 +01:00
David Khachaturov
49824ab2f2
Update README.md 2018-04-19 18:49:34 +01:00
David Khachaturov
57473a2f0d
Update README.md 2018-03-20 16:24:43 +00:00
David Khachaturov
32aca0aed9 Merge branch 'master' of https://github.com/Davidobot/BetterJoyForCemu 2018-03-20 16:17:14 +00:00
David Khachaturov
a0bc1eaafc Fixed swapping buttons not working on Joycons 2018-03-20 16:16:47 +00:00
David Khachaturov
5b1916d910
Update README.md 2018-03-17 08:51:50 +00:00
David Khachaturov
02953a321f
Update README.md 2018-03-17 08:51:41 +00:00
David Khachaturov
476fb6362b Merge branch 'master' of https://github.com/Davidobot/BetterJoyForCemu 2018-03-17 08:38:34 +00:00
David Khachaturov
31618200fc - Added a few more app settings.
- CemuHook correctly sees type of connection
2018-03-17 08:38:24 +00:00
David Khachaturov
64b332a27a
Update README.md 2018-03-16 22:58:03 +00:00
David Khachaturov
9fbb7e894b
Update README.md 2018-03-16 07:54:18 +00:00
David Khachaturov
5a0e4eaae1
Update README.md 2018-03-15 17:38:26 +00:00
David Khachaturov
5bdf859fe2 Merge branch 'master' of https://github.com/Davidobot/BetterJoyForCemu 2018-03-15 17:15:18 +00:00
David Khachaturov
854aa02c2f Added XInput Support using ViGEm.
- Rumble support
 - Ability to rebind keys
 - No longer need to use "Also use for axes/buttons"
 - System-wide compatability (use your joycons with Steam, or something)
 - Requires ViGEm driver (provided in release)
2018-03-15 17:14:54 +00:00
David Khachaturov
060dca7d48
Update README.md 2018-03-14 21:44:15 +00:00
David Khachaturov
90139b3aa4 Merge branch 'master' of https://github.com/Davidobot/BetterJoyForCemu 2018-03-14 21:43:08 +00:00