Skip to content

Commit

Permalink
charbdys nano left trackball
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed May 27, 2022
1 parent 82828c3 commit 55c03bb
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 5 deletions.
6 changes: 3 additions & 3 deletions keyboards/bastardkb/charybdis/3x5/3x5.h
Expand Up @@ -25,17 +25,17 @@
k00, k01, k02, k03, k04, k44, k43, k42, k41, k40, \
k10, k11, k12, k13, k14, k54, k53, k52, k51, k50, \
k20, k21, k22, k23, k24, k64, k63, k62, k61, k60, \
k32, k33, k30, k70, k72 \
k32, k30, k70, k73, k72 \
) \
{ \
{ k00, k01, k02, k03, k04 }, \
{ k10, k11, k12, k13, k14 }, \
{ k20, k21, k22, k23, k24 }, \
{ k30, KC_NO, k32, k33, KC_NO }, \
{ k30, KC_NO, k32, KC_NO, KC_NO }, \
{ k40, k41, k42, k43, k44 }, \
{ k50, k51, k52, k53, k54 }, \
{ k60, k61, k62, k63, k64 }, \
{ k70, KC_NO, k72, KC_NO, KC_NO }, \
{ k70, KC_NO, k72, k73, KC_NO }, \
}

/**
Expand Down
2 changes: 1 addition & 1 deletion keyboards/bastardkb/charybdis/3x5/config.h
Expand Up @@ -44,7 +44,7 @@
#define DIODE_DIRECTION ROW2COL

/* Handedness. */
#define MASTER_RIGHT
#define MASTER_LEFT

/* Bootmagic Lite configuration. */
#define BOOTMAGIC_LITE_ROW 0
Expand Down
26 changes: 26 additions & 0 deletions keyboards/bastardkb/charybdis/3x5/keymaps/joshi/config.h
@@ -0,0 +1,26 @@
/**
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once

#undef ROTATIONAL_TRANSFORM_ANGLE
#define ROTATIONAL_TRANSFORM_ANGLE -105


#define TAPPING_FORCE_HOLD
#define TAPPING_TERM 150
#define PERMISSIVE_HOLD
#define IGNORE_MOD_TAP_INTERRUPT
174 changes: 174 additions & 0 deletions keyboards/bastardkb/charybdis/3x5/keymaps/joshi/keymap.c
@@ -0,0 +1,174 @@
/**
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H


// Todo: ZMK Combos; Caps Word

enum charybdis_keymap_layers {
LAYER_BASE = 0,
LAYER_NAV,
LAYER_NUM,
LAYER_FUNC,
LAYER_SYM,
LAYER_PNTR,
LAYER_EMPTY
};

#define TMB_1 LT(LAYER_NAV, KC_BACKSPACE)
#define TMB_2 LT(LAYER_NUM, KC_DELETE)
#define TMB_3 LT(LAYER_FUNC, KC_ENTER)
#define TMB_4 LT(LAYER_SYM, KC_SPACE)
#define TMB_5 LT(LAYER_PNTR, KC_MINUS)


enum custom_keycodes {
BALL_SCROLL = SAFE_RANGE,
BALL_SNIPING
};

bool is_scrolling = false;
bool is_sniping = false;


#define DPI_NORMAL 700
#define DPI_SNIPE 2000
#define DPI_SCROLL 100


// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[LAYER_BASE] = LAYOUT_charybdis_3x5(
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
TMB_1, TMB_2, TMB_3, TMB_4, TMB_5
// ╰────────────────╯ ╰────────────────────────────╯
),

[LAYER_NAV] = LAYOUT_charybdis_3x5(
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDN, KC_PGUP, KC_END, XXXXXXX,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_LGUI, KC_LALT, KC_LSFT, KC_LCTL, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, KC_DEL, XXXXXXX, XXXXXXX,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
// ╰──────────────────╯ ╰───────────────────────────╯
),


[LAYER_NUM] = LAYOUT_charybdis_3x5(
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
KC_PLUS, KC_MINS, KC_ASTR, KC_SLSH, KC_EQL, XXXXXXX, KC_7, KC_8, KC_9, KC_0,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_LGUI, KC_LALT, KC_LSFT, KC_LCTL, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, KC_0,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
XXXXXXX, XXXXXXX, KC_DOT, KC_COMM, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_0,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX
// ╰──────────────────╯ ╰───────────────────────────╯
),




[LAYER_SYM] = LAYOUT_charybdis_3x5(
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
KC_GRV, KC_DLR, KC_EXLM, KC_LCBR, KC_RCBR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_BSLS, KC_NUHS, KC_AMPR, KC_LPRN, KC_RPRN, XXXXXXX, KC_RCTL, KC_RSFT, KC_RALT, KC_RGUI,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_MINS, KC_UNDS, KC_PIPE, KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX
// ╰──────────────────╯ ╰───────────────────────────╯
),

[LAYER_FUNC] = LAYOUT_charybdis_3x5(
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
KC_F12, KC_F7, KC_F8, KC_F9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_F11, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, KC_RCTL, KC_RSFT, KC_RALT, KC_RGUI,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_F10, KC_F1, KC_F2, KC_F3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX
// ╰──────────────────╯ ╰───────────────────────────╯
),


[LAYER_PNTR] = LAYOUT_charybdis_3x5(
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN3, KC_BTN2, BALL_SCROLL,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BALL_SNIPING,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______
// ╰──────────────────╯ ╰───────────────────────────╯
),

[LAYER_EMPTY] = LAYOUT_charybdis_3x5(
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
// ╰──────────────────╯ ╰───────────────────────────╯
),
};
// clang-format on


report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) {
if (is_scrolling) {
mouse_report.h = mouse_report.x;
mouse_report.v = mouse_report.y;
mouse_report.x = 0;
mouse_report.y = 0;
}
return mouse_report;
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {

switch (keycode) {
case BALL_SCROLL:
is_scrolling = !is_scrolling;
pointing_device_set_cpi(is_scrolling ? DPI_SCROLL : DPI_NORMAL);

return false;

case BALL_SNIPING:
is_sniping = !is_sniping;
pointing_device_set_cpi(is_sniping ? DPI_SNIPE : DPI_NORMAL);

return false;
}

return true;
}
7 changes: 7 additions & 0 deletions keyboards/bastardkb/charybdis/3x5/keymaps/joshi/readme.md
@@ -0,0 +1,7 @@
# Charybdis (3x5) default keymap

> :bulb: Have a look at the [`via` keymap](../via) for a more feature-rich layout.
The Charydbis (3x5) default keymap is inspired from the original [Dactyl Manuform](../../../../../handwired/dactyl_manuform) default keymap.

This layout supports RGB matrix. However, due to space constraints on the MCU, only a limited number of effect can be enabled at once. Look at the `config.h` file and enable your favorite effect.
38 changes: 38 additions & 0 deletions keyboards/bastardkb/charybdis/3x5/keymaps/joshi/rules.mk
@@ -0,0 +1,38 @@
# MCU name
MCU = atmega32u4

# Bootloader selection
BOOTLOADER = atmel-dfu

# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = no # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output

AUDIO_SUPPORTED = no # Audio is not supported
RGB_MATRIX_SUPPORTED = no # RGB matrix is supported and enabled by default
RGBLIGHT_SUPPORTED = no # RGB underglow is supported, but not enabled by default
RGB_MATRIX_ENABLE = no # Enable keyboard RGB matrix functionality
RGB_MATRIX_DRIVER = WS2812

# Enable link-time optimization by default. The Charybdis packs a lot of
# features (RGB, Via, trackball) in a small atmega32u4 package.
LTO_ENABLE = yes

# Charybdis nano is a split 3x5 keyboard with a maximum of 3 thumb keys (2 on
# the trackball side).
SPLIT_KEYBOARD = yes
LAYOUTS = split_3x5_3 # Support community layout, in particular Manna-Harbour's Miryoku layout

POINTING_DEVICE_ENABLE = yes # Enable trackball
POINTING_DEVICE_DRIVER = pmw3360
# https://qmk.fm/changes/2018-11-16-use-a-single-endpoint-for-hid-reports
MOUSE_SHARED_EP = no # Unify multiple HID interfaces into a single Endpoint
2 changes: 1 addition & 1 deletion keyboards/bastardkb/charybdis/config.h
Expand Up @@ -26,7 +26,7 @@
#define SPLIT_POINTING_ENABLE

// Pointing device is on the right split.
#define POINTING_DEVICE_RIGHT
#define POINTING_DEVICE_LEFT

// Limits the frequency that the sensor is polled for motion.
#define POINTING_DEVICE_TASK_THROTTLE_MS 1
Expand Down

0 comments on commit 55c03bb

Please sign in to comment.