-
Notifications
You must be signed in to change notification settings - Fork 3
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
Button down listener #6
Comments
@1g0rrr great idea. We may also extend |
@ryaa yes, sounds good. But how can we know in VolumeButtonsCallback what action was called ACTION_DOWN or ACTION_UP while using ACTION_ALL option? So we probably need to put action name into "ret" anyway. Or are you suggesting to use watchVolume twice in client code, one for ACTION_DOWN and one for ACTION_UP? |
@1g0rrr my suggestion is to use your approach with two variables to result instead of one. However, allow the consuming app to choose if it wants to receive a callback for ACTION_DOWN, ACTION_UP or ACTION_ALL. For example, in my application i only need to receive ACTION_UP callbacks. I can filter by action === 'up' but my guess that there will be many ACTION_DOWN events sent which from native code which I don't need anyway and will discard them in my cross platform code. let me know if this makes sense. thank you |
@ryaa Ok, I agree. We can do it this way. |
@1g0rrr in other words, i would prefer to filter actions in the native code and invoke the callback only for the actions that the application asks/needs. I hope that this makes sense. |
Great suggestion!! |
@ryaa Ok. So let's implement? |
yes :) |
@ryaa |
Hi. I missed this conversation. I tried to implement the key down handler already, on top of 1.0.2 release. I'm filtering the events in the native code (android only) and didn't change the output contract; just added a new option. My current problem is not being able to receive the configuration made in my ts app in the native code (call.getString("triggerKey") is always returning null). After that I would create an issue/PR, but I see you are already doing that. Great! |
Hi, @ryaa as I can see, we don't have ACTION_DOWN event yet. How about to add it?
I still need it for "push to talk" feature and @p-caetano seems need it too for precision starting timer.
We can add two variables to result instead of one. First one for type of the button and second one for action of the button, like this:
I can add PR if you wish, and discuss solution beforehead
The text was updated successfully, but these errors were encountered: