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 the active keyboard modifiers to the mouse events #117

Merged
merged 2 commits into from
Sep 22, 2022

Conversation

robbert-vdh
Copy link
Member

@robbert-vdh robbert-vdh commented Feb 9, 2022

This builds on top of #115, so I marked this as a draft until that has been merged.

Every mouse event now has a modifier field containing the current keyboard modifiers. Most window management APIs work like this, and it solves things like #116 by making sure that whenever a window receives a mouse event, it also knows the up to date keyboard modifier status.

robbert-vdh added a commit to robbert-vdh/nih-plug that referenced this pull request Feb 9, 2022
@robbert-vdh robbert-vdh force-pushed the feature/mouse-event-modifiers branch from 4bfe910 to a8ef4dd Compare February 10, 2022 02:15
@robbert-vdh robbert-vdh changed the title Feature/mouse event modifiers Add the active keyboard modifiers to the mouse events Feb 10, 2022
@robbert-vdh robbert-vdh force-pushed the feature/mouse-event-modifiers branch from a8ef4dd to 8e7f854 Compare March 7, 2022 18:53
@robbert-vdh robbert-vdh marked this pull request as ready for review March 7, 2022 18:53
@robbert-vdh
Copy link
Member Author

I've rebased this on the master branch now that #115 has been merged.

@robbert-vdh robbert-vdh force-pushed the feature/mouse-event-modifiers branch from 8e7f854 to 39b2f75 Compare March 11, 2022 20:16
Since this isn't emitted anywhere, this can only lead to confusion for
library consumers. They'd need to implement their own click detection
with the button up and button down events.
This would solve the most important use case for RustAudio#116. Only the Linux
version has been tested, but the Windows should work perfectly fine, and
I don't know anything about macOS programming but that version also
compiles so it should be fine.
@robbert-vdh robbert-vdh force-pushed the feature/mouse-event-modifiers branch from 39b2f75 to 5b57af2 Compare March 11, 2022 21:59
@robbert-vdh robbert-vdh mentioned this pull request Mar 16, 2022
8 tasks
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 17, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 18, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 18, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 19, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 19, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 20, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 21, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 21, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 21, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 25, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 27, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Mar 27, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Apr 7, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Apr 19, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Apr 19, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Apr 19, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Apr 24, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Apr 26, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Apr 26, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Jun 17, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Jun 18, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
@wrl wrl merged commit eae4033 into RustAudio:master Sep 22, 2022
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Sep 22, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
robbert-vdh added a commit to robbert-vdh/vizia that referenced this pull request Sep 22, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
rhelmot pushed a commit to vizia/vizia that referenced this pull request Sep 24, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
geom3trik pushed a commit to vizia/vizia that referenced this pull request Sep 26, 2022
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
geom3trik added a commit to vizia/vizia that referenced this pull request Sep 27, 2022
* Add tabview + example

* Fix for disabled state style matching

The disabled state was being ignored when performing the optimization which skips style matching when siblings have the same selector. This resulted in disabled siblings being ignored. Fixed by applying the disabled state to the selector.

* impl res for option

* Fix warning

* Add class to describing labels and add hand cursor to theme (#224)

* Add rays and Event::take. it does not work

WEH

Message is dead; long live Message (it works)

fmt

Bikeshed

Rename Ray to Setter; add derive(Model)

Switch a few examples to Model/Setter

* Make text child-space calculation more intuitive; fix some dpi bugs (#226)

* Make text child-space calculation more intuitive; fix some dpi bugs

* fmt

* Bump copypasta (#228)

* Make window events not read or write state until it is their turn in line

fmt

Freshen up the window events

Freshen focus events

Un-consume fresh events after de-freshening

De-freshen, root-ify

* Fix textbox mouse interaction in hidpi

* Add ctrl-shift-alt-S to print matched style rules for hovered element

* Sync fonts before event loop

Fixes bug on MacOS where redraw occurs before fonts are synced.

* Temporarily remove book link

Closes #234

* Set modifiers on baseview mouse events (#236)

Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.

* Add main widow before calling build closure (baseview)

* Force restyle on every frame to avoid style inheritance issues

* Expose `style` in `EventCotext` to allow getting/setting style properties in response to events

* Consume `MouseDown` event when double or triple clicked

* Export `GeneratioalId` through prelude to allow constructing `Entity::root()`

* Add root element selector for styling root window

* Add `:root` pseudoclass selector

* Add tabview + example

* Tabview styling (#239)

* tabview styling

* white theme

* dark theme default

Co-authored-by: Audrey Dutcher <[email protected]>
Co-authored-by: Robbert van der Helm <[email protected]>
Co-authored-by: Lunae Somnia <[email protected]>
@robbert-vdh robbert-vdh deleted the feature/mouse-event-modifiers branch November 22, 2022 14:29
5eqn pushed a commit to 5eqn/vizia that referenced this pull request Nov 11, 2024
Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.
5eqn pushed a commit to 5eqn/vizia that referenced this pull request Nov 11, 2024
* Add tabview + example

* Fix for disabled state style matching

The disabled state was being ignored when performing the optimization which skips style matching when siblings have the same selector. This resulted in disabled siblings being ignored. Fixed by applying the disabled state to the selector.

* impl res for option

* Fix warning

* Add class to describing labels and add hand cursor to theme (vizia#224)

* Add rays and Event::take. it does not work

WEH

Message is dead; long live Message (it works)

fmt

Bikeshed

Rename Ray to Setter; add derive(Model)

Switch a few examples to Model/Setter

* Make text child-space calculation more intuitive; fix some dpi bugs (vizia#226)

* Make text child-space calculation more intuitive; fix some dpi bugs

* fmt

* Bump copypasta (vizia#228)

* Make window events not read or write state until it is their turn in line

fmt

Freshen up the window events

Freshen focus events

Un-consume fresh events after de-freshening

De-freshen, root-ify

* Fix textbox mouse interaction in hidpi

* Add ctrl-shift-alt-S to print matched style rules for hovered element

* Sync fonts before event loop

Fixes bug on MacOS where redraw occurs before fonts are synced.

* Temporarily remove book link

Closes vizia#234

* Set modifiers on baseview mouse events (vizia#236)

Using the changes from RustAudio/baseview#117.

Until baseview implements proper keyboard focus handling this helps when
dragging a knob or slider outside of the window. Otherwise the modifier
state may get stuck on an incorrect value.

* Add main widow before calling build closure (baseview)

* Force restyle on every frame to avoid style inheritance issues

* Expose `style` in `EventCotext` to allow getting/setting style properties in response to events

* Consume `MouseDown` event when double or triple clicked

* Export `GeneratioalId` through prelude to allow constructing `Entity::root()`

* Add root element selector for styling root window

* Add `:root` pseudoclass selector

* Add tabview + example

* Tabview styling (vizia#239)

* tabview styling

* white theme

* dark theme default

Co-authored-by: Audrey Dutcher <[email protected]>
Co-authored-by: Robbert van der Helm <[email protected]>
Co-authored-by: Lunae Somnia <[email protected]>
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.

2 participants