Aylur / ags

A customizable and extensible shell
GNU General Public License v3.0
1.75k stars 94 forks source link

add properties for back/forward mouse buttons to button and eventbox #346

Open end-4 opened 3 months ago

end-4 commented 3 months ago

For mice with side buttons

Aylur commented 3 months ago

I am kind of hesitant to add this, this makes sense based on the pattern I followed, but maybe we should make on_clicked the only property and make it more generic?

end-4 commented 3 months ago

I guess. Someone in discord told me about mice with 12 side buttons lol Though no one likes breaking changes...

NicolaiVdS commented 3 months ago

What imo would make sense is adding a on-middle-click and on-middle-click-release

end-4 commented 3 months ago

What imo would make sense is adding a on-middle-click and on-middle-click-release

what https://aylur.github.io/ags-docs/config/widgets/#button

NicolaiVdS commented 3 months ago

What imo would make sense is adding a on-middle-click and on-middle-click-release

what https://aylur.github.io/ags-docs/config/widgets/#button

ok nevermind looked over it

end-4 commented 3 months ago

maybe we should make on_clicked the only property and make it more generic?

Aylur commented 3 months ago

the most convenient is probably adding this as it is I'm thinking about something like

type State = "clicked" | "released"
type Button = "primary" | "secondary" | "middle" | "back" | "forward"

Button({
  onMouseButton(self, opts: { event: Gdk.Event, state: State, button: Button }) {
    if (state === "clicked" && button === "primary") {
      // onPrimaryClickRelease
    }
  }
})

but the issue with this is that it would require bloat to check for the clicked state, when usually only the clicked state is desired so maybe on-mouse-button and on-mouse-button-released?