Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MPP v2+, Slim Pen 2, Surface Pro 9 improvements #156
MPP v2+, Slim Pen 2, Surface Pro 9 improvements #156
Changes from 7 commits
1202ab8
b844a07
c80f1f5
c8cfcec
b4b466a
3fad801
1f8d6bf
772fbaf
9aee2cd
b4ef3bd
1623671
5f399fe
2d49ff7
4895549
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From your notes I gather that this can't be used with MPP v1 pens because it contains garbage?
Is there any way to detect if the data inside is usable, and adjust the behaviour of the DFT parser accordingly? Dropping the need for a config option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yeah, I'm not a fan of it either, because it means you can't use a mpp v1 pen without changing the config.
It may actually be possible... if a v1 pen is present, the magnitudes for the
0x0a
frame are very small (100s). So what we could do I guess is check if the signal in the0x0a
frame is above a threshold (50000); if so, it trumps the button detection from the button frame.Let me do a bit more exploration around this to see if I can make it work without explicit configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I think this is possible, we can use a
std::optional<bool>
to specify whether the v2 signal has been detected.I do think it is a good idea to allow different minimum magnitudes for the v2 button vs the v1 button detection though, the scales are completely different;
If we use the same threshold, I can only detect my
m1
pen's button when it is super close to the screen.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this is now implemented under 772fbaf.
I'll need to give it a bit more thorough testing, but from the data I see no reason why this shouldn't work. And brief tests with all four pens show that this works, it does allow me to just switch between the SP, M1, M2 and CN pens without any problems in regards to button detection.
Great idea to just detect this, I did add different magnitude detection for the v2 signals to the configuration, because they do have a very different amplitude from the v1 button signal, but that's still a lot better than having to set a boolean.