-
Notifications
You must be signed in to change notification settings - Fork 120
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
Refactoring underlying architecture to support various input types #483
Comments
It's a huge task, but I'm hoping this setup will work out. This makes it easy to add new stuff later on, like touchscreens and gestures, and allowing users to customize their input types. Any other ideas for now? |
Should we prioritize removing |
Not fully sold on the rename: I like the way that the current API makes the state machine nature clear. Otherwise this looks good. And yes, we should swap out for a lighter solution to input mocking for tests: I think that will make the refactoring much easier. |
Yeah, Github works in mysterious ways sometimes. I haven't been able to figure out what triggers the "expand issue number" formatting either! |
@Shute052 I just opened #496 based on some issues I was seeing. The current |
I'm totally on board with this plan, but I'll be away from work for 10 days and won't be able to continue working on this until I get back |
Hey. First thanks for the lib. This
would be very cool for me. i wanted to setup some "input modes" that toggle and this would let me do it directly with leafwing no need for anything ontop. If im understanding correctly though this is blocked until this larger story gets wrapped up? |
@michael-jaquier Hi! Which input modes were you interested in? I'm currently working on #494 first. The code and documentation are nearly complete, but I'm holding off on pushing it just yet. After that, I'll move on to #490. I think this will pave the way for a more straightforward implementation of |
Hey @Shute052 the idea for me was to have a system where users can input the "B" key to enter "Build Mode" then another key press would give them something from that mode. Something like delay = 1.5 seconds
input_map.insert_sequence(Action::BuildRedBox, [KeyB, KeyR], delay) Does that make sense? Reading the abstract from here #485 I think this would fit my use case perfectly and not force me to build a struct BuildMode(bool) Ontop of your library |
@michael-jaquier Here is my recent draft. While English isn't my native language, I struggle with naming and writing documentation. /// Specifies the interval in milliseconds.
pub enum InputInterval {
Min(f32),
Max(f32),
Range(f32, f32),
}
/// Specifies the timing rules for each user input in a sequence.
pub enum InputTimingRules {
Every(InputInterval),
EachBetween(Vec<InputInterval>),
}
/// Inserts a sequence of user inputs with specified timing rules.
fn insert_sequence(action: impl Actionlike, sequence: Vec<UserInput>, intervals: InputTimingRules); |
Thats exactly what I needed indeed. That's the root of my query -- Will that implementation need to wait for this larger refactor? Or is there perhaps a dev branch I could use to test this feature ( once its out of draft mode ) |
#534 is getting merged; I'm going to close this out. |
Motivation
Setting the stage for future additions (maybe):
UserInput::Sequence
andInputInterval
#485DualAxis
Directional Snapping #372This also gives users the freedom to tailor the input kinds they want.
Tasks
InputMap
#513value
field andfrom_value
method of axis-like inputs in favor of a new input mocking API #515UserInput
andInputKind
variants into separate implementations #490ToggleActions<A>
with per-action disable flags #456Undecided Changes
InputStream
traitReplace the large
InputStreams
with smaller, single-responsibility implementations:InputQuery
Similar to Bevy's
Query
:The text was updated successfully, but these errors were encountered: