Closed michalpokusa closed 1 year ago
I think is an interesting addition to functionality. However, I have reservations about adding it directly to the library:
- We try to keep this library as small as possible, because it's used on or frozen into boards with very low memory. For example, non-US keyboard layouts are in an external library. So additions to functionality might better be done as an external library that subclasses
Mouse
or just wraps the call tomove()
.- A non-zero
duration
will cause themove(0
to delay for that amount of time. Thought this might make sense in some use cases, in others it will prevent handling other input while the delay is happening. Again, this might be done externally to the library.
Thanks for replying so quickly.
KeyboardLayput.write
which also blocks for the time it needs for writing the whole string, which is highly connected to the length of the text. It would be possible to make it an async
function but this would be a breaking change, and not consistent with the rest of library.
- Do you have a specific external library in mind, or are you talking about forking and creating a separate lib from this one?
Not a fork, but an addition. Or add code in examples
that illustrates the use case which the user can just copy and use.
What is the use case that inspired this addition?
- Do you have a specific external library in mind, or are you talking about forking and creating a separate lib from this one?
Not a fork, but an addition. Or add code in
examples
that illustrates the use case which the user can just copy and use.What is the use case that inspired this addition?
I was making an extension that provided ability to move mouse curser over a specified path, in my case a SVG path, specifically a series of quadratic bezier curves, for it to work, the duration
is not necessary, but with it I was able to create pretty "animations", where mouse draws in real time essentially any image defined using bezier curves.
Although my path moving might be too specific for a lib feature I figured taht maybe the duration
alone would be a good candidate for addition.
⭐ Added:
duration
parameter inMouse.move()
for specifying time in which the move should be performedeasing_function
parameter inMouse.move()
for specifying a function for non-linear progress of the move🪛Fixes:
-