forked from kofal.net/zmk
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.
This commit is contained in:
committed by
Pete Johanson
parent
83a151890c
commit
e7a6e4016d
20
app/include/zmk/virtual_key_position.h
Normal file
20
app/include/zmk/virtual_key_position.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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))
|
||||
Reference in New Issue
Block a user