Repository: flxzt/rnote (language: rust)

Issue:
Set pen action button to "none"
**Please submit only one feature request in one issue!**  
I think can be useful if you can set the pen buttons action to none
![image](https://github.com/flxzt/rnote/assets/52716952/d76235bd-5d27-4aae-9195-a88bb21500e2)
how you can see you can't disable the input pen action.

**Is your feature request related to a problem? Please describe.**  
Yes, but not a rnote problem, i use a surface pro 8, with linux, however the driver for the pen is not completed (not working really well) and touching the back of the pen is equals to press a pen button, I think it could be useful for problem pens like this one.
  
**Describe the solution you'd like**  
Add a button "no action" or something like that, that just disable any action

**Additional context**  
I know it's not an rnote issue, but I think it could still be a useful function for many (certainly me 😆)



Discussion / hints:
I feel like this would work better if the "none" button was added to the menu on the right (temporary/toggle/permanent options)
> I feel like this would work better if the "none" button was added to the menu on the right (temporary/toggle/permanent options)

Mhm, i don't know, because the menu on the right refers to the "mode" of the tool you are using, the menu in the photo refers to the tool you are actually using, so maybe is more login select the tool to "none" and not the mode option. 

I mean "disabled" for the menu on the right. I agree that "none" would work if it was added to the tool menu instead 

![image](https://github.com/flxzt/rnote/assets/115779707/58ec734d-3b45-4ec7-903d-0c9e4a3a6452)

I'm not sure it will completely fix the issue on your surface though (because if the only event that is triggered is a pen button, this will ignore it and nothing other than that will happen). I do have the exact same device so I can test things on linux as well if needed, I don't recall having this particular issue on the linux-surface drivers.

Fix patch:
diff --git a/crates/rnote-engine/src/pens/penholder.rs b/crates/rnote-engine/src/pens/penholder.rs
index 5bace7187f..66952fbe25 100644
--- a/crates/rnote-engine/src/pens/penholder.rs
+++ b/crates/rnote-engine/src/pens/penholder.rs
@@ -299,6 +299,7 @@ impl PenHolder {
                             widget_flags |= self.change_style_int(style, engine_view);
                         }
                     }
+                    ShortcutMode::Disabled => {}
                 },
             }
 
diff --git a/crates/rnote-engine/src/pens/shortcuts.rs b/crates/rnote-engine/src/pens/shortcuts.rs
index d6e5a9e19c..ab17304439 100644
--- a/crates/rnote-engine/src/pens/shortcuts.rs
+++ b/crates/rnote-engine/src/pens/shortcuts.rs
@@ -25,6 +25,8 @@ pub enum ShortcutMode {
     Permanent,
     #[serde(rename = "toggle")]
     Toggle,
+    #[serde(rename = "disabled")]
+    Disabled,
 }
 
 impl TryFrom<u32> for ShortcutMode {
diff --git a/crates/rnote-ui/data/ui/penshortcutrow.ui b/crates/rnote-ui/data/ui/penshortcutrow.ui
index dd22166bc0..a1401b85f1 100644
--- a/crates/rnote-ui/data/ui/penshortcutrow.ui
+++ b/crates/rnote-ui/data/ui/penshortcutrow.ui
@@ -11,6 +11,7 @@
               <item translatable="yes">Temporary</item>
               <item translatable="yes">Permanent</item>
               <item translatable="yes">Toggle</item>
+              <item translatable="yes">Disabled</item>
             </items>
           </object>
         </property>


Test patch: