You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.4 KiB

  1. /* Copyright 2021 Robert Verst <robert@verst.eu> @rverst
  2. *
  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. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. #include QMK_KEYBOARD_H
  18. enum userspace_mode {
  19. MAC = 0,
  20. WINDOWS,
  21. MAC_UNI,
  22. WINDOWS_UNI,
  23. LINUX_UNI,
  24. };
  25. enum userspace_keycodes {
  26. RV_NON = SAFE_RANGE,
  27. RV_SM0, // set Mac Unicode mode
  28. RV_SM1, // set Window Unicode mode
  29. RV_SM2, // set Linux Unicode mode
  30. RV_SM3, // set Mac lagecy mode
  31. RV_SM4, // set Windows legacy mode
  32. RV_SM0S, // set Mac Unicode mode and save
  33. RV_SM1S, // set Windows Unicode mode and save
  34. RV_SM2S, // set Linux Unicode and save
  35. RV_SM3S, // set Mac legacy mode
  36. RV_SM4S, // set Windows legacy and save
  37. RV_SAYM, // say mode
  38. RV_LOCK, // lock computer
  39. RV_AUML, // äÄ
  40. RV_OUML, // öÖ
  41. RV_UUML, // üÜ
  42. RV_EUR, // €
  43. RV_SZ, // ߧ
  44. RV_TM, // ™
  45. RV_RT, // ®
  46. RV_CC, // ©
  47. RV_DEG, // °
  48. RV_SNAP, // Screenshot
  49. RV_PM, // ±
  50. RV_UNEQ, // ≠
  51. RV_SUP1, // ¹
  52. RV_SUP2, // ²
  53. RV_SUP3, // ³
  54. RV_VINC, // vim increase vertical split size (<c-w> 4>)
  55. RV_VDEC, // vim decrease vertical split size (<c-w> 4<)
  56. RV_SINC, // vim increase vertical split size (<c-w> 4+)
  57. RV_SDEC, // vim decrease vertical split size (<c-w> 4-)
  58. RV_SEQU, // vim equal split size (<c-w> =)
  59. };
  60. typedef union {
  61. uint32_t raw;
  62. struct {
  63. bool mode_1 : 1;
  64. bool mode_2 : 1;
  65. bool mode_3 : 1;
  66. };
  67. } userspace_config_t;
  68. extern userspace_config_t userspace_config;
  69. uint8_t get_mode(void);
  70. void set_mode(uint8_t mode, bool save);
  71. void switch_mode(uint8_t mode);
  72. bool is_unicode(uint8_t mode);
  73. void keyboard_pre_init_keymap(void);
  74. void keyboard_post_init_keymap(void);
  75. void eeconfig_init_keymap(void);
  76. bool process_record_keymap(uint16_t keycode, keyrecord_t *record);