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

Stylus support: pressure & buttons #90

Closed
comcloudway opened this issue Nov 29, 2022 · 14 comments
Closed

Stylus support: pressure & buttons #90

comcloudway opened this issue Nov 29, 2022 · 14 comments
Labels
bug Something isn't working external The issue needs to be fixed by another project

Comments

@comcloudway
Copy link
Contributor

comcloudway commented Nov 29, 2022

I own a Dell 2-in-1 Laptop, running Alpine Linux (Gnome 43) and installed Saber as a flatpak.

When I disable Finger drawing I'm no longer able to use either mouse or pen,
but with it enabled, both my pen and the touchscreen are being recognized.

Maybe adding a Pen mode, which only detects input from Wacom/Microsoft Pen Protocol pens.
Additionally, handling the pen button events (eraser) might be a good idea.

EDIT: Input pens also provide pressure data

@adil192
Copy link
Member

adil192 commented Nov 29, 2022

Hi, This functionality is already implemented (when finger drawing is disabled, you can still draw with a stylus). Your stylus+Linux is probably not supported with Flutter: I've also got a Dell 2-in-1 and mine is just detected as a finger rather than a stylus too.

@comcloudway
Copy link
Contributor Author

comcloudway commented Nov 29, 2022

Oh sorry – I'll try it with sway(wayland) and awesome(Xorg) maybe it is just not working o
in Gnome

@comcloudway
Copy link
Contributor Author

I think I also did a bad job formulating the issue,
my stylus works (I can draw lines).

But the eraser (both buttons) do not work (I don't necessarily care about pressure sensitivity).

Additionally, when placing down my hand on the touchscreen before it detects the stylus, it draws a line,
connecting my hand with the point of the stylus was detected.
But after the stylus has been detected, it properly disables touch input 👍

@comcloudway comcloudway changed the title Differentiate between mouse & input pen Stylus support: pressure & buttons Nov 29, 2022
@adil192
Copy link
Member

adil192 commented Nov 29, 2022

Unfortunately your laptop is telling Saber that your stylus is a finger, so I can't do much about it.

But after the stylus has been detected, it properly disables touch input +1

That's probably just hardware palm rejection.

@adil192 adil192 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 29, 2022
@comcloudway
Copy link
Contributor Author

comcloudway commented Jan 16, 2023

I haven't checked your code (the pubspec.yml shows a lot of dependencies, but I don't know what they are used for), but are you using a library to get the events?
Because if so, I might file an issue upstream, because both krita and xournalpp have no problem getting pressure readings.

@adil192
Copy link
Member

adil192 commented Jan 16, 2023

I haven't checked your code (the pubspec.yml shows a lot of dependencies, but I don't know what they are used for), but are you using a library to get the events? Because if so, I might file an issue upstream, because both krita and xournalpp have no problem getting pressure readings.

I'm just using a regular Listener widget. But I might have an idea now that could help with this

@adil192
Copy link
Member

adil192 commented Jan 16, 2023

If that patch works, you may still want to open an issue with flutter regarding styluses not being detected as a PointerDeviceKind.stylus
https://github.com/adil192/saber/blob/290387b8d78b51749aded242f23d526f83f28dfb/lib/components/canvas/canvas_gesture_detector.dart#L104-L112

@adil192
Copy link
Member

adil192 commented Jan 16, 2023

Please try out Linux Build #209

@comcloudway
Copy link
Contributor Author

comcloudway commented Jan 16, 2023

I'm not sure if I installed it correctly (I did not uninstall the flatpak flathub beforehand):

  1. unzip the artifact
  2. flatpak install ./Saber.flatpak
  3. flatpak run com.adilhanney.saber

But it doesn't work.
Either way, I'm only able to use my stylus when the finger drawing feature is enabled.

@comcloudway
Copy link
Contributor Author

I have a question: Which protocol is your 2in1 laptop/pen using?
Mine is using MPP (Microsoft Pen Protocol or Windows Pen Protocol - known under both names)

Also, I'm running the flatpak under wayland.

Maybe this might be the same problem as seen on
LinwoodDev/Butterfly#238.
And thus related to flutter/flutter#63209.

I'm not sure, but maybe flutter/engine#38902 might solve this

@comcloudway
Copy link
Contributor Author

comcloudway commented Jan 17, 2023

I just installed the xournal flatpak and pressure sensitivity is working properly.

So I'll probably have to file a flutter bug-report

@adil192
Copy link
Member

adil192 commented Jan 17, 2023

I have a question: Which protocol is your 2in1 laptop/pen using?
Mine is using MPP (Microsoft Pen Protocol or Windows Pen Protocol - known under both names)

Mine also uses MPP

I just installed the xournal flatpak and pressure sensitivity is working properly.

So I'll probably have to file a flutter bug-report

I don't believe Xournal uses flutter so it's probably best not to duplicate the issues you mentioned

@comcloudway
Copy link
Contributor Author

I don't believe Xournal uses flutter so it's probably best not to duplicate the issues you mentioned

What I meant was that maybe Flatpak under Wayland doesn't send the correct stylus events (In that case, filing a bug report for flatpak would have made more sense)

@adil192 adil192 added bug Something isn't working external The issue needs to be fixed by another project labels Jan 17, 2023
@comcloudway
Copy link
Contributor Author

comcloudway commented Jan 21, 2023

Update: I just installed Waydroid and inside of it I installed Saber via F-Droid, to see if my stylus works.
And indeed my stylus works properly, and I'm able to write without having the finger-draw feature enabled. Even pressure-sensitivity is working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external The issue needs to be fixed by another project
Projects
None yet
Development

No branches or pull requests

2 participants