[Bug]: Lenovo Ideapad: Stylus buttons are not correctly recognized
What happened?
I'd love to drop Xournal++ for Butterfly but there seems to be an issue with my stylus. I am using the Lenovo Ideapad Flex and its stylus. Using the pointer test in Butterfly I can see that pressing the first button on the stylus causes "Input" to flash from 1 to 0 and back to 1. When I press the second button "Input" becomes "5 (101)".
I tried wev there I have the same behavior. But on https://thetest.com/tests/input and in Xournal++ it works perfectly.
I understand that this is not enough information for anyone to make a fix but can someone point me in the right direction of debugging this problem?
Version
2.4.0
Platform
Linux
Relevant log output
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
It should show Touch as input type? Then this should be a duplicate on #238. I'm currently working on support on windows for flutter and I'm maybe starting working on linux after that: https://github.com/flutter/flutter/pull/165323
It shows "Pen" input though. Are there maybe any logs I could share?
-------- Original Message -------- On 15/11/2025 20:03, CodeDoctor wrote:
CodeDoctorDE left a comment (LinwoodDev/Butterfly#968)
It should show Touch as input type? Then this should be a duplicate on #238. I'm currently working on support on windows for flutter and I'm maybe starting working on linux after that: flutter/flutter#165323
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Oh then this is nice. didn't know that. I'm not sure what the problem is? The input test is just an internal testing so it's not really useful for endusers but i can explain it to you. What you see is a bit mapping. The number should be read binary. If you see a 0001 (1) you have pressed the first button (on stylus it isn't useful). If you see 0010 (2) you have pressed the second button (on stylus the first button) and 0100 (4) the second one.
I just looked at my code and found out that the second button on stylus wouldn't be detected correctly, is this currently the problem on your side that you can't map the button?
This is kind of the problem. As I said pressing the first button is not recognized as a button press, but as a very quickly lifting the pen and then putting it back to the screen. The second button is recognized as a 5, and that means its drawing even when the pen not on the screen.
If I find time tomorrow on the train I can debug this further by compiling the code myself. Do you have any point where I could start?
-------- Original Message -------- On 15/11/2025 20:13, CodeDoctor wrote:
CodeDoctorDE left a comment (LinwoodDev/Butterfly#968)
Oh then this is nice. didn't know that. I'm not sure what the problem is? The input test is just an internal testing so it's not really useful for endusers but i can explain it to you. What you see is a bit mapping. The number should be read binary. If you see a 0001 (1) you have pressed the first button (on stylus it isn't useful). If you see 0010 (2) you have pressed the second button (on stylus the first button) and 0100 (4) the second one.
I just looked at my code and found out that the second button on stylus wouldn't be detected correctly, is this currently the problem on your side that you can't map the button?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Oh that's strange. On the lower level, there is the flutter engine code which gets its input from gtk but I'm not really sure how it works there.
can you please see if the latest nightly fixes the issue?
can you please see if the latest nightly fixes the issue?
I am not OP but I've got a lenovo laptop with a similar issue when it comes to the pen. My laptop didn't come with a pen but I bought the lenovo one off their website. I'm running Fedora 42, but the pen buttons work fine in Xournal++. I installed the nightly build and the first button on the pen is still unrecognized (it is physically the first button on the pen, but in software it seems to be the 3rd button as Xournal++ shows the first button as the one that draws and the button it shows as the second button is the one that is currently working in Linwood Butterfly, and the third button (the one that is not working) it just shows as eraser, but it comes 3rd in the list so its likely the third button).
I attached a screenshot of how it looks in Xournal++. And to clarify the button labeled as eraser is the one that isn't working in Linwood Butterfly. Everything else works.
And here in Linwood Butterfly it is the second button that isn't working.
Oh interesting, can you give me the button output the first button (the one that doesnt work) in the pointer test in the input settings
Oh interesting, can you give me the button output the first button (the one that doesnt work) in the pointer test in the input settings
I just tested it and pressing the button doesn't do anything in the pointer test. As in it's as if I'm not pressing the button so it just changes from 0 when not clicking to 1 when clicking the screen
Edit: The other button does work though, it changes from 2 (10) when not pressing down to 3 (11) when pressing down.
Did you pressing the button while having the pen on the screen like with the other button?
Using this tester https://thesevenpens.github.io/HtmlTabletTester/ the button that isn't working in Butterfly shows up as 32 (eraser), the pen tip shows up as 1 (pen tip), and the working button shows up as 3 (unknown)
Did you pressing the button while having the pen on the screen like with the other button?
I did and it didn't change anything
I would like to see the values inside the pointer tests in butterfly to assign these internal inputs. I think they are different. You could find it in the settings under inputs and then press the button while having the pen pressing on the rectangle. Which platform are you on? Web or Linux?
I am on linux, I am in the discord. Would it be easier to call on discord and stream this over the call? I'm not entirely sure what you mean