Scroll Event Modifiers Get Stuck
Describe the bug
When adding a modifier to a scroll event, Cogent does not see the control modifier until shift is pressed. At that point it will see the control modifier forever, until you click in the frame.
How to reproduce
Run example code Attempt to scroll in the middle Check terminal for stroll events - should be present Attempt to hold ctrl and scroll - should see unmodified scroll events still Tap shift, continue to hold ctrl - should now see control modifier AND shift modifier Release ctrl - only control modifier present on scroll Tap shift again - should now see shift modifier is "stuck" on scroll events Click, in the middle, and then scroll - should now see unmodified scroll events
Example code
package main
import (
"cogentcore.org/core/core"
"cogentcore.org/core/events"
"cogentcore.org/core/styles"
"cogentcore.org/core/styles/abilities"
"cogentcore.org/core/styles/units"
"fmt"
)
func main() {
b := core.NewBody("modified-scroll-repro")
scrollable := core.NewFrame(b)
scrollable.Styler(func(s *styles.Style) {
s.Grow.Set(1, 1)
s.Border.Width.Set(units.Dp(4))
s.SetAbilities(true, abilities.Scrollable)
})
scrollable.On(events.Scroll, func(e events.Event) {
fmt.Println(e)
})
b.RunMainWindow()
}
Relevant output
Platform
Linux
Thank you for reporting this. Interestingly, I cannot reproduce this at all on macOS, but it does reproduce fully on my Ubuntu VM, so it is some kind of platform-specific issue. We will work on fixing this when we have the time.