---
name: "snd_jack_set_key"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/snd_jack_set_key"
---

# snd\_jack\_set\_key(9)

Set a key mapping on a jack

## NAME

snd\_jack\_set\_key - Set a key mapping on a jack

## SYNOPSIS

**int snd\_jack\_set\_key(struct snd\_jack \*** *jack***, enum snd\_jack\_types** *type***, int** *keytype***);**

## ARGUMENTS

*jack*

The jack to configure

*type*

Jack report type for this key

*keytype*

Input layer key type to be reported

## DESCRIPTION

Map a SND\_JACK\_BTN\_ button type to an input layer key, allowing reporting of keys on accessories via the jack abstraction. If no mapping is provided but keys are enabled in the jack type then BTN\_n numeric buttons will be reported.

If jacks are not reporting via the input API this call will have no effect.

Note that this is intended to be use by simple devices with small numbers of keys that can be reported. It is also possible to access the input device directly - devices with complex input capabilities on accessories should consider doing this rather than using this abstraction.

This function may only be called prior to registration of the jack.

## RETURN

Zero if successful, or a negative error code on failure.

## COPYRIGHT
