JoyCon-Driver icon indicating copy to clipboard operation
JoyCon-Driver copied to clipboard

Suggestion : Remap gyro controls for separated joycons

Open DevilBlackDeath opened this issue 5 years ago • 1 comments

I was going to do it myself, but somehow the source available on github doesn't compile (I even tried to download boost from scratch since some files were missing, I made sure to try building the Release/x86 version, I ended up with an error on an obj file =/).

My suggestion is to make the binding for gyro controls on separated joycons mode different. A lot of softwares like FreePie or AHK won't read the Slider and Dial axises, preventing customization with gyron controls in these softwares. Since at least 3 of the normal axises (I believe it's Z, X rot and Y rot) are not used when joycons are not combined, it would be nice to bind gyro controls to these, allowing custom behaviour for those (like swing detection or that kind of stuff, for ANY game ;) )

If anyone knows what I'm doing wrong for building, I can do it myself, and won't mind any feature as I will be able to program them in myself !

DevilBlackDeath avatar Sep 10 '18 08:09 DevilBlackDeath

My own supposed fix was to replace, at line 820, this block :

	if (settings.dolphinPointerMode) {
			iReport.wAxisZRot += (jc->gyro.roll * mult);
			iReport.wSlider += (jc->gyro.pitch * mult);
			iReport.wDial += (jc->gyro.yaw * mult);

			iReport.wAxisZRot = clamp(iReport.wAxisZRot, 0, 32678);
			iReport.wSlider = clamp(iReport.wSlider, 0, 32678);
			iReport.wDial = clamp(iReport.wDial, 0, 32678);
		} else {
			iReport.wAxisZRot = 16384 + (jc->gyro.roll * mult);
			iReport.wSlider = 16384 + (jc->gyro.pitch * mult);
			iReport.wDial = 16384 + (jc->gyro.yaw * mult);
		}

by this :

	if (settings.dolphinPointerMode) {
			iReport.wAxisZRot += (jc->gyro.roll * mult);
			iReport.wSlider += (jc->gyro.pitch * mult);
			iReport.wDial += (jc->gyro.yaw * mult);

			iReport.wAxisZRot = clamp(iReport.wAxisZRot, 0, 32678);
			iReport.wSlider = clamp(iReport.wSlider, 0, 32678);
			iReport.wDial = clamp(iReport.wDial, 0, 32678);
		} else {
			if (settings.combineJoyCons) {
				iReport.wAxisZRot = 16384 + (jc->gyro.roll * mult);
				iReport.wSlider = 16384 + (jc->gyro.pitch * mult);
				iReport.wDial = 16384 + (jc->gyro.yaw * mult);
			}
			else {
				iReport.wAxisZ = 16384 + (jc->gyro.roll * mult);
				iReport.wAxisXRot = 16384 + (jc->gyro.pitch * mult);
				iReport.wAxisYRot = 16384 + (jc->gyro.yaw * mult);
			}
		}

I included it in the else of Dolphin mode, since this is a pretty much useless feature in Dolphin mode anyway ;)

DevilBlackDeath avatar Sep 10 '18 08:09 DevilBlackDeath