logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

charybdis.h (3710B)


  1. /*
  2. * Copyright 2021 Quentin LEBASTARD <qlebastard@gmail.com>
  3. * Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #pragma once
  19. #include "quantum.h"
  20. #ifdef POINTING_DEVICE_ENABLE
  21. # ifndef NO_CHARYBDIS_KEYCODES
  22. enum charybdis_keycodes {
  23. POINTER_DEFAULT_DPI_FORWARD = QK_KB_0,
  24. POINTER_DEFAULT_DPI_REVERSE,
  25. POINTER_SNIPING_DPI_FORWARD,
  26. POINTER_SNIPING_DPI_REVERSE,
  27. SNIPING_MODE,
  28. SNIPING_MODE_TOGGLE,
  29. DRAGSCROLL_MODE,
  30. DRAGSCROLL_MODE_TOGGLE,
  31. };
  32. # define DPI_MOD POINTER_DEFAULT_DPI_FORWARD
  33. # define DPI_RMOD POINTER_DEFAULT_DPI_REVERSE
  34. # define S_D_MOD POINTER_SNIPING_DPI_FORWARD
  35. # define S_D_RMOD POINTER_SNIPING_DPI_REVERSE
  36. # define SNIPING SNIPING_MODE
  37. # define SNP_TOG SNIPING_MODE_TOGGLE
  38. # define DRGSCRL DRAGSCROLL_MODE
  39. # define DRG_TOG DRAGSCROLL_MODE_TOGGLE
  40. # endif // !NO_CHARYBDIS_KEYCODES
  41. /** \brief Return the current DPI value for the pointer's default mode. */
  42. uint16_t charybdis_get_pointer_default_dpi(void);
  43. /**
  44. * \brief Update the pointer's default DPI to the next or previous step.
  45. *
  46. * Increases the DPI value if `forward` is `true`, decreases it otherwise.
  47. * The increment/decrement steps are equal to CHARYBDIS_DEFAULT_DPI_CONFIG_STEP.
  48. *
  49. * The new value is persisted in EEPROM.
  50. */
  51. void charybdis_cycle_pointer_default_dpi(bool forward);
  52. /**
  53. * \brief Same as `charybdis_cycle_pointer_default_dpi`, but do not write to
  54. * EEPROM.
  55. *
  56. * This means that reseting the board will revert the value to the last
  57. * persisted one.
  58. */
  59. void charybdis_cycle_pointer_default_dpi_noeeprom(bool forward);
  60. /** \brief Return the current DPI value for the pointer's sniper-mode. */
  61. uint16_t charybdis_get_pointer_sniping_dpi(void);
  62. /**
  63. * \brief Update the pointer's sniper-mode DPI to the next or previous step.
  64. *
  65. * Increases the DPI value if `forward` is `true`, decreases it otherwise.
  66. * The increment/decrement steps are equal to CHARYBDIS_SNIPING_DPI_CONFIG_STEP.
  67. *
  68. * The new value is persisted in EEPROM.
  69. */
  70. void charybdis_cycle_pointer_sniping_dpi(bool forward);
  71. /**
  72. * \brief Same as `charybdis_cycle_pointer_sniping_dpi`, but do not write to
  73. * EEPROM.
  74. *
  75. * This means that reseting the board will revert the value to the last
  76. * persisted one.
  77. */
  78. void charybdis_cycle_pointer_sniping_dpi_noeeprom(bool forward);
  79. /** \brief Whether sniper-mode is enabled. */
  80. bool charybdis_get_pointer_sniping_enabled(void);
  81. /**
  82. * \brief Enable/disable sniper mode.
  83. *
  84. * When sniper mode is enabled the dpi is reduced to slow down the pointer for
  85. * more accurate movements.
  86. */
  87. void charybdis_set_pointer_sniping_enabled(bool enable);
  88. /** \brief Whether drag-scroll is enabled. */
  89. bool charybdis_get_pointer_dragscroll_enabled(void);
  90. /**
  91. * \brief Enable/disable drag-scroll mode.
  92. *
  93. * When drag-scroll mode is enabled, horizontal and vertical pointer movements
  94. * are translated into horizontal and vertical scroll movements.
  95. */
  96. void charybdis_set_pointer_dragscroll_enabled(bool enable);
  97. #endif // POINTING_DEVICE_ENABLE