Giter Club home page Giter Club logo

Comments (16)

greggersaurus avatar greggersaurus commented on July 20, 2024

It might be possible to address this, but it will take a deeper understanding of the trackpad than I currently have.

For details see https://github.com/greggersaurus/OpenSteamController/blob/master/Firmware/OpenSteamController/src/trackpad.c (specifically function trackpadGetLastXY()) to observe what the process is like for taking the data from the trackpad and converting it to X/Y positions. There are some exits in that function that occur because a finger is not detected in the vicinity of the trackpad, but I'm not sure how to fine tune this at the moment...

from opensteamcontroller.

MatthewCerza avatar MatthewCerza commented on July 20, 2024

Agreed, it's basically unusable. It's so close to being good, but the sensitivity of the right stick just kills it.

from opensteamcontroller.

2bndy5 avatar 2bndy5 commented on July 20, 2024

you could alter the firmware to implement these functions from the Cirque examples. Available options for setAdcAttenuation() are here, and Cirque recommends ADC_ATTENUATE_2X for curved overlays. Default value used at Power-On-Reset is ADC_ATTENUATE_1X.

EDIT: Ignore this, and skip to next comment

from opensteamcontroller.

2bndy5 avatar 2bndy5 commented on July 20, 2024

oops didn't realize that the firmware was using AnyMeas mode... Previous comment was concerning Relative and Absolute mode.

Try changing the second argument to the function call on this line I realize its already at the lowest gain, but you could play with these values and see if it helps. Note the term gain is synonomous with the term attenuation which means loss of signal, so a higher value might lessen the sensitivity.

I'm still working on mastering AnyMeas mode as there is literally no documentation on it from Cirque

from opensteamcontroller.

2bndy5 avatar 2bndy5 commented on July 20, 2024

I opened a topic on the cirque forums about using AnyMeas mode on the trackpads, and I promptly got a helpful response. See the last paragraph of this reply as a guideline for tweaking the configurations for AnyMeas mode. I recommend reading the whole post and possibly contributing if you think of other questions.

from opensteamcontroller.

R-Nukem avatar R-Nukem commented on July 20, 2024

Great project. I really appreciate all the work that has gone into this.

I have a potential workaround for the right pad issue, though I've been unsuccessful in building the firmware with the workaround that my switch recognizes. I have built the existing firmware successfully with no changes, but with the fairly simple change outlined below my switch no longer recognizes the controller, despite LPCXpresso showing no errors.

The basic problem is the sensitivity of the right pad. For the games I own the right analog stick is not used that frequently. I would suggest only detecting the input with a click of the pad, similar to the left pad --> d-pad functionality.

Please correct me if I am wrong in any of my understanding or execution here:
Line 1342-1347 of usb.c is the section of code that determines the function of the right pad.

// Have Right Trackpad act as Right Analog:
	trackpadGetLastXY(R_TRACKPAD, &tpad_x, &tpad_y);
	controllerUsbData.statusReport.rightAnalogX = convToPowerAJoyPos(tpad_x, 
		0, TPAD_MAX_X/2, TPAD_MAX_X);
	controllerUsbData.statusReport.rightAnalogY = convToPowerAJoyPos(
		 TPAD_MAX_Y - tpad_y, 0, TPAD_MAX_Y/2, TPAD_MAX_Y);

Line 1309 is tracking the clicking of the left pad to filter the d-pad input, with the d-pad code inside this if function

	if (getLeftTrackpadClickState()) {

        }

Using this framework it should be fairly simple to wrap the code for the right trackpad in a similar if statement to filter its input in the same way:

	if (getRightTrackpadClickState()) {
		
		trackpadGetLastXY(R_TRACKPAD, &tpad_x, &tpad_y);
		controllerUsbData.statusReport.rightAnalogX = convToPowerAJoyPos(tpad_x, 
			0, TPAD_MAX_X/2, TPAD_MAX_X);
		controllerUsbData.statusReport.rightAnalogY = convToPowerAJoyPos(
			 TPAD_MAX_Y - tpad_y, 0, TPAD_MAX_Y/2, TPAD_MAX_Y);
	}

I have been unsuccessful in making this work, however.
Just wanted to give my 2 cents, and see if anyone had a suggestion for implementing this idea.

from opensteamcontroller.

mgueji avatar mgueji commented on July 20, 2024

I would suggest only detecting the input with a click of the pad, similar to the left pad --> d-pad functionality.

I was about to suggest the same, I don't know why it's not working, I can't test it because I haven't got LPCXpresso in my computer.

PS:
Maybe something to do with line 1288?
controllerUsbData.statusReport.rightAnalogClick = getRightTrackpadClickState();

Should we use another key to work as rightAnalogClick before using it as way to enable the right trackpad?

PS2:
can someone try with getRightGripState() or getLeftGripState()? as they aren't needed in Switch anyways.

PS3:
The left grip button is used for the screenshot button if I'm not wrong but the right one should be free.

from opensteamcontroller.

gaycomputers avatar gaycomputers commented on July 20, 2024

Has anyone solved this?

from opensteamcontroller.

franchettium avatar franchettium commented on July 20, 2024

