Device APIsUpdated 2026-07-24

Keyboard and mouse functions

Read supported keyboard and mouse state and write translated output using current Zen identifiers and routing rules.

Overview

The official Zen keyboard table contains get_keyboard and get_modifiers for key state, plus get_mk and set_mk for Mouse & Keyboard configuration values.

Key constants, modifier constants, and configuration indexes must come from the current official table.

Key facts

  • Several keyboard and mouse APIs are Zen-only.
  • Key and mouse identifiers must come from the current official tables.
  • Output routing depends on the connected setup and active protocol.

GPC syntax examples

Examples are intentionally small. Replace identifiers only with values documented for your target.

Read a documented keyexample.gpc
main {
    if (get_keyboard(KEY_A)) {
        set_val(XB1_A, 100);
    }
}

Use the key constants listed in the current official keyboard reference.

Functions, commands, and terms

Names below are catalog entries, not guessed signatures. Open the official sources for current parameter and return-value details.

NameKindPurpose
get_keyboardfunction · Zen only

Checks whether the selected keyboard key is held.

get_modifiersfunction · Zen only

Checks whether a selected keyboard modifier is held.

get_mkfunction · Zen only

Gets a Mouse & Keyboard configuration value.

set_mkfunction · Zen only

Sets a Mouse & Keyboard configuration value.

Common mistakes

Inventing key codes from another platform.

Treating get_mk as live mouse-axis input.

Assuming these Zen-only functions compile for Plus.

Official GPC sources

Use these first-party references to confirm exact syntax and runtime behavior for your installed firmware and Studio version.

Related GPC references