zmk/app/include/zmk/virtual_key_position.h
Peter Johanson 2244bd3d81 refactor(sensors): Sensor event channel data, resolution tweaks.
* Refactor sensor events to include channel data,
  necessary for prop split encoders, and avoiding duplicate calls,
  to fetch channel data twice, etc.
* More consistent behavior driver API.
* Allow setting triggers per resolution at the behavior level optionally.
2023-06-18 20:45:06 -06:00

25 lines
640 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 sensor number from the virtual key position.
*/
#define ZMK_SENSOR_POSITION_FROM_VIRTUAL_KEY_POSITION(vkp) ((vkp)-ZMK_KEYMAP_LEN)
/**
* 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))