unicode.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. Copyright 2021-2022 Rocco Meli <@RMeli>
  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 QMK_KEYBOARD_H
  16. // Needs to be active on the OS side as well
  17. // https://docs.qmk.fm/#/feature_unicode?id=input-modes
  18. enum unicode_names {
  19. aGRV,
  20. AGRV,
  21. aUML,
  22. AUML,
  23. eGRV,
  24. EGRV,
  25. eACT,
  26. EACT,
  27. iGRV,
  28. IGRV,
  29. iCIR,
  30. ICIR,
  31. oGRV,
  32. OGRV,
  33. oUML,
  34. OUML,
  35. uGRV,
  36. UGRV,
  37. uUML,
  38. UUML,
  39. };
  40. const uint32_t PROGMEM unicode_map[] = {
  41. // KC_A
  42. [aGRV] = 0x00E0, // à
  43. [AGRV] = 0x00C0, // À
  44. [aUML] = 0x00E4, // ä
  45. [AUML] = 0x00C4, // Ä
  46. // KC_E
  47. [eGRV] = 0x00E8, // è
  48. [EGRV] = 0x00C8, // È
  49. [eACT] = 0x00E9, // é
  50. [EACT] = 0x00C9, // É
  51. // KC_I
  52. [iGRV] = 0x00EC, // ì
  53. [IGRV] = 0x00CC, // Ì
  54. [iCIR] = 0x00EE, // î
  55. [ICIR] = 0x00CE, // Î
  56. // KC_O
  57. [oGRV] = 0x00F2, // ò
  58. [OGRV] = 0x00D2, // Ò
  59. [oUML] = 0x00F6, // ö
  60. [OUML] = 0x00D6, // Ö
  61. // KC_U
  62. [uGRV] = 0x00F9, // ù
  63. [UGRV] = 0x00D9, // Ù
  64. [uUML] = 0x00FC, // ü
  65. [UUML] = 0x00DC, // Ü
  66. };
  67. // Accents
  68. #define A_GRV XP(aGRV, AGRV)
  69. #define A_UML XP(aUML, AUML)
  70. #define E_GRV XP(eGRV, EGRV)
  71. #define E_ACT XP(eACT, EACT)
  72. #define I_GRV XP(iGRV, IGRV)
  73. #define I_CIR XP(iCIR, ICIR)
  74. #define O_GRV XP(oGRV, OGRV)
  75. #define O_UML XP(oUML, OUML)
  76. #define U_GRV XP(uGRV, UGRV)
  77. #define U_UML XP(uUML, UUML)