keymap_introspection.h 1.8 KB

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