TERMKEY\_INTERPRET\_MODEREPORT(3) Library Functions Manual TERMKEY\_INTERPRET\_MODEREPORT(3)

# [NAME](#NAME)

termkey\_interpret\_modereport - interpret opaque mode report data

# [SYNOPSIS](#SYNOPSIS)

```
#include <termkey.h>

TermKeyResult termkey_interpret_modereport(TermKey *tk, const TermKeyKey *key, 
    int *initial, int *mode, int *value);
```

Link with *-ltermkey*.

# [DESCRIPTION](#DESCRIPTION)

**termkey\_interpret\_modereport**() fills in variables in the passed pointers according to the mode report event found in *key*. It should be called if [**termkey\_getkey**(3)](/man/os/libtermkey/termkey_getkey.3) or similar have returned a key event with the type of **TERMKEY\_TYPE\_MODEREPORT**.

Any pointer may instead be given as **NULL** to not return that value.

The *initial* variable will be filled with 0 for an ANSI mode report, or '?' for a DEC mode report. The *mode* variable will be filled with the number of the mode, and *value* will be filled with the value from the report.

# [RETURN VALUE](#RETURN_VALUE)

If passed a *key* event of the type **TERMKEY\_TYPE\_MODEREPORT**, this function will return **TERMKEY\_RES\_KEY** and will affect the variables whose pointers were passed in, as described above.

For other event types it will return **TERMKEY\_RES\_NONE**, and its effects on any variables whose pointers were passed in, are undefined.

# [SEE ALSO](#SEE_ALSO)

[**termkey\_waitkey**(3)](/man/os/libtermkey/termkey_waitkey.3), [**termkey\_getkey**(3)](/man/os/libtermkey/termkey_getkey.3), [**termkey**(7)](/man/os/libtermkey/termkey.7)

---

Document: termkey_interpret_modereport(3) from libtermkey 0.22-r8 (Chainguard OS)
