zmk/app/include/zmk/virtual_key_position.h
Joel Spadin e7a6e4016d feat(behaviors): Add key position to key events
Extended the virtual key position system from combos so that each sensor
also gets a virtual key position. This allows sensor behaviors to use
the behavior queue API.
2023-04-16 23:53:12 -07:00

20 lines
492 B
C

/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#include <zmk/matrix.h>
#include <zmk/sensors.h>
/**
* Gets the virtual key position to use for the sensor with the given index.
*/
#define ZMK_VIRTUAL_KEY_POSITION_SENSOR(index) (ZMK_KEYMAP_LEN + (index))
/**
* Gets the virtual key position to use for the combo with the given index.
*/
#define ZMK_VIRTUAL_KEY_POSITION_COMBO(index) (ZMK_KEYMAP_LEN + ZMK_KEYMAP_SENSORS_LEN + (index))