Skip to content
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

Add volume up/down buttons in the Gesture system #293

Open
Rupeshrajsingh opened this issue Oct 19, 2018 · 5 comments
Open

Add volume up/down buttons in the Gesture system #293

Rupeshrajsingh opened this issue Oct 19, 2018 · 5 comments

Comments

@Rupeshrajsingh
Copy link

if i want to take picture by volume UP or volume Down button,
so what i do..?

@natario1
Copy link
Owner

Try asking on StackOverflow!

@JeremeLau
Copy link

Just set a onKeyDown listener and listen 2 KeyEvent.KEYCODE_VOLUME_DOWN or KeyEvent.KEYCODE_VOLUME_UP, then do the TAKEPICTURE action

@natario1
Copy link
Owner

I think it would be cool if the library listened to these two and treated them as a Gesture so you can assign GestureActions.

@natario1 natario1 changed the title need help Add volume up/down buttons in the Gesture system Dec 16, 2018
@MoustafaElsaghier
Copy link

you can override method onKeyDown() in your activity and use it like that

@Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if(keyCode ==  KeyEvent.KEYCODE_VOLUME_DOWN || keyCode == KeyEvent.KEYCODE_VOLUME_UP){
            // capture image code here (        mCameraView.takePictureSnapshot();)
        }
        return super.onKeyDown(keyCode, event);;
    }

@SweetD3v
Copy link

SweetD3v commented Jul 6, 2023

Working on that. Will create a pull request when done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants