Skip to content
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

Touch events - Screen coordinates always return (0,0) #7

Open
jorgedevs opened this issue Aug 2, 2024 · 2 comments
Open

Touch events - Screen coordinates always return (0,0) #7

jorgedevs opened this issue Aug 2, 2024 · 2 comments

Comments

@jorgedevs
Copy link
Collaborator

Setting up the TouchDown event and print the screen coordinates always return 0:

public class MeadowApp : YoshiPiApp
{
    public override Task Initialize()
    {
        Resolver.Log.Info("Initialize...");

        Hardware.Touchscreen.TouchDown += (s, e) =>
        {
            Resolver.Log.Info($"Screen: ({e.ScreenX}, {e.ScreenY}) | Raw: ({e.RawX}, {e.RawY})");
        };

        return Task.CompletedTask;
    }

    public override async Task Run()
    {
        Resolver.Log.Info("Run...");

        await Task.CompletedTask;
    }
}

output:

[application] Run...
[application] Screen: (0, 0) | Raw: (2560, 2048)
[application] Screen: (0, 0) | Raw: (2304, 2048)
[application] Screen: (0, 0) | Raw: (2079, 2560)
[application] Screen: (0, 0) | Raw: (799, 3072)
[application] Screen: (0, 0) | Raw: (3072, 3072)
[application] Screen: (0, 0) | Raw: (2048, 2304)
[application] Screen: (0, 0) | Raw: (799, 1792)
[application] Screen: (0, 0) | Raw: (2560, 2576)
[application] Screen: (0, 0) | Raw: (3072, 3072)
@jorgedevs
Copy link
Collaborator Author

oh, now that I think of it. I need to calibrate the screen first, am i right?

@jorgedevs
Copy link
Collaborator Author

hm never mind, I still get (0,0) after calibrating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant