keymap_introspection.h 1.8 KB

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