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

Allow holding shift on ScrollAreas with horizontal scrolling disabled #3624

Closed
doonv opened this issue Nov 24, 2023 · 8 comments · Fixed by #3710
Closed

Allow holding shift on ScrollAreas with horizontal scrolling disabled #3624

doonv opened this issue Nov 24, 2023 · 8 comments · Fixed by #3710
Labels
bug Something is broken egui-winit porblems related to winit native-linux Problem specific to Linux

Comments

@doonv
Copy link
Contributor

doonv commented Nov 24, 2023

Describe the bug
Pressing/Tapping Shift after a ScrollArea::new([false, true]) (Vertical Scrolling Only) was opened causes scrolling via the scroll wheel to no longer work.

To Reproduce
Steps to reproduce the behavior:

  1. Create a ScrollArea with only vertical scrolling.
  2. Scrolling works
  3. Press Shift
  4. Scrolling doesn't work

Expected behavior
The ScrollArea always scrolls vertically regardless of if Shift was pressed or not.

Desktop (please complete the following information):

  • OS: Kubuntu 23.10
  • Browser: Not using a browser
  • Version: bevy_egui = "0.23.0", egui = { version = "0.23.0", default-features = false, features = ["bytemuck"] }

Additional context
I am using egui in bevy using bevy_egui.

@doonv doonv added the bug Something is broken label Nov 24, 2023
@doonv
Copy link
Contributor Author

doonv commented Nov 24, 2023

This issue is most likely caused by #663 as that is when horizontal scrolling was added. (Which uses Shift to know when to horizontally scroll)

@emilk
Copy link
Owner

emilk commented Nov 27, 2023

is this bug about not being able to scrol while holding down shift, or not being able to scroll after tapping shift once and then releasing it?

@doonv
Copy link
Contributor Author

doonv commented Nov 27, 2023

@emilk It's about not being able to scroll after tapping shift once.

@emilk emilk changed the title Vertical scrolling with the scroll wheel breaks after pressing shift Sticky shift-key on Kubuntu Nov 27, 2023
@emilk emilk added egui-winit porblems related to winit native-linux Problem specific to Linux labels Nov 27, 2023
@emilk
Copy link
Owner

emilk commented Nov 27, 2023

I can't reproduce. Sounds like a problem of sticky modifier keys on your system.

Does egui report the SHIFT modifier to be pressed even after you released it? (ctx.input(|i| dbg!(i.modifiers));)

Please take a look at crates/egui-winit/src/lib.rs and see how modifiers.shift is updated - perhaps WindowEvent::ModifiersChanged is not working properly?

@doonv
Copy link
Contributor Author

doonv commented Nov 27, 2023

It might be a bevy_egui issue. I'll try out doing it with eframe (or whatever you use to make native egui applications)

@emilk
Copy link
Owner

emilk commented Nov 27, 2023

Check out this repository and run cargo run -p egui_demo_app. If there is no problem then yes, it is a bevy_egui problem.

@doonv
Copy link
Contributor Author

doonv commented Nov 27, 2023

Yeah I can't reproduce the bug when using cargo run -p egui_demo_app.

I also did ui.input(|i| i.modifiers.shift) and, as I suspected it continued being true after i realised the shift key. So I'm closing this and making a bevy_egui issue instead.

@doonv doonv closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
@doonv
Copy link
Contributor Author

doonv commented Nov 27, 2023

I'm reopening this for a different reason. Because even if Shift is being held, it shouldnt affect the scrolling if horizontal scrolling is disabled.

@doonv doonv reopened this Nov 27, 2023
@doonv doonv changed the title Sticky shift-key on Kubuntu Allow holding shift on ScrollAreas with horizontal scrolling disabled Nov 27, 2023
emilk pushed a commit that referenced this issue Jan 7, 2024
…3710)

Add option to use the scroll input from both directions to scroll the
enabled direction if scrolling is enabled for only one direction. This
can be used to allow horizontal scrolling without pressing shift if
vertical scrolling is disabled.

Closes <#3624>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken egui-winit porblems related to winit native-linux Problem specific to Linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants