summaryrefslogtreecommitdiffstats
path: root/keyboards/bastardkb/charybdis/3x5/keymaps/via
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/bastardkb/charybdis/3x5/keymaps/via')
-rw-r--r--keyboards/bastardkb/charybdis/3x5/keymaps/via/config.h13
-rw-r--r--keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c42
2 files changed, 28 insertions, 27 deletions
diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/via/config.h b/keyboards/bastardkb/charybdis/3x5/keymaps/via/config.h
index f515d85334..d20131e9cf 100644
--- a/keyboards/bastardkb/charybdis/3x5/keymaps/via/config.h
+++ b/keyboards/bastardkb/charybdis/3x5/keymaps/via/config.h
@@ -19,7 +19,7 @@
#ifdef VIA_ENABLE
/* VIA configuration. */
# define DYNAMIC_KEYMAP_LAYER_COUNT 7
-#endif // VIA_ENABLE
+#endif // VIA_ENABLE
/* Disable unused features. */
#define NO_ACTION_ONESHOT
@@ -33,7 +33,7 @@
* See docs.qmk.fm/using-qmk/software-features/tap_hold#tapping-term
*/
# define TAPPING_TERM 200
-#endif // TAPPING_TERM
+#endif // TAPPING_TERM
/**
* \brief Enable rapid switch from tap to hold.
@@ -84,16 +84,11 @@
/* Charybdis-specific features. */
#ifdef POINTING_DEVICE_ENABLE
-// Enable pointer acceleration, which increases the speed by ~2x for large
-// displacement, while maintaining 1x speed for slow movements. See also:
-// - `CHARYBDIS_POINTER_ACCELERATION_FACTOR`
-# define CHARYBDIS_POINTER_ACCELERATION_ENABLE
-
// Automatically enable the pointer layer when moving the trackball. See also:
// - `CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS`
// - `CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD`
// #define CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
-#endif // POINTING_DEVICE_ENABLE
+#endif // POINTING_DEVICE_ENABLE
/* RGB Matrix. */
@@ -115,4 +110,4 @@
# define RGB_MATRIX_STARTUP_SAT 255
# define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS
# define RGB_MATRIX_STARTUP_HSV RGB_MATRIX_STARTUP_HUE, RGB_MATRIX_STARTUP_SAT, RGB_MATRIX_STARTUP_VAL
-#endif // RGB_MATRIX_ENABLE
+#endif // RGB_MATRIX_ENABLE
diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c b/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c
index dc02ed34c6..b54c58cf0c 100644
--- a/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c
+++ b/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c
@@ -18,7 +18,7 @@
#ifdef CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
# include "timer.h"
-#endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
+#endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
enum charybdis_keymap_layers {
LAYER_BASE = 0,
@@ -38,12 +38,12 @@ static uint16_t auto_pointer_layer_timer = 0;
# ifndef CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS
# define CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS 1000
-# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS
+# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS
# ifndef CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD
# define CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD 8
-# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD
-#endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
+# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD
+#endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
#define ESC_MED LT(LAYER_MEDIA, KC_ESC)
#define SPC_NAV LT(LAYER_NAVIGATION, KC_SPC)
@@ -52,6 +52,13 @@ static uint16_t auto_pointer_layer_timer = 0;
#define BSP_NUM LT(LAYER_NUMERAL, KC_BSPC)
#define _L_PTR(KC) LT(LAYER_POINTER, KC)
+#ifndef POINTING_DEVICE_ENABLE
+# define DRGSCRL KC_NO
+# define DPI_MOD KC_NO
+# define S_D_MOD KC_NO
+# define SNIPING KC_NO
+#endif // !POINTING_DEVICE_ENABLE
+
// clang-format off
/** \brief QWERTY layout (3 rows, 10 columns). */
#define LAYOUT_LAYER_BASE \
@@ -98,14 +105,14 @@ static uint16_t auto_pointer_layer_timer = 0;
#define LAYOUT_LAYER_MEDIA \
XXXXXXX,RGB_RMOD, RGB_TOG, RGB_MOD, XXXXXXX, XXXXXXX,RGB_RMOD, RGB_TOG, RGB_MOD, XXXXXXX, \
KC_MPRV, KC_VOLD, KC_MUTE, KC_VOLU, KC_MNXT, KC_MPRV, KC_VOLD, KC_MUTE, KC_VOLU, KC_MNXT, \
- XXXXXXX, XXXXXXX, XXXXXXX, EEP_RST, QK_BOOT, QK_BOOT, EEP_RST, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, XXXXXXX, XXXXXXX, EEP_RST, QK_BOOT, QK_BOOT, EEP_RST, XXXXXXX, XXXXXXX, XXXXXXX, \
_______, KC_MPLY, KC_MSTP, KC_MSTP, KC_MPLY
/** \brief Mouse emulation and pointer functions. */
#define LAYOUT_LAYER_POINTER \
XXXXXXX, XXXXXXX, XXXXXXX, DPI_MOD, S_D_MOD, S_D_MOD, DPI_MOD, XXXXXXX, XXXXXXX, XXXXXXX, \
______________HOME_ROW_GACS_L______________, ______________HOME_ROW_GACS_R______________, \
- _______, DRGSCRL, SNIPING, EEP_RST, QK_BOOT, QK_BOOT, EEP_RST, SNIPING, DRGSCRL, _______, \
+ _______, DRGSCRL, SNIPING, EEP_RST, QK_BOOT, QK_BOOT, EEP_RST, SNIPING, DRGSCRL, _______, \
KC_BTN2, KC_BTN1, KC_BTN3, KC_BTN3, KC_BTN1
/**
@@ -217,36 +224,35 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) {
# ifdef RGB_MATRIX_ENABLE
rgb_matrix_mode_noeeprom(RGB_MATRIX_NONE);
rgb_matrix_sethsv_noeeprom(HSV_GREEN);
-# endif // RGB_MATRIX_ENABLE
+# endif // RGB_MATRIX_ENABLE
}
auto_pointer_layer_timer = timer_read();
}
return mouse_report;
}
-void matrix_scan_kb(void) {
+void matrix_scan_user(void) {
if (auto_pointer_layer_timer != 0 && TIMER_DIFF_16(timer_read(), auto_pointer_layer_timer) >= CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS) {
auto_pointer_layer_timer = 0;
layer_off(LAYER_POINTER);
# ifdef RGB_MATRIX_ENABLE
rgb_matrix_mode_noeeprom(RGB_MATRIX_STARTUP_MODE);
-# endif // RGB_MATRIX_ENABLE
+# endif // RGB_MATRIX_ENABLE
}
- matrix_scan_user();
}
-# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
+# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
# ifdef CHARYBDIS_AUTO_SNIPING_ON_LAYER
-layer_state_t layer_state_set_kb(layer_state_t state) {
- state = layer_state_set_user(state);
+layer_state_t layer_state_set_user(layer_state_t state) {
charybdis_set_pointer_sniping_enabled(layer_state_cmp(state, CHARYBDIS_AUTO_SNIPING_ON_LAYER));
return state;
}
-# endif // CHARYBDIS_AUTO_SNIPING_ON_LAYER
-#endif // POINTING_DEVICE_ENABLE
+# endif // CHARYBDIS_AUTO_SNIPING_ON_LAYER
+#endif // POINTING_DEVICE_ENABLE
#ifdef RGB_MATRIX_ENABLE
-// Forward-declare this helper function since it is defined in rgb_matrix.c.
+// Forward-declare this helper function since it is defined in
+// rgb_matrix.c.
void rgb_matrix_update_pwm_buffers(void);
#endif
@@ -255,9 +261,9 @@ void shutdown_user(void) {
rgblight_enable_noeeprom();
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
rgblight_setrgb_red();
-#endif // RGBLIGHT_ENABLE
+#endif // RGBLIGHT_ENABLE
#ifdef RGB_MATRIX_ENABLE
rgb_matrix_set_color_all(RGB_RED);
rgb_matrix_update_pwm_buffers();
-#endif // RGB_MATRIX_ENABLE
+#endif // RGB_MATRIX_ENABLE
}