-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Refactor the input module #91
Comments
Related issue: https://github.com/maplibre/maplibre-rs/blob/main/maplibre/src/input/tilt_handler.rs#L49 Pressing a key longer, causes the tilt to change more. The expected behavior is that the tilt changes only once per key press. |
I have found 2 additional potential issues within the input module:
|
(This is not an extra github issue, yet)
ElementState::Pressed is used. Will the key repeat apply? |
We have 3 inputs from keys, mouse and touch (joystick, game controllers and VR-controllers may follow) Maplibre JS: Maplibre RS: If we put the map and the controller in different Rust crates, RS could use the JS concept. |
What do you mean with a "map source"/"sources"? For the input module refactoring we first need to introduce an maplibre-rs event loop. The only way to update the camera is through the event loop. Because of the ownership model it is not possible to update for example yaw/pitch or the position of the camera at an arbitrary point in time. So an RFC for the refactoring of the input module must first design an event system & and event loop. |
@DerKarlos I started a proposal for the RFC process: #188 |
RFC: no Issue needed ✓ "map source"?: In MJS the map-class source-code has a function to set new positions for the map view. |
Yes that is correct,.the event loop will interpolate. That is definitely planned. Im still a bit unsure what you mean with source. I hope we can pass functions/closures. But maybe we will need events and event handlers. |
We should create a separate PR for the input module RFC. My PR is just for the setup. It would be great if you start the PR based on mine. |
"source-code" "source-file"? The many files with the Rust code we edit. #188: Setup of the input module? No, setup/Bootstrap the RFC process. Then I will start a new RFC for - what - all this?:
|
On android this library is used for maplibre/mapbox: https://github.com/mapbox/mapbox-gestures-android |
The
input
module, which handles key presses and other inputs is quite cluttered. That means that, the logic in order to update the libraries state is quite complicated. Theupdate_state
function does the actual updates, while the inputs are recorded through input listeners.🤔 Expected Behavior
We need a clear abstraction above the recorded inputs and the state update.
😯 Current Behavior
In the event handlers data is recorded. Based on this data, the
update_state
function is updating the state.💁 Possible Solution
Maybe reactive programming could be a good abstraction.
🔦 Context
💻 Code Sample
The text was updated successfully, but these errors were encountered: