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

Add option to lock eraser button to the eraser #1104

Open
Klaaktu opened this issue May 25, 2024 · 7 comments · May be fixed by #1119
Open

Add option to lock eraser button to the eraser #1104

Klaaktu opened this issue May 25, 2024 · 7 comments · May be fixed by #1119
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Klaaktu
Copy link

Klaaktu commented May 25, 2024

Describe the bug
The Surface slim pen's eraser button activates the selector tool instead of eraser in Rnote while hovering above the screen.

To Reproduce
Steps to reproduce the behavior:
0. Primary side button is mapped to the selector, and secondary button is mapped to the eraser. (not sure if necessary)

  1. Write something in Rnote with the Surface slim pen.
  2. Flip the pen over, hover the eraser above the screen. See selector is activated instead.
  3. Attempt erasing. See selector is used instead.

Expected behavior
Eraser button activates the eraser tool.

Console Output
(Tried setting the env variables in Powershell, command exits, no output...)

Screenshots

Desktop (please complete the following information):

  • OS: Windows 11 23H2
  • App Version: Rnote v0.10.2
  • Installation Source: Github releases
  • Desktop Environment:
  • Display Server:
  • Input Source: On-Screen-Tablet & Windows Ink

Additional context
Secondary button doesn't seem to exist on the Surface slim pen, there is another button via eraser click, but doesn't seem to do anything, same in Xournal++.

@Doublonmousse
Copy link
Collaborator

  • the eraser can be mapped to any tools. You can hover with the eraser on the canvas then select the eraser tool in the toolbar, that will switch the eraser tool to be an eraser (same behavior as the choice of tool for the primary tip)

Maybe having the option to force/lock the eraser to always stay an eraser could be added ? I feel like that'd be a good addition when you realistically never want the eraser to be anything else on a surface pro (and others cab still change it if for any reason something is detected as an eraser when it shouldn't)

@Klaaktu
Copy link
Author

Klaaktu commented May 25, 2024

Ah yes, just realized that as well while using Rnote. Sorry I'm new to it.
The option sounds good, though I'm no expert in stylus pens (had only 1 before Surface). I suppose indeed it's just that the behavior was a bit unexpected, especially coming from Xournal++ and OneNote etc.

Secondary button doesn't seem to exist, there is another button via eraser click

Windows ink calls the button "shortcut button" and has an option to allow apps to override its behavior. At this point I think it's probably not the 2nd side button... I tired holding the button while touching the screen with the tip or the eraser (in both Rnote and Xournal++), nothing.

@flxzt
Copy link
Owner

flxzt commented May 25, 2024

I'll reuse this issue to add the feature to lock the shortcut button to the eraser

@flxzt flxzt changed the title Surface slim pen eraser button activates selector instead Add option to lock shortcut-button to the eraser May 25, 2024
@flxzt flxzt added enhancement New feature or request good first issue Good for newcomers labels May 25, 2024
@Klaaktu
Copy link
Author

Klaaktu commented May 25, 2024

Oof I see my comment was misleading, edited.
The eraser can either be rubbed against the screen (eraser, functions similarly to the pen tip) or clicked (shortcut/top button, press with finger until it clicks). I thought the secondary side button option would perhaps control either of them, since there isn't a 2nd side button on the slim pen.
I'll also edit the title a bit...

@Klaaktu Klaaktu changed the title Add option to lock shortcut-button to the eraser Add option to lock eraser button to the eraser May 25, 2024
@Doublonmousse
Copy link
Collaborator

I'll reuse this issue to add the feature to lock the shortcut button to the eraser

I don't get what you mean for this. Afaik, button shortcuts set in the settings panel are locked in place and don't change.

One of the reasons for the confusing behavior is that the pen picker doesn't check what side of the pen is used when clicking. Hence using the pen, switching to the eraser and then directly changing the tool with the pen tip will change the eraser tool instead of the pen tip and the subsequent use of the tip will use the previous pen tip tool and not the one you thought you set.

I think that having the pen picker be sensible to the pen side might be a good improvement. That way if you hover above the pen picker with the pen tip, it will switch the canvas to the pen tip and you'll select the tool for the pen. Same for the eraser.

@Doublonmousse Doublonmousse linked a pull request Jun 11, 2024 that will close this issue
1 task
@flxzt
Copy link
Owner

flxzt commented Jun 14, 2024

Tell me if I misunderstand you, but I think the current behaviour and the way Rnote implements this might be unclear:

In addition to the tools you can set in the settings panel there is also dedicated pen "modes".

There is the default "Pen" mode, but also "Eraser" (and theoretically others reported by gtk ). On some pens this Eraser mode is activated through a button press (and hold) of one of the side buttons of the pen, but on others this actually is the backside of the pen. Afaik there is no way to detect between the two.
When this mapped button is pressed it is also not possible to detect it as a button press.
So to make it work for both cases (mapped to button and backside) Rnote currently always checks whether the state has changed and remembers the current active tool.

What I meant when I wrote to "lock the shortcut button to the eraser" is to add an option to hard-lock the "Eraser" mode to the actual eraser tool of Rnote instead of the current behaviour: remembering and switch to the last active tool

@Doublonmousse
Copy link
Collaborator

Okay, that's what I understood as well (and started to implement in the draft PR).

The goal is to lock the pen mode, no matter what the mechanism on the pen to activate the different modes (reported by gtk) is.

It's probable that the behavior of some pens having their shortcut button activate the eraser mode instead of activating the first/second shortcut button might be input bugs but having this option alleviates some of the usability issues if it were the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants