Skip to content

Added separate actions for button down and up events#23

Open
jnkb wants to merge 2 commits intoMartenfur:developfrom
jnkb:feature/separate-button-up-down-actions
Open

Added separate actions for button down and up events#23
jnkb wants to merge 2 commits intoMartenfur:developfrom
jnkb:feature/separate-button-up-down-actions

Conversation

@jnkb
Copy link

@jnkb jnkb commented Apr 15, 2022

  • added new Button properties ActionRelease & ActionsRelease
  • if action_release/actions_release are not specified everything is as before
  • if set, "action" is invoked on pointer down and "action_release" on pointer up

(No idea why the diff here is messed up by tabs ... e.g. in UiFactory.cs I only made changes starting at line 265....)

@Martenfur
Copy link
Owner

It's fucked up because you used spaces instead of tabs. Switch to tabs and format everything properly I'm not gonna merge it like that.

@Martenfur
Copy link
Owner

What's the point of this feature anyway? If, for example, the shift is pressed only when the button is pressed, you can't do anything else. For continious pressing toggle buttons exist.

@jnkb
Copy link
Author

jnkb commented Apr 15, 2022

It only makes sense if you use it together with a stylus.
In Leonardo for example you can switch to blur/smudge while holding ctrl+alt.

This button here is working on my surface:
(holding the button while drawing/bluring with the pen)

blur:
    action: hold ctrl+alt
    action_release: release ctrl+alt
    size: 4,4
    style: outlined
    icon: blur
    text: blur / smudge (without changing brush)

Regarding indentation, if the visual studio default settings are not used, an .editorconfig file would be useful.
Then something like this doesn't happen - I have added one in the corrected pull request :)

@lpslp
Copy link

lpslp commented Apr 25, 2022

jnkb
very nice tip about "holding the button while drawing"
sadly this is not mentioned in documentation...

@ibrahimahmad-id
Copy link

Agree with @jnkb , press & hold function is essential especially for tablet devices with touch + pen/stylus.

In my case I need a button that works like a normal Ctrl on keyboard that can be press & hold. In file explorer and most graphic & audio software, holding Ctrl then right click enables select/deselect multiple things.

At the moment "toggle" works, but "press & hold" would be better to mimic normal keyboard and even drawing tablet like Wacom that have press & hold function by default.

I hope @Martenfur would merge it soon, I'm making layouts for Affinity, Ableton & Quickbooks that will use press & hold function and will share it here once the commits applied to the official release.

@Corgi
Copy link

Corgi commented Jun 22, 2024

Wanted to add my +1 for this feature! This would make TabletFriend indispensable to my workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants