Immediate-Mode-UI / Immediate-Mode-UI/Nuklear
Touch to Scroll
- Dominant language
- C
- Stars
- 11.4k
- Forks
- 686
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 3
Description
I would like to have touch to scroll working, for usage on touch screens. You know, how you can effortlessly just scroll up and down on a webpage with a phone. So for a flawless experience, with an enlarged scrollbar being used for scrolling though. As a workaround it is trivial to remap to fingers moving to -> [`nk_input_scroll()`](https://github.com/Immediate-Mode-UI/Nuklear/blob/776893ef7b0f73ec22807e210abc10851803d69e/src/nuklear.h#L646) But it just isn't the same as proper one finger touch to scroll.
The logic needed for this is rather simple I imagine. The logic for this is "If mouse is not hovering over something that can be interacted with, then click + drag distance affects ctx.input.scroll_delta". However, whilst there are a bunch of functions to test whether the mouse is over an intractable rectangle, I don't know how to test for the opposite. There is a [`nk_window_is_any_hovered()`](https://github.com/Immediate-Mode-UI/Nuklear/blob/776893ef7b0f73ec22807e210abc10851803d69e/src/nuklear.h#L1636) but no `nk_window_is_any_clickable_thingy_hovered()`.
Anyone have an idea how to test for "Is the current mouse click over something that can be interacted with?"
Contributor guide
Research direction
Start in src/nuklear.h around nk_input_scroll() and nk_window_is_any_hovered(), then trace the existing input and hover handling described in the issue. Done means one-finger touch dragging scrolls non-interactive areas while interactive controls retain their existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100