qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

tractyl_manuform.h (3539B)


      1 /* Copyright 2020 Christopher Courtney, aka Drashna Jael're  (@drashna) <drashna@live.com>
      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 
     17 #pragma once
     18 
     19 #include "quantum.h"
     20 
     21 enum charybdis_keycodes {
     22     POINTER_DEFAULT_DPI_FORWARD = QK_KB_0,
     23     POINTER_DEFAULT_DPI_REVERSE,
     24     POINTER_SNIPING_DPI_FORWARD,
     25     POINTER_SNIPING_DPI_REVERSE,
     26     SNIPING_MODE,
     27     SNIPING_MODE_TOGGLE,
     28     DRAGSCROLL_MODE,
     29     DRAGSCROLL_MODE_TOGGLE,
     30 };
     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 
     41 #ifdef POINTING_DEVICE_ENABLE
     42 /** \brief Return the current DPI value for the pointer's default mode. */
     43 uint16_t charybdis_get_pointer_default_dpi(void);
     44 
     45 /**
     46  * \brief Update the pointer's default DPI to the next or previous step.
     47  *
     48  * Increases the DPI value if `forward` is `true`, decreases it otherwise.
     49  * The increment/decrement steps are equal to CHARYBDIS_DEFAULT_DPI_CONFIG_STEP.
     50  *
     51  * The new value is persisted in EEPROM.
     52  */
     53 void charybdis_cycle_pointer_default_dpi(bool forward);
     54 
     55 /**
     56  * \brief Same as `charybdis_cycle_pointer_default_dpi`, but do not write to
     57  * EEPROM.
     58  *
     59  * This means that reseting the board will revert the value to the last
     60  * persisted one.
     61  */
     62 void charybdis_cycle_pointer_default_dpi_noeeprom(bool forward);
     63 
     64 /** \brief Return the current DPI value for the pointer's sniper-mode. */
     65 uint16_t charybdis_get_pointer_sniping_dpi(void);
     66 
     67 /**
     68  * \brief Update the pointer's sniper-mode DPI to the next or previous step.
     69  *
     70  * Increases the DPI value if `forward` is `true`, decreases it otherwise.
     71  * The increment/decrement steps are equal to CHARYBDIS_SNIPING_DPI_CONFIG_STEP.
     72  *
     73  * The new value is persisted in EEPROM.
     74  */
     75 void charybdis_cycle_pointer_sniping_dpi(bool forward);
     76 
     77 /**
     78  * \brief Same as `charybdis_cycle_pointer_sniping_dpi`, but do not write to
     79  * EEPROM.
     80  *
     81  * This means that reseting the board will revert the value to the last
     82  * persisted one.
     83  */
     84 void charybdis_cycle_pointer_sniping_dpi_noeeprom(bool forward);
     85 
     86 /** \brief Whether sniper-mode is enabled. */
     87 bool charybdis_get_pointer_sniping_enabled(void);
     88 
     89 /**
     90  * \brief Enable/disable sniper mode.
     91  *
     92  * When sniper mode is enabled the dpi is reduced to slow down the pointer for
     93  * more accurate movements.
     94  */
     95 void charybdis_set_pointer_sniping_enabled(bool enable);
     96 
     97 /** \brief Whether drag-scroll is enabled. */
     98 bool charybdis_get_pointer_dragscroll_enabled(void);
     99 
    100 /**
    101  * \brief Enable/disable drag-scroll mode.
    102  *
    103  * When drag-scroll mode is enabled, horizontal and vertical pointer movements
    104  * are translated into horizontal and vertical scroll movements.
    105  */
    106 void charybdis_set_pointer_dragscroll_enabled(bool enable);
    107 #endif // POINTING_DEVICE_ENABLE