keymap_introspection.h 1.1 KB

12345678910111213141516171819202122232425
  1. // Copyright 2022 Nick Brassel (@tzarc)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <stdint.h>
  5. // Get the number of layers defined in the keymap
  6. uint8_t keymap_layer_count(void);
  7. // Get the keycode for the keymap location, stored in firmware rather than any other persistent storage
  8. uint16_t keycode_at_keymap_location_raw(uint8_t layer_num, uint8_t row, uint8_t column);
  9. // Get the keycode for the keymap location, potentially stored dynamically
  10. uint16_t keycode_at_keymap_location(uint8_t layer_num, uint8_t row, uint8_t column);
  11. #if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
  12. // Get the number of layers defined in the encoder map
  13. uint8_t encodermap_layer_count(void);
  14. // Get the keycode for the encoder mapping location, stored in firmware rather than any other persistent storage
  15. uint16_t keycode_at_encodermap_location_raw(uint8_t layer_num, uint8_t encoder_idx, bool clockwise);
  16. // Get the keycode for the encoder mapping location, potentially stored dynamically
  17. uint16_t keycode_at_encodermap_location(uint8_t layer_num, uint8_t encoder_idx, bool clockwise);
  18. #endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)