Detect wink on Google Glass without taking picture

154 views Asked by At

Is there a way to stop Glass from taking picture while listening to wink command? Whenever I detect Wink from my code, it automatically takes a picture which I don't want.

Edit: The library is a stub. Whenever the onDetected function is called, I get a log message then Glass takes picture. Is there a way to stop the Internal glass function from running? I tried adding return at the end of onDetected but that didn't work.... Maybe a function to abort to exit the function? The code is below.

@Override
public void onDetected(final EyeGesture eyeGesture) {
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            mAudioManager.playSoundEffect(Sounds.SUCCESS);
            Log.e(TAG, eyeGesture + " is detected");
            if(eyeGesture==target1.WINK){
                mTextView.setText("Detected " + eyeGesture + "!");
            }

        }
    });

}
2

There are 2 answers

2
Victor KP On

In the old days (XE16 and before), winks sent out a broadcast. If you simply created a high priority broadcast receiver, you could abort the broadcast (and the wink-picture-receiver would never see the broadcast).

I put togethher some old code to demonstrate this here: https://gist.github.com/victorkp/0f98cd5c096de53f4518

2
adlagar On

Try this code:

https://github.com/prt2121/EyeGestureLib

Revision for XE19.