keymap.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. Copyright 2012-2016 Jun Wako <wakojun@gmail.com>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #pragma once
  15. #include <stdint.h>
  16. #include <stdbool.h>
  17. #include "action.h"
  18. #if defined(__AVR__)
  19. # include <avr/pgmspace.h>
  20. #elif defined PROTOCOL_CHIBIOS
  21. // We need to ensure that chibios is include before redefining reset
  22. # include <ch.h>
  23. #endif
  24. #include "keycode.h"
  25. #include "report.h"
  26. #include "host.h"
  27. // #include "print.h"
  28. #include "debug.h"
  29. #include "keycode_config.h"
  30. #include "gpio.h" // for pin_t
  31. // ChibiOS uses RESET in its FlagStatus enumeration
  32. // Therefore define it as QK_BOOTLOADER here, to avoid name collision
  33. #if defined(PROTOCOL_CHIBIOS)
  34. # define RESET QK_BOOTLOADER
  35. #endif
  36. // Gross hack, remove me and change RESET keycode to QK_BOOT
  37. #if defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1287__)
  38. # undef RESET
  39. #endif
  40. #include "quantum_keycodes.h"
  41. // Gross hack, remove me and change RESET keycode to QK_BOOT
  42. #if defined(MCU_RP)
  43. # undef RESET
  44. #endif
  45. // translates key to keycode
  46. uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key);
  47. extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
  48. #ifdef ENCODER_MAP_ENABLE
  49. // Ensure we have a forward declaration for the encoder map
  50. # include "encoder.h"
  51. #endif
  52. #include "keymap_introspection.h"