~jagtalon/qmk-ploopy-trackball

25b845c63795dcba3af9dfc215a0446fc0aae079 — Jag Talon 2 years ago
Initial commit
3 files changed, 90 insertions(+), 0 deletions(-)

A config.h
A keymap.c
A readme.md
A  => config.h +12 -0
@@ 1,12 @@
// Mouse sensitivity settings:
// DPI is too sensitive by default. Change to 300.
#define PLOOPY_DPI_OPTIONS { 300 }
#define PLOOPY_DPI_DEFAULT 0

// Drag scroll settings:
// - Half the DPI above
// - Invert scrolling
// - Only drag scroll while holding keys
#define PLOOPY_DRAGSCROLL_MULTIPLIER 0.5
#define PLOOPY_DRAGSCROLL_INVERT 1
#define PLOOPY_DRAGSCROLL_MOMENTARY 1

A  => keymap.c +73 -0
@@ 1,73 @@
/* Copyright 2022 Jag Talon
 * Copyright 2020 Christopher Courtney, aka Drashna Jael're  (@drashna) <drashna@live.com>
 * Copyright 2019 Sunjun Kim
 * Copyright 2020 Ploopy Corporation
 *
 * 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

// Custom keycodes for Ploopy.
enum custom_ploopy {
    CTRL_TAB = SAFE_RANGE,
    CTRL_SHIFT_TAB,
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT(
        KC_BTN1, LT(2, KC_BTN3), KC_BTN2,
          KC_BTN4, LT(1, KC_BTN5)
    ),
    // Drag scroll:
    // Hold button 5 and button 1 while rolling the trackball.
    [1] = LAYOUT(
        DRAG_SCROLL, _______, _______,
          _______, _______
    ),
    // Browser navigation:
    // Hold middle button + button 4 = Ctrl + Tab
    // Hold middle button + button 5 = Ctrl + Shift + Tab
    [2] = LAYOUT(
        _______, _______, _______,
          CTRL_TAB, CTRL_SHIFT_TAB
    )
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    switch (keycode) {
        case CTRL_TAB:
            if (record->event.pressed) {
                register_code(KC_LEFT_CTRL);
                register_code(KC_TAB);
            } else {
                unregister_code(KC_LEFT_CTRL);
                unregister_code(KC_TAB);
            }
            return false;
        case CTRL_SHIFT_TAB:
            if (record->event.pressed) {
                register_code(KC_LEFT_CTRL);
                register_code(KC_LEFT_SHIFT);
                register_code(KC_TAB);
            } else {
                unregister_code(KC_LEFT_CTRL);
                unregister_code(KC_LEFT_SHIFT);
                unregister_code(KC_TAB);
            }
            return false;
        default:
            return true;
    }
}
\ No newline at end of file

A  => readme.md +5 -0
@@ 1,5 @@
# Jag's Ploopy Customizations

- Move files to `qmk_firmware/keyboards/ploopyco/trackball/keymaps/jagtalon`
- Compile by running `qmk compile -kb ploopyco/trackball/rev1_005 -km jagtalon`
- [Flash the firmware](https://github.com/ploopyco/classic-trackball/wiki/Appendix-C:-QMK-Firmware-Programming): `qmk flash -kb ploopyco/trackball/rev1_005 -km jagtalon`
\ No newline at end of file