---
name: "AuRegisterEventHandler"
section: "3nas"
platform: "linux"
package: "libaudio-dev"
version: "1.9.4-9"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/AuRegisterEventHandler"
---

# AuRegisterEventHandler(3nas)

add an event handler.

## Name

**AuRegisterEventHandler** - add an event handler.

## Synopsis

\#include \<audio/audiolib.h\>

**AuEventHandlerRec** \***AuRegisterEventHandler**(*server*, *value\_mask*, *type*, *id*, *callback data*)\
\
     **AuServer** \**server*;\
\
     **AuMask** *value\_mask*;\
\
     int *type*;\
\
     **AuID** *id*;\
\
     **AuBool** (\**callback*)(**AuServer** \*, **AuEvent** \*, **AuEventHandlerRec** \*);\
\
     **AuPointer** *data*;

## Arguments

- *server*

  Specifies the connection to the audio server.

- *value\_mask*

  Specifies which values are checked to determine if this handler should handle an event. This should be an inclusive OR of **AuEventHandlerTypeMask** and **AuEventHandlerIDMask**.

- *type*

  Specifies the type of event that are to be handled by this handler. This should be one of these constants: **AuEventTypeElementNotify**, **AuEventTypeGrabNotify**, or **AuEventTypeMonitorNotify**.

- *id*

  Specifies the source id of the event that are to be handled by this handler.

- *callback*

  Specifies the procedure to handle the event.

- *data*

  Specifies additional data to be passed to the event handler.

## Description

**AuRegisterEventHandler** registers an event handler for future use by **AuDispatchEvent**.

## See Also

**AuUnregisterEventHandler**.

audiolib - **Network Audio System** C Language Interface
