You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a python user uses an annotation he expects the method to not be deleted, when we use the method as shown in the example the function flick used as an annotation returns None replacing the method defined by the user with nothing.
The same issue can be found in touch, tap, double_tap, garbage, move and airwheel.
@SnowyCoder That is not how flicklib and the annotations work.
When you import flicklib it already starts a continuous poll of the MGC3130 (the chip on the flick board).
It then reports all possible events to the library.
When you have defined a function with annotation in your own code like
Then the polling loop in the library will call your on_flick function where you can detect which way the flick was (N-S, S-N, E-W, W-E).
What you cannot do is to register a function for only a specific flick.
See e.g. the example flick-snail (https://github.com/PiSupply/Flick/blob/master/bin/flick-snail)
Sorry for the misunderstanding, I'll explain the use case of it:
I have an app that needs to work, no matter what happens, sometimes the program doesn't receive the input from the flick so my callbacks don't get fired.
To fix it I put another system that calls the callbacks manually using the input from a keyboard (as a last resort).
It works all-right until i try to call my on_flick callback, as it has been "eaten" by the annotation that returns None instead of the original method.
To work around this I register in the library a copy of the method, so that I can still call the original one.
I'm not sure if this is the intended behavior or not.
If a python user uses an annotation he expects the method to not be deleted, when we use the method as shown in the example the function
flick
used as an annotation returnsNone
replacing the method defined by the user with nothing.The same issue can be found in
touch
,tap
,double_tap
,garbage
,move
andairwheel
.Example:
Workaround (manual annotation call)
The text was updated successfully, but these errors were encountered: