@Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        return barcodeScannerView.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
    }
Sample Activity extending from ActionBarActivity to display a Toolbar.
sample/src/main/java/example/zxing/ToolbarCaptureActivity.java