# Filtering events

#### Name

`filterEvents`

#### Type

{% code title="Javascript" %}

```javascript
(event) => boolean
```

{% endcode %}

{% code title="TypeScript" %}

```typescript
(event: LongPressReactEvents<Target>) => boolean
```

{% endcode %}

#### Default value

`undefined`

#### Description

If provided, it gives you the ability to ignore long press detection on specified conditions (e.g. on right mouse click).\
\
When function returns `false`, it will prevent ANY callbacks from triggering (including [onStart](https://minwork.gitbook.io/long-press-hook/advanced/options/callbacks/press-started) and [onCancel](https://minwork.gitbook.io/long-press-hook/advanced/options/callbacks/long-press-cancelled)) as well as [persisting event](https://minwork.gitbook.io/long-press-hook/advanced/options/react-events/persisting-event).
