edvorakjp.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef USERSPACE
  2. #define USERSPACE
  3. #include "quantum.h"
  4. #include "action_layer.h"
  5. #define EECONFIG_EDVORAK (uint8_t *)20
  6. extern keymap_config_t keymap_config;
  7. typedef union {
  8. uint8_t raw;
  9. struct {
  10. bool enable_jp_extra_layer : 1;
  11. bool enable_kc_lang : 1; // for macOS
  12. };
  13. } edvorakjp_config_t;
  14. extern edvorakjp_config_t edvorakjp_config;
  15. enum edvorakjp_layers {
  16. _EDVORAK = 0,
  17. _EDVORAKJ1,
  18. _EDVORAKJ2,
  19. _QWERTY,
  20. _LOWER,
  21. _RAISE,
  22. _ADJUST,
  23. _EXTRA,
  24. };
  25. enum edvorakjp_keycodes {
  26. EDVORAK = SAFE_RANGE,
  27. QWERTY,
  28. LOWER,
  29. RAISE,
  30. KC_MAC,
  31. KC_WIN,
  32. KC_EXTON,
  33. KC_EXTOFF,
  34. KC_JPN,
  35. KC_ENG,
  36. KC_AI,
  37. KC_OU,
  38. KC_EI,
  39. KC_ANN,
  40. KC_ONN,
  41. KC_ENN,
  42. KC_INN,
  43. KC_UNN,
  44. NEW_SAFE_RANGE
  45. };
  46. uint8_t eeconfig_read_edvorakjp(void);
  47. void eeconfig_update_edvorakjp(uint8_t val);
  48. void dvorakj_layer_off(void);
  49. void update_japanese_mode(bool new_state);
  50. void matrix_init_user(void);
  51. void matrix_init_keymap(void);
  52. uint32_t layer_state_set_user(uint32_t state);
  53. uint32_t layer_state_set_keymap(uint32_t state);
  54. /*
  55. * Each process_record_* methods defined here are
  56. * return false if processed, or return true if not processed.
  57. * You can add your original macros in process_record_keymap() in keymap.c.
  58. */
  59. bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
  60. bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record);
  61. bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record);
  62. bool process_record_layer(uint16_t keycode, keyrecord_t *record);
  63. bool process_record_ime(uint16_t keycode, keyrecord_t *record);
  64. bool process_record_user(uint16_t keycode, keyrecord_t *record);
  65. #endif