Dunno how many of you are still interested in this, but I've modified a portion of usb.c starting from line 1342:

if (getRightGripState()) {

	trackpadGetLastXY(R_TRACKPAD, &tpad_x, &tpad_y);

	controllerUsbData.statusReport.rightAnalogX = convToPowerAJoyPos(tpad_x,

			0, TPAD_MAX_X/2, TPAD_MAX_X);

		controllerUsbData.statusReport.rightAnalogY = convToPowerAJoyPos(

			 TPAD_MAX_Y - tpad_y, 0, TPAD_MAX_Y/2, TPAD_MAX_Y);

}

else{

	trackpadGetLastXY(R_TRACKPAD, &tpad_x, &tpad_y);

	controllerUsbData.statusReport.rightAnalogX = 0x80;

	controllerUsbData.statusReport.rightAnalogY = 0x80;

}

this code makes the right joystick stay neutral until the right grip gets pressed. When you press the right grip, the right touchpad starts acting again as the right joystick.
I've messed with trackpad.c for a couple hours trying to reduce the trackpad's sensitivity to no avail.

from opensteamcontroller.

marxjohnson avatar marxjohnson commented on July 20, 2024

I've succeeded in building modified firmware in 2 configurations: one that activates the right pad when the right grip is held, the other that activates it when the right pad is pressed, and re-maps the right grip to provide the "right stick click" input. I've attached them here in case other people find them useful.

I also tried tweaking the suggested parameters from the cirque forums thread to lower the sensitivity, but it didn't make a noticeable difference, so maybe something else is required.

OpenSteamController_RightGripToggle.bin.zip
OpenSteamController_RightPadToggle.bin.zip

from opensteamcontroller.

2bndy5 avatar 2bndy5 commented on July 20, 2024

I also tried tweaking the suggested parameters to lower the sensitivity, but it didn't make a noticeable difference, so maybe something else is required.

Thanks for reporting this. AnyMeas mode on these trackpads is rather undocumented. Any other tweaking might involve real-time calibration (which uses a matrix of 48-uint16_t data - IIRC)...

from opensteamcontroller.

arxanas avatar arxanas commented on July 20, 2024

I got a reasonable solution in #32. Tap detection itself seems to work fine in my testing in Smash Bros.

However, even without my patch, using trackpad monitor on my dev firmware build seems to indicate significant dead zones for my controller. Here's the actual ranges of values I can seem to produce:

Left X Left Y Right X Right Y
Min ~160 <0 ~170 <0
Max ~1150 >650 ~1170 >650

So I can't press the trackpad to the extremes of the x-axis (not too relevant for actual use), and there are dead zones on the extremes of the y-axis. Actually, I think there are small dead zones on the x-axis as well, and they just don't register as values <150 or >1150.

In practice, this means that thumb movements need to be restrained to the center of the trackpads to get high degrees of accuracy for competitive play. This is less important for the right trackpad (the tilt/smash stick), but very important for the left trackpad (which I've set to be the left analog stick, instead of using the left joystick — the D-pad is mostly useless for Smash).

from opensteamcontroller.

2bndy5 avatar 2bndy5 commented on July 20, 2024

@arxanas You may need to compensate your z-axis calc for the curved overlay on the trackpad. Also, the datasheet recommends clamping the X/Y axes (for reliability) to

  • 64 ≤ y ≤ 1472 (from 0 ≤ Y ≤ 1535)
  • 128 ≤ x ≤ 1920 (from 0 ≤ X ≤ 2047)

Hope that helps.

EDIT: The above ranges are for the trackpad's Absolute Mode. Obviously this is different for AnyMeas mode, but you get the idea.

from opensteamcontroller.

mgueji avatar mgueji commented on July 20, 2024

I got a reasonable solution in #32. Tap detection itself seems to work fine in my testing in Smash Bros.

However, even without my patch, using trackpad monitor on my dev firmware build seems to indicate significant dead zones for my controller. Here's the actual ranges of values I can seem to produce:
Left X Left Y Right X Right Y
Min ~160 <0 ~170 <0
Max ~1150 >650 ~1170 >650

So I can't press the trackpad to the extremes of the x-axis (not too relevant for actual use), and there are dead zones on the extremes of the y-axis. Actually, I think there are small dead zones on the x-axis as well, and they just don't register as values <150 or >1150.

In practice, this means that thumb movements need to be restrained to the center of the trackpads to get high degrees of accuracy for competitive play. This is less important for the right trackpad (the tilt/smash stick), but very important for the left trackpad (which I've set to be the left analog stick, instead of using the left joystick — the D-pad is mostly useless for Smash).

Hi, do you mind to share the binary for this if you still have it?

from opensteamcontroller.

arxanas avatar arxanas commented on July 20, 2024

@mgueji unfortunately, I do not have the binary on hand, and even if I did, I applied several other customizations which would make it likely unusable for you. You can view and download the source code at https://github.com/arxanas/OpenSteamController/tree/pro-trackpad and build it use the instructions at https://github.com/greggersaurus/OpenSteamController/tree/master/Firmware#building

from opensteamcontroller.

arxanas avatar arxanas commented on July 20, 2024

@mgueji I posted my builds at #32 (comment).

from opensteamcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.