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

Pen movement on canvas area not working #303

Open
Zacrain opened this issue Sep 15, 2024 · 12 comments
Open

Pen movement on canvas area not working #303

Zacrain opened this issue Sep 15, 2024 · 12 comments
Labels
bug Something isn't working confirmed godot Engine-level issue/bug platform:windows

Comments

@Zacrain
Copy link
Contributor

Zacrain commented Sep 15, 2024

Lorien version:
Current main branch. Commit hash: 0bd6fff

OS/device including version:
Windows 10
Wacom Intuos BT M CTL-6100WL, Driver version: 6.4.7-3

Issue description:
The movement of the graphic tablet's pen is not reflected on the canvas. I can draw a point where the cursor is currently at, but I can't move it with the pen. There are no issues with my mouse though. Clicking buttons like selecting tools works using the pen as long as I moved the cursor into the top bar before with my mouse (or with the pen if I moved it out of the window and move it back again).

Steps to reproduce:

  • Connect the graphic tablet.
  • Run Lorien (either as release build or debug through Godot, doesn't matter).
  • Move cursor on the canvas using the mouse.
  • Try to move the cursor using the pen now.

Further Observations:
The positional information is correctly received at all times when using the pen. I've tested this by simply adding a print at _process_event(...) in InfiniteCanvas.gd:

func _process_event(event: InputEvent) -> void:
	if event is InputEventMouseMotion:
		print("Mouse position at: ", event.position)
		info.current_pressure = event.pressure
                #...

However, there seems to be a problem with the tool's cursor on the canvas in some way which leads to it not being updated correctly when using a pen. Which I find curious as pen movements are usually handled simply as mouse movements in Godot, if I'm not mistaken. Therefore I wonder whether there is something specific to the project which is causing this issue.

Recognition of applied pressure seems to be working.

@Zacrain Zacrain added the bug Something isn't working label Sep 15, 2024
@Zacrain
Copy link
Contributor Author

Zacrain commented Sep 15, 2024

This seems to be an issue related to how Godot 4.x processes pen inputs. As a workaround it was suggested to switch from absolute to relative positioning in the graphic tablet's driver settings. Godot currently does not seem to be able to process absolute positioning of pens sufficiently.

See:
godotengine/godot#76451
godotengine/godot#75903

So in my Wacom tablet settings setting to "mouse mode" fixed this for now:
image

However, the pen works in pen mode (absolute positioning) completely fine in Lorien's toolbar. Just not on the canvas. 🤔

Update:
When switching to mouse mode (relative positioning) pen pressure doesn't work anymore, meaning it becomes constant. Using pen mode but deactivating "Windows Ink" surprisingly also allevieates the movement issue but then the pen pressure is constant as well.

@mbrlabs
Copy link
Owner

mbrlabs commented Sep 18, 2024

That's odd, thanks for the report! Does this only happen on the latest main branch? Did you test this with v0.6.0 as well?

I'm on Linux and here both absolute and relative positioning work fine with Wacoms.

@mbrlabs mbrlabs added platform:windows godot Engine-level issue/bug needs testing Unable to reproduce the issue. Might be platform/hardware/godot related labels Sep 18, 2024
@mzpsh
Copy link

mzpsh commented Sep 19, 2024

Confirming this on windows with huion h420 with latest build from https://github.com/mbrlabs/Lorien/actions/runs/10863437411.

@Zacrain
Copy link
Contributor Author

Zacrain commented Sep 20, 2024

That's odd, thanks for the report! Does this only happen on the latest main branch? Did you test this with v0.6.0 as well?

I'm on Linux and here both absolute and relative positioning work fine with Wacoms.

It doesn't happen on v0.6.0, which suggests that it might indeed be a problem stemming from Godot 4.x.

@mbrlabs
Copy link
Owner

mbrlabs commented Sep 20, 2024

Alright, can confirm as well on my old Windows 10 box. I'll look into it!

@mbrlabs mbrlabs removed the needs testing Unable to reproduce the issue. Might be platform/hardware/godot related label Sep 20, 2024
@mbrlabs
Copy link
Owner

mbrlabs commented Sep 22, 2024

I think i fixed it or at least found a workaround. When changing the Windows tablet driver (in Godot's advanced project settings: Input Devices -> Pen Tablet -> Driver) to wintab it works. The default is winink.

If this works for you as well we should make it the default for Windows and provide an option in the settings to switch between all available drivers.

CI builds for testing: https://github.com/mbrlabs/Lorien/actions/runs/10983725293

@mzpsh
Copy link

mzpsh commented Sep 23, 2024

I think i fixed it or at least found a workaround. When changing the Windows tablet driver (in Godot's advanced project settings: Input Devices -> Pen Tablet -> Driver) to wintab it works. The default is winink.

If this works for you as well we should make it the default for Windows and provide an option in the settings to switch between all available drivers.

CI builds for testing: https://github.com/mbrlabs/Lorien/actions/runs/10983725293

It still doesnt work on me with the latest build. FYI the pressure works, just like before.
Perhaps Godot's problem?

@mbrlabs
Copy link
Owner

mbrlabs commented Sep 23, 2024

@mzpsh Did you try the CI build from the PR? I did not merge this yet into the main branch.

@mzpsh
Copy link

mzpsh commented Sep 24, 2024

@mbrlabs Yes, I did try the build from the CI. Also tried that tablet_driver branch on godot, and tried to tweak tablet driver and emulate mouse from touch/touch from mouse, still no luck.

@mbrlabs
Copy link
Owner

mbrlabs commented Sep 24, 2024

Ok, thank you for testing! At least it seems to work for Wacoms now so i'm merging the PR and hope it also works for @Zacrain.

Huion tablets like yours might need a different treatment...or a fix in Godot itself. By the way: are you on Windows 10 or 11?

@mzpsh
Copy link

mzpsh commented Sep 24, 2024

Windows 10 19044, ltsc 2021.
Yes, I think I'll open a new issue on huion tablet, either here or on godot.

@mbrlabs
Copy link
Owner

mbrlabs commented Sep 27, 2024

@mzpsh ok, so i got a Huion 420X to test this. I installed the latest drivers (v15.7.6.1314) on Windows 10 and for me the wintab driver in the Lorien settings works fine right out of the box. winink has the same issue as Wacom.

Maybe your Huion driver is outdated or your device is not supported anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed godot Engine-level issue/bug platform:windows
Projects
None yet
Development

No branches or pull requests

3 participants