> For the complete documentation index, see [llms.txt](https://minwork.gitbook.io/long-press-hook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://minwork.gitbook.io/long-press-hook/advanced/options/react-events/filtering-events.md).

# Filtering events

Skip triggering long press for undesired 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](/long-press-hook/advanced/options/callbacks/press-started.md) and [onCancel](/long-press-hook/advanced/options/callbacks/long-press-cancelled.md)) as well as [persisting event](/long-press-hook/advanced/options/react-events/persisting-event.md).
