nerdboard

This commit is contained in:
lowprokill
2025-08-19 11:03:39 -07:00
parent 1a58fce043
commit da92b16b31
28 changed files with 1738 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
/*
Copyright 2023 Jon Hull
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
/* disable debug print */
// #define NO_DEBUG
/* disable print */
// #define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
#define SPLIT_POINTING_ENABLE
#define POINTING_DEVICE_TASK_THROTTLE_MS 1
#define SPLIT_TRANSACTION_IDS_KB RPC_ID_KB_CONFIG_SYNC

View File

@@ -0,0 +1,7 @@
{
"manufacturer": "QMK Community",
"maintainer": "thelowprokill",
"usb": {
"vid": "0x44DD"
}
}

View File

@@ -0,0 +1,378 @@
/* Copyright 2023 Christopher Courtney <drashna@live.com> (@drashna)
*
* 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 "nerdboard.h"
#include "transactions.h"
#include <string.h>
#ifdef CONSOLE_ENABLE
# include "print.h"
#endif // CONSOLE_ENABLE
#ifdef POINTING_DEVICE_ENABLE
# ifndef CHARYBDIS_MINIMUM_DEFAULT_DPI
# define CHARYBDIS_MINIMUM_DEFAULT_DPI 400
# endif // CHARYBDIS_MINIMUM_DEFAULT_DPI
# ifndef CHARYBDIS_DEFAULT_DPI_CONFIG_STEP
# define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 200
# endif // CHARYBDIS_DEFAULT_DPI_CONFIG_STEP
# ifndef CHARYBDIS_MINIMUM_SNIPING_DPI
# define CHARYBDIS_MINIMUM_SNIPING_DPI 200
# endif // CHARYBDIS_MINIMUM_SNIPER_MODE_DPI
# ifndef CHARYBDIS_SNIPING_DPI_CONFIG_STEP
# define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 100
# endif // CHARYBDIS_SNIPING_DPI_CONFIG_STEP
// Fixed DPI for drag-scroll.
# ifndef CHARYBDIS_DRAGSCROLL_DPI
# define CHARYBDIS_DRAGSCROLL_DPI 100
# endif // CHARYBDIS_DRAGSCROLL_DPI
# ifndef CHARYBDIS_DRAGSCROLL_BUFFER_SIZE
# define CHARYBDIS_DRAGSCROLL_BUFFER_SIZE 6
# endif // !CHARYBDIS_DRAGSCROLL_BUFFER_SIZE
# ifndef CHARYBDIS_POINTER_ACCELERATION_FACTOR
# define CHARYBDIS_POINTER_ACCELERATION_FACTOR 24
# endif // !CHARYBDIS_POINTER_ACCELERATION_FACTOR
typedef union {
uint8_t raw;
struct {
uint8_t pointer_default_dpi : 4; // 16 steps available.
uint8_t pointer_sniping_dpi : 2; // 4 steps available.
bool is_dragscroll_enabled : 1;
bool is_sniping_enabled : 1;
} __attribute__((packed));
} charybdis_config_t;
static charybdis_config_t g_charybdis_config = {0};
/**
* \brief Set the value of `config` from EEPROM.
*
* Note that `is_dragscroll_enabled` and `is_sniping_enabled` are purposefully
* ignored since we do not want to persist this state to memory. In practice,
* this state is always written to maximize write-performances. Therefore, we
* explicitly set them to `false` in this function.
*/
static void read_charybdis_config_from_eeprom(charybdis_config_t* config) {
config->raw = eeconfig_read_kb() & 0xff;
config->is_dragscroll_enabled = false;
config->is_sniping_enabled = false;
}
/**
* \brief Save the value of `config` to eeprom.
*
* Note that all values are written verbatim, including whether drag-scroll
* and/or sniper mode are enabled. `read_charybdis_config_from_eeprom(…)`
* resets these 2 values to `false` since it does not make sense to persist
* these across reboots of the board.
*/
static void write_charybdis_config_to_eeprom(charybdis_config_t* config) { eeconfig_update_kb(config->raw); }
/** \brief Return the current value of the pointer's default DPI. */
static uint16_t get_pointer_default_dpi(charybdis_config_t* config) { return (uint16_t)config->pointer_default_dpi * CHARYBDIS_DEFAULT_DPI_CONFIG_STEP + CHARYBDIS_MINIMUM_DEFAULT_DPI; }
/** \brief Return the current value of the pointer's sniper-mode DPI. */
static uint16_t get_pointer_sniping_dpi(charybdis_config_t* config) { return (uint16_t)config->pointer_sniping_dpi * CHARYBDIS_SNIPING_DPI_CONFIG_STEP + CHARYBDIS_MINIMUM_SNIPING_DPI; }
/** \brief Set the appropriate DPI for the input config. */
static void maybe_update_pointing_device_cpi(charybdis_config_t* config) {
if (config->is_dragscroll_enabled) {
pointing_device_set_cpi(CHARYBDIS_DRAGSCROLL_DPI);
} else if (config->is_sniping_enabled) {
pointing_device_set_cpi(get_pointer_sniping_dpi(config));
} else {
pointing_device_set_cpi(get_pointer_default_dpi(config));
}
}
/**
* \brief Update the pointer's default DPI to the next or previous step.
*
* Increases the DPI value if `forward` is `true`, decreases it otherwise.
* The increment/decrement steps are equal to CHARYBDIS_DEFAULT_DPI_CONFIG_STEP.
*/
static void step_pointer_default_dpi(charybdis_config_t* config, bool forward) {
config->pointer_default_dpi += forward ? 1 : -1;
maybe_update_pointing_device_cpi(config);
}
/**
* \brief Update the pointer's sniper-mode DPI to the next or previous step.
*
* Increases the DPI value if `forward` is `true`, decreases it otherwise.
* The increment/decrement steps are equal to CHARYBDIS_SNIPING_DPI_CONFIG_STEP.
*/
static void step_pointer_sniping_dpi(charybdis_config_t* config, bool forward) {
config->pointer_sniping_dpi += forward ? 1 : -1;
maybe_update_pointing_device_cpi(config);
}
uint16_t charybdis_get_pointer_default_dpi(void) { return get_pointer_default_dpi(&g_charybdis_config); }
uint16_t charybdis_get_pointer_sniping_dpi(void) { return get_pointer_sniping_dpi(&g_charybdis_config); }
void charybdis_cycle_pointer_default_dpi_noeeprom(bool forward) { step_pointer_default_dpi(&g_charybdis_config, forward); }
void charybdis_cycle_pointer_default_dpi(bool forward) {
step_pointer_default_dpi(&g_charybdis_config, forward);
write_charybdis_config_to_eeprom(&g_charybdis_config);
}
void charybdis_cycle_pointer_sniping_dpi_noeeprom(bool forward) { step_pointer_sniping_dpi(&g_charybdis_config, forward); }
void charybdis_cycle_pointer_sniping_dpi(bool forward) {
step_pointer_sniping_dpi(&g_charybdis_config, forward);
write_charybdis_config_to_eeprom(&g_charybdis_config);
}
bool charybdis_get_pointer_sniping_enabled(void) { return g_charybdis_config.is_sniping_enabled; }
void charybdis_set_pointer_sniping_enabled(bool enable) {
g_charybdis_config.is_sniping_enabled = enable;
maybe_update_pointing_device_cpi(&g_charybdis_config);
}
bool charybdis_get_pointer_dragscroll_enabled(void) { return g_charybdis_config.is_dragscroll_enabled; }
void charybdis_set_pointer_dragscroll_enabled(bool enable) {
g_charybdis_config.is_dragscroll_enabled = enable;
maybe_update_pointing_device_cpi(&g_charybdis_config);
}
# ifndef CONSTRAIN_HID
# define CONSTRAIN_HID(value) ((value) < XY_REPORT_MIN ? XY_REPORT_MIN : ((value) > XY_REPORT_MAX ? XY_REPORT_MAX : (value)))
# endif // !CONSTRAIN_HID
/**
* \brief Add optional acceleration effect.
*
* If `CHARYBDIS_ENABLE_POINTER_ACCELERATION` is defined, add a simple and naive
* acceleration effect to the provided value. Return the value unchanged
* otherwise.
*/
# ifndef DISPLACEMENT_WITH_ACCELERATION
# ifdef CHARYBDIS_POINTER_ACCELERATION_ENABLE
# define DISPLACEMENT_WITH_ACCELERATION(d) (CONSTRAIN_HID(d > 0 ? d * d / CHARYBDIS_POINTER_ACCELERATION_FACTOR + d : -d * d / CHARYBDIS_POINTER_ACCELERATION_FACTOR + d))
# else // !CHARYBDIS_POINTER_ACCELERATION_ENABLE
# define DISPLACEMENT_WITH_ACCELERATION(d) (d)
# endif // CHARYBDIS_POINTER_ACCELERATION_ENABLE
# endif // !DISPLACEMENT_WITH_ACCELERATION
/**
* \brief Augment the pointing device behavior.
*
* Implement the Charybdis-specific features for pointing devices:
* - Drag-scroll
* - Sniping
* - Acceleration
*/
static void pointing_device_task_charybdis(report_mouse_t* mouse_report) {
static int16_t scroll_buffer_x = 0;
static int16_t scroll_buffer_y = 0;
if (g_charybdis_config.is_dragscroll_enabled) {
# ifdef CHARYBDIS_DRAGSCROLL_REVERSE_X
scroll_buffer_x -= mouse_report->x;
# else
scroll_buffer_x += mouse_report->x;
# endif // CHARYBDIS_DRAGSCROLL_REVERSE_X
# ifdef CHARYBDIS_DRAGSCROLL_REVERSE_Y
scroll_buffer_y -= mouse_report->y;
# else
scroll_buffer_y += mouse_report->y;
# endif // CHARYBDIS_DRAGSCROLL_REVERSE_Y
mouse_report->x = 0;
mouse_report->y = 0;
if (abs(scroll_buffer_x) > CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) {
mouse_report->h = scroll_buffer_x > 0 ? 1 : -1;
scroll_buffer_x = 0;
}
if (abs(scroll_buffer_y) > CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) {
mouse_report->v = scroll_buffer_y > 0 ? 1 : -1;
scroll_buffer_y = 0;
}
} else if (!g_charybdis_config.is_sniping_enabled) {
mouse_report->x = DISPLACEMENT_WITH_ACCELERATION(mouse_report->x);
mouse_report->y = DISPLACEMENT_WITH_ACCELERATION(mouse_report->y);
}
}
report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) {
pointing_device_task_charybdis(&mouse_report);
mouse_report = pointing_device_task_user(mouse_report);
return mouse_report;
}
# if defined(POINTING_DEVICE_ENABLE) && !defined(NO_CHARYBDIS_KEYCODES)
/** \brief Whether SHIFT mod is enabled. */
static bool has_shift_mod(void) {
# ifdef NO_ACTION_ONESHOT
return mod_config(get_mods()) & MOD_MASK_SHIFT;
# else
return mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT;
# endif // NO_ACTION_ONESHOT
}
# endif // POINTING_DEVICE_ENABLE && !NO_CHARYBDIS_KEYCODES
/**
* \brief Outputs the Charybdis configuration to console.
*
* Prints the in-memory configuration structure to console, for debugging.
* Includes:
* - raw value
* - drag-scroll: on/off
* - sniping: on/off
* - default DPI: internal table index/actual DPI
* - sniping DPI: internal table index/actual DPI
*/
__attribute__((unused)) static void debug_charybdis_config_to_console(charybdis_config_t* config) {
# ifdef CONSOLE_ENABLE
IGNORE_FORMAT_WARNING(dprintf("(charybdis) process_record_kb: config = {\n"
"\traw = 0x%04X,\n"
"\t{\n"
"\t\tis_dragscroll_enabled=%b\n"
"\t\tis_sniping_enabled=%b\n"
"\t\tdefault_dpi=0x%02X (%ld)\n"
"\t\tsniping_dpi=0x%01X (%ld)\n"
"\t}\n"
"}\n",
config->raw, config->is_dragscroll_enabled, config->is_sniping_enabled, config->pointer_default_dpi, get_pointer_default_dpi(config), config->pointer_sniping_dpi, get_pointer_sniping_dpi(config)));
# endif // CONSOLE_ENABLE
}
bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
if (!process_record_user(keycode, record)) {
return false;
}
# ifndef NO_CHARYBDIS_KEYCODES
switch (keycode) {
case POINTER_DEFAULT_DPI_FORWARD:
if (record->event.pressed) {
// Step backward if shifted, forward otherwise.
charybdis_cycle_pointer_default_dpi(/* forward= */ !has_shift_mod());
}
break;
case POINTER_DEFAULT_DPI_REVERSE:
if (record->event.pressed) {
// Step forward if shifted, backward otherwise.
charybdis_cycle_pointer_default_dpi(/* forward= */ has_shift_mod());
}
break;
case POINTER_SNIPING_DPI_FORWARD:
if (record->event.pressed) {
// Step backward if shifted, forward otherwise.
charybdis_cycle_pointer_sniping_dpi(/* forward= */ !has_shift_mod());
}
break;
case POINTER_SNIPING_DPI_REVERSE:
if (record->event.pressed) {
// Step forward if shifted, backward otherwise.
charybdis_cycle_pointer_sniping_dpi(/* forward= */ has_shift_mod());
}
break;
case SNIPING_MODE:
charybdis_set_pointer_sniping_enabled(record->event.pressed);
break;
case SNIPING_MODE_TOGGLE:
if (record->event.pressed) {
charybdis_set_pointer_sniping_enabled(!charybdis_get_pointer_sniping_enabled());
}
break;
case DRAGSCROLL_MODE:
charybdis_set_pointer_dragscroll_enabled(record->event.pressed);
break;
case DRAGSCROLL_MODE_TOGGLE:
if (record->event.pressed) {
charybdis_set_pointer_dragscroll_enabled(!charybdis_get_pointer_dragscroll_enabled());
}
break;
}
# endif // !NO_CHARYBDIS_KEYCODES
return true;
}
void eeconfig_init_kb(void) {
g_charybdis_config.raw = 0;
write_charybdis_config_to_eeprom(&g_charybdis_config);
maybe_update_pointing_device_cpi(&g_charybdis_config);
eeconfig_init_user();
}
void matrix_power_up(void) { pointing_device_task(); }
void charybdis_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
if (initiator2target_buffer_size == sizeof(g_charybdis_config)) {
memcpy(&g_charybdis_config, initiator2target_buffer, sizeof(g_charybdis_config));
}
}
void keyboard_post_init_kb(void) {
maybe_update_pointing_device_cpi(&g_charybdis_config);
transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, charybdis_config_sync_handler);
keyboard_post_init_user();
}
void housekeeping_task_kb(void) {
if (is_keyboard_master()) {
// Keep track of the last state, so that we can tell if we need to propagate to slave
static charybdis_config_t last_charybdis_config = {0};
static uint32_t last_sync = 0;
bool needs_sync = false;
// Check if the state values are different
if (memcmp(&g_charybdis_config, &last_charybdis_config, sizeof(g_charybdis_config))) {
needs_sync = true;
memcpy(&last_charybdis_config, &g_charybdis_config, sizeof(g_charybdis_config));
}
// Send to slave every 500ms regardless of state change
if (timer_elapsed32(last_sync) > 500) {
needs_sync = true;
}
// Perform the sync if requested
if (needs_sync) {
if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(g_charybdis_config), &g_charybdis_config)) {
last_sync = timer_read32();
}
}
}
// no need for user function, is called already
}
#endif // POINTING_DEVICE_ENABLE
__attribute__((weak)) void matrix_init_sub_kb(void) {}
void matrix_init_kb(void) {
#ifdef POINTING_DEVICE_ENABLE
read_charybdis_config_from_eeprom(&g_charybdis_config);
#endif // POINTING_DEVICE_ENABLE
matrix_init_sub_kb();
matrix_init_user();
}
__attribute__((weak)) void matrix_scan_sub_kb(void) {}
void matrix_scan_kb(void) {
matrix_scan_sub_kb();
matrix_scan_user();
}

View File

@@ -0,0 +1,115 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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
#include "quantum.h"
#if defined(KEYBOARD_handwired_nerdboard_pro_micro_29)
# include "pro_micro_29.h"
#elif defined(KEYBOARD_handwired_nerdboard_pro_micro_41)
# include "pro_micro_41.h"
#endif
enum charybdis_keycodes {
POINTER_DEFAULT_DPI_FORWARD = QK_KB_0,
POINTER_DEFAULT_DPI_REVERSE,
POINTER_SNIPING_DPI_FORWARD,
POINTER_SNIPING_DPI_REVERSE,
SNIPING_MODE,
SNIPING_MODE_TOGGLE,
DRAGSCROLL_MODE,
DRAGSCROLL_MODE_TOGGLE,
};
# define DPI_MOD POINTER_DEFAULT_DPI_FORWARD
# define DPI_RMOD POINTER_DEFAULT_DPI_REVERSE
# define S_D_MOD POINTER_SNIPING_DPI_FORWARD
# define S_D_RMOD POINTER_SNIPING_DPI_REVERSE
# define SNIPING SNIPING_MODE
# define SNP_TOG SNIPING_MODE_TOGGLE
# define DRGSCRL DRAGSCROLL_MODE
# define DRG_TOG DRAGSCROLL_MODE_TOGGLE
#ifdef POINTING_DEVICE_ENABLE
/** \brief Return the current DPI value for the pointer's default mode. */
uint16_t charybdis_get_pointer_default_dpi(void);
/**
* \brief Update the pointer's default DPI to the next or previous step.
*
* Increases the DPI value if `forward` is `true`, decreases it otherwise.
* The increment/decrement steps are equal to CHARYBDIS_DEFAULT_DPI_CONFIG_STEP.
*
* The new value is persisted in EEPROM.
*/
void charybdis_cycle_pointer_default_dpi(bool forward);
/**
* \brief Same as `charybdis_cycle_pointer_default_dpi`, but do not write to
* EEPROM.
*
* This means that reseting the board will revert the value to the last
* persisted one.
*/
void charybdis_cycle_pointer_default_dpi_noeeprom(bool forward);
/** \brief Return the current DPI value for the pointer's sniper-mode. */
uint16_t charybdis_get_pointer_sniping_dpi(void);
/**
* \brief Update the pointer's sniper-mode DPI to the next or previous step.
*
* Increases the DPI value if `forward` is `true`, decreases it otherwise.
* The increment/decrement steps are equal to CHARYBDIS_SNIPING_DPI_CONFIG_STEP.
*
* The new value is persisted in EEPROM.
*/
void charybdis_cycle_pointer_sniping_dpi(bool forward);
/**
* \brief Same as `charybdis_cycle_pointer_sniping_dpi`, but do not write to
* EEPROM.
*
* This means that reseting the board will revert the value to the last
* persisted one.
*/
void charybdis_cycle_pointer_sniping_dpi_noeeprom(bool forward);
/** \brief Whether sniper-mode is enabled. */
bool charybdis_get_pointer_sniping_enabled(void);
/**
* \brief Enable/disable sniper mode.
*
* When sniper mode is enabled the dpi is reduced to slow down the pointer for
* more accurate movements.
*/
void charybdis_set_pointer_sniping_enabled(bool enable);
/** \brief Whether drag-scroll is enabled. */
bool charybdis_get_pointer_dragscroll_enabled(void);
/**
* \brief Enable/disable drag-scroll mode.
*
* When drag-scroll mode is enabled, horizontal and vertical pointer movements
* are translated into horizontal and vertical scroll movements.
*/
void charybdis_set_pointer_dragscroll_enabled(bool enable);
#endif // POINTING_DEVICE_ENABLE
void matrix_init_sub_kb(void);
void matrix_scan_sub_kb(void);

View File

@@ -0,0 +1,96 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
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
// mouse config
#ifdef MOUSEKEY_ENABLE
# ifndef MOUSEKEY_MOVE_DELTA
# ifndef MK_KINETIC_SPEED
# define MOUSEKEY_MOVE_DELTA 5
# else
# define MOUSEKEY_MOVE_DELTA 25
# endif
# endif
# ifndef MOUSEKEY_DELAY
# ifndef MK_KINETIC_SPEED
# define MOUSEKEY_DELAY 300
# else
# define MOUSEKEY_DELAY 8
# endif
# endif
# ifndef MOUSEKEY_INTERVAL
# ifndef MK_KINETIC_SPEED
# define MOUSEKEY_INTERVAL 50
# else
# define MOUSEKEY_INTERVAL 20
# endif
# endif
# ifndef MOUSEKEY_MAX_SPEED
# define MOUSEKEY_MAX_SPEED 7
# endif
# ifndef MOUSEKEY_TIME_TO_MAX
# define MOUSEKEY_TIME_TO_MAX 60
# endif
# ifndef MOUSEKEY_INITIAL_SPEED
# define MOUSEKEY_INITIAL_SPEED 100
# endif
# ifndef MOUSEKEY_BASE_SPEED
# define MOUSEKEY_BASE_SPEED 1000
# endif
# ifndef MOUSEKEY_DECELERATED_SPEED
# define MOUSEKEY_DECELERATED_SPEED 400
# endif
# ifndef MOUSEKEY_ACCELERATED_SPEED
# define MOUSEKEY_ACCELERATED_SPEED 3000
# endif
// mouse scroll config
# ifndef MOUSEKEY_WHEEL_DELAY
# define MOUSEKEY_WHEEL_DELAY 15
# endif
# ifndef MOUSEKEY_WHEEL_DELTA
# define MOUSEKEY_WHEEL_DELTA 1
# endif
# ifndef MOUSEKEY_WHEEL_INTERVAL
# define MOUSEKEY_WHEEL_INTERVAL 50
# endif
# ifndef MOUSEKEY_WHEEL_MAX_SPEED
# define MOUSEKEY_WHEEL_MAX_SPEED 8
# endif
# ifndef MOUSEKEY_WHEEL_TIME_TO_MAX
# define MOUSEKEY_WHEEL_TIME_TO_MAX 80
# endif
# ifndef MOUSEKEY_WHEEL_INITIAL_MOVEMENTS
# define MOUSEKEY_WHEEL_INITIAL_MOVEMENTS 8
# endif
# ifndef MOUSEKEY_WHEEL_BASE_MOVEMENTS
# define MOUSEKEY_WHEEL_BASE_MOVEMENTS 48
# endif
# ifndef MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS
# define MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS 48
# endif
# ifndef MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS
# define MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS 8
# endif
#endif
#ifndef DEBOUNCE
# define DEBOUNCE 5
#endif

View File

@@ -0,0 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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
#include "pro_micro_29.h"

View File

@@ -0,0 +1,35 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
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
#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 }
#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
#define DIODE_DIRECTION COL2ROW
#define SOFT_SERIAL_PIN D3
#undef USE_I2C
#define MASTER_RIGHT
//#define PMW3360_LIFTOFF_DISTANCE 0x04
#define PMW3389_LIFTOFF_DISTANCE 0x00
/* PMW3360 Settings */
#define POINTING_DEVICE_CS_PIN B6

View File

@@ -0,0 +1,8 @@
{
"keyboard_name": "Tractyl Manuform(5x6) Arduino Micro (r)/ Pro Micro (l)",
"split": {
"soft_serial_pin": "D3"
},
"processor": "atmega32u4",
"bootloader": "caterina"
}

View File

@@ -0,0 +1,2 @@
OLED_ENABLE = yes
LTO_ENABLE = yes

View File

@@ -0,0 +1,52 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
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
#define DIODE_DIRECTION COL2ROW
#define VERSION 63
#if VERSION == 61
// version 6.1
#define ROTATIONAL_TRANSFORM_ANGLE -15
#define POINTING_DEVICE_INVERT_Y
#define CHARYBDIS_DRAGSCROLL_REVERSE_Y
#elif VERSION == 63
// version 6.3
#define ROTATIONAL_TRANSFORM_ANGLE -15
#define POINTING_DEVICE_INVERT_Y
#define CHARYBDIS_DRAGSCROLL_REVERSE_Y
#else
// version 6
#define VERSION 6
#define ROTATIONAL_TRANSFORM_ANGLE -15
#define POINTING_DEVICE_INVERT_X
#define CHARYBDIS_DRAGSCROLL_REVERSE_Y
#endif
#define DYNAMIC_KEYMAP_LAYER_COUNT 16
#define LAYER_STATE_16BIT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
#define POINTING_DEVICE_RIGHT
#define CHARYBDIS_POINTER_ACCELERATION_FACTOR 24

View File

@@ -0,0 +1,48 @@
{
"url": "",
"usb": {
"pid": "0x3536",
"device_version": "0.0.1"
},
"split": {
"bootmagic": {
"matrix": [5, 4]
}
},
"layouts": {
"LAYOUT": {
"layout": [
{"label":"L00", "x":0, "y":0},
{"label":"L01", "x":1, "y":0},
{"label":"L02", "x":2, "y":0},
{"label":"L03", "x":3, "y":0},
{"label":"R00", "x":11, "y":0},
{"label":"R01", "x":12, "y":0},
{"label":"R02", "x":13, "y":0},
{"label":"R03", "x":14, "y":0},
{"label":"L10", "x":0, "y":1},
{"label":"L11", "x":1, "y":1},
{"label":"L12", "x":2, "y":1},
{"label":"L13", "x":3, "y":1},
{"label":"R10", "x":11, "y":1},
{"label":"R11", "x":12, "y":1},
{"label":"R12", "x":13, "y":1},
{"label":"R13", "x":14, "y":1},
{"label":"L20", "x":0, "y":2},
{"label":"L21", "x":1, "y":2},
{"label":"L22", "x":2, "y":2},
{"label":"L23", "x":3, "y":2},
{"label":"R20", "x":11, "y":2},
{"label":"R21", "x":12, "y":2},
{"label":"R22", "x":13, "y":2},
{"label":"R23", "x":14, "y":2},
{"label":"L31", "x":1, "y":3},
{"label":"L32", "x":2, "y":3},
{"label":"L33", "x":3, "y":3},
{"label":"R30", "x":11, "y":3},
{"label":"R31", "x":12, "y":3}
]
}
}
}

View File

@@ -0,0 +1,164 @@
#include QMK_KEYBOARD_H
enum custom_layers {
_GAME,
_JONMAK,
_JM_EXT,
_SYMBOL,
_MOUSE,
_FUNC
};
// layer keys
#define JONMAK TG(_JONMAK)
#define GJONMAK MO(_JONMAK)
#define JM_EXT MO(_JM_EXT)
#define MOUSE MO(_MOUSE)
#define SYMBOL MO(_SYMBOL)
#define MOUSE MO(_MOUSE)
#define T_GAME TO(_GAME)
#define FUNC MO(_FUNC)
// alternate keys
#define L KC_LEFT
#define D KC_DOWN
#define U KC_UP
#define R KC_RIGHT
#define TERM LCA(KC_T)
#define PLUS LSFT(KC_EQL)
#define STAR LSFT(KC_8)
#define WS_L G(KC_PGUP)
#define WS_R G(KC_PGDN)
#define T_TAB_L LCTL(KC_PGUP)
#define T_TAB_R LCTL(KC_PGDN)
#define T_TAB_N LSFT(LCTL(KC_T))
#define T_TAB_C LSFT(LCTL(KC_W))
// mod taps
#define CTL_ENT CTL_T(KC_ENT)
#define MT_A SFT_T(KC_A)
#define MT_R CTL_T(KC_R)
#define MT_S ALT_T(KC_S)
#define MT_T SFT_T(KC_T)
#define MTQ_A SFT_T(KC_A)
#define MTQ_S CTL_T(KC_S)
#define MTQ_D ALT_T(KC_D)
#define MTQ_F SFT_T(KC_F)
// layer tap
#define MO_TAB LT(MOUSE, KC_TAB)
#define SY_GRV LT(SYMBOL, KC_GRV)
#ifdef OLED_ENABLE
#ifdef VERSION
#if VERSION == 61
char splash_screen[36] = "NerdBoard V6.1 29 Key\n\nBy: Jon Hull";
#elif VERSION == 63
char splash_screen[36] = "NerdBoard V6.3 29 Key\n\nBy: Jon Hull";
#else
char splash_screen[34] = "NerdBoard V6 29 Key\n\nBy: Jon Hull";
#endif
#else
char splash_screen[34] = "NerdBoard V6 29 Key\n\nBy: Jon Hull";
#endif
uint32_t timer = 0;
uint8_t show_splash = 1;
static void regular_use(void) {
oled_clear();
oled_set_cursor(0, 0);
oled_write("Layer: ", false);
switch (get_highest_layer(layer_state)) {
case _GAME:
oled_write("GAME", false);
break;
case _JONMAK:
oled_write("Jon MAC 29", false);
break;
case _JM_EXT:
oled_write("Jon MAC Cont.", false);
break;
case _SYMBOL:
oled_write("SYMBOLS", false);
break;
case _MOUSE:
oled_write("MOUSE", false);
break;
case _FUNC:
oled_write("FUNCTION", false);
break;
}
led_t led_state = host_keyboard_led_state();
oled_write("\n\nMods:", false);
uint8_t mod = get_mods();
if (led_state.caps_lock) { oled_write(" CAP", false); }
if (mod & MOD_MASK_SHIFT) { oled_write(" SFT", false); }
if (mod & MOD_MASK_CTRL) { oled_write(" CTL", false); }
if (mod & MOD_MASK_ALT) { oled_write(" ALT", false); }
if (mod & MOD_MASK_GUI) { oled_write(" GUI", false); }
return;
}
bool oled_task_user() {
if (timer > 100) { regular_use(); }
else { timer += 1; oled_write(splash_screen, false); }
return false;
}
#endif
void keyboard_pre_init_user(void) { layer_move(_JONMAK); }
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// needs a KC_R, and KC_F
[_GAME] = LAYOUT(
KC_TAB , KC_1 , KC_2 , KC_3 , KC_BTN3, KC_4 , KC_F , JONMAK,
KC_LSFT, KC_A , KC_W , KC_D , KC_BTN4,KC_BTN5, KC_R , SYMBOL,
KC_LALT, KC_Q , KC_S , KC_E , KC_BTN1,KC_BTN2,SNIPING,DRGSCRL,
KC_ESC ,KC_LCTL, KC_SPC, SYMBOL ,GJONMAK
),
// decide on having KC_ENT or KC_ESC here
[_JONMAK] = LAYOUT(
KC_D , KC_W , KC_F , KC_P , KC_M , KC_U , KC_Y ,KC_SCLN,
MT_A , MT_R , MT_S , MT_T , KC_N , KC_E , KC_I , KC_O ,
KC_G , KC_X , KC_C , KC_V , KC_H , KC_J , KC_K , KC_L ,
CTL_ENT, MO_TAB, KC_SPC, SY_GRV, JM_EXT
),
[_JM_EXT] = LAYOUT(
_______,_______,_______,KC_LCBR, KC_RCBR,_______,_______,_______,
KC_Z , KC_Q , KC_B ,KC_LBRC, KC_RBRC,KC_COMM, KC_DOT,KC_SLSH,
_______,_______,KC_BSLS,KC_LPRN, KC_RPRN,_______,_______,_______,
KC_LCTL,KC_LSFT,KC_SPC , SYMBOL ,_______
),
[_SYMBOL] = LAYOUT(
_______, KC_7 , KC_8 , KC_9 , KC_MINS, PLUS , STAR ,KC_SLSH,
KC_LSFT, KC_4 , KC_5 , KC_6 , KC_BSPC, KC_DEL,KC_QUOT,KC_DQUO,
KC_0 , KC_1 , KC_2 , KC_3 , L , D , U , R ,
KC_PEQL, FUNC , KC_ESC, FUNC , FUNC
),
[_MOUSE] = LAYOUT(
T_TAB_C,T_TAB_N,_______,G(KC_T), KC_BTN3,_______,_______,_______,
T_TAB_L,T_TAB_R, WS_L , WS_R , KC_BTN4,KC_BTN5,KC_RCTL,_______,
KC_LSFT,KC_LCTL,KC_LALT,KC_LGUI, KC_BTN1,KC_BTN2,SNIPING,DRGSCRL,
_______, FUNC ,_______, FUNC ,_______
),
[_FUNC] = LAYOUT(
QK_BOOT,KC_VOLU, KC_F5 ,G(KC_L), KC_INS ,KC_PSCR,QK_BOOT, T_GAME,
KC_LSFT,KC_MUTE, KC_F11, TERM , KC_LGUI,KC_MPRV,KC_MPLY,KC_MNXT,
KC_LSFT,KC_VOLD,KC_HOME, KC_END, G(L) , G(D) , G(U) , G(R) ,
_______,_______,_______, _______,_______
)
};

View File

@@ -0,0 +1,39 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 "pro_micro_29.h"
#ifdef SWAP_HANDS_ENABLE
const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
/* Left hand, matrix positions */
{{5, 6}, {4, 6}, {3, 6}, {2, 6}, {1, 6}},//, {0, 6}},
{{5, 7}, {4, 7}, {3, 7}, {2, 7}, {1, 7}},//, {0, 7}},
{{5, 8}, {4, 8}, {3, 8}, {2, 8}, {1, 8}},//, {0, 8}},
{{5, 9}, {4, 9}, {3, 9}, {2, 9}, {1, 9}},//, {0, 9}},
//{{5, 10}, {4, 10}, {3, 10}, {2, 10}, {1, 10}},//, {0, 10}},
//{{5, 11}, {4, 11}, {3, 11}, {2, 11}, {1, 11}},//, {0, 11}},
/* Right hand, matrix positions */
{{5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}},//, {0, 0}},
{{5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}},//, {0, 1}},
{{5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}},//, {0, 2}},
{{5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}}};//,//, {0, 3}},
//{{5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}}};//, {0, 4}},
//{{5, 5}, {4, 5}, {3, 5}, {2, 5}, {1, 5}},//, {0, 5}}};
# ifdef ENCODER_MAP_ENABLE
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {1, 0};
# endif
#endif

View File

@@ -0,0 +1,43 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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
#include "nerdboard.h"
#include "arduinomicro.h"
#include "quantum.h"
#define ___ KC_NO
// clang-format off
#define LAYOUT(\
L00, L01, L02, L03, R00, R01, R02, R03, \
L10, L11, L12, L13, R10, R11, R12, R13, \
L20, L21, L22, L23, R20, R21, R22, R23, \
L31, L32, L33, R30, R32 \
) \
{ \
{ L00, L01, L02, L03 }, \
{ L10, L11, L12, L13 }, \
{ L20, L21, L22, L23 }, \
{ ___, L31, L32, L33 }, \
\
{ R00, R01, R02, R03 }, \
{ R10, R11, R12, R13 }, \
{ R20, R21, R22, R23 }, \
{ R30, R32, ___, ___ } \
}
// clang-format on

View File

@@ -0,0 +1,98 @@
# Nerdboard #
Nerdboard is a 29 key split ergonomic keyboard with a built in mouse.
Build instructions can be found https://github.com/thelowprokill/nerdboard
* Keyboard Maintainer: [thelowprokill](https://github.com/thelowprokill)
* Hardware Supported: Arduino pro micro
### QMK Firmware ###
This keyboard runs on an open source keyboard firmware called Quantum Mechanical Keyboard (QMK) Firmware.
The qmk_firmware folder is the full firmware files for this keyboard, also available on git hub. [https://github.com/thelowprokill/qmk_firmware]
The nerdboard folder is just the necessary files for nerdboard.
### Set up ###
Go to https://docs.qmk.fm/#/newbs_getting_started and follow the instructions to set up qmk on your operating system.
Copy the nerdboard folder to $qmk_home/keyboards/handwired/nerdboard.
### Flash ###
qmk flash -kb handwired/nerdboard/pro_micro_29 -km default
qmk flash is the command to build the firmware and flash the keyboard.
the -kb flag specifies which keyboard to build.
the -km flag specifies which keymap to use.
This way multiple layouts can be used without copying the entire folder or overwriting existing files.
### Editiing the Keymap ###
Inside $qmk_home/keyboards/handwired/nerdboard/pro_micro_29/keymaps/
there are named folders each with a file called keymap.c
This is where your keymaps are defined.
The name of the folder is specified by the flash command.
The keymap.c file can be edited in any text editor.
I highly recomend changing it to your liking.
This layout works great for me and took me several revissions to get it here.
There are several sections inside the default keymap.
* defining shortcuts and layers
* layer definitions
This is an enumeration of all the layers.
* layer keys
There keys change the layers.
TG is Toggles the layer on or off.
TO Turns the layer on and turns off all other layers.
MO Turns on the layer when held.
* alternate keys
There are shortcuts to diferent keys to make the layout easier to read.
* mod taps
A mod tap is a modifer key when held down and a reqular key when tapped.
The mod taps are for the home row to have home row mods.
There are mod taps defined for both Jonmak and querty layouts.
CTL_ENT is ctrl when held and enter when tapped.
Jonmak
MT_A is shift when held and a when tapped.
MT_R is ctrl when held and r when tapped.
MT_S is alt when held and s when tapped.
MT_T is shift when held and t when tapped.
Querty
MTQ_A is shift when held and a when tapped.
MTQ_S is ctrl when held and s when tapped.
MTQ_D is alt when held and d when tapped.
MTQ_F is shift when held and f when tapped.
These are only for the left side because I type only using the left shift.
Add the right side if you want to type with the right shift.
* layer tap
A layer tap is when you tap a key it does on key and when you hold it it changes layer.
The two layer taps being used are both on the thumb keys.
The MO_TAB is mouse when held and tab when tapped.
The SY_GRV is symbol when held and grave (backtick / "\`") when tapped.
* oled
* splash screen
This screen is showed for the first few seconds when the keyboard is powered on.
* layer
This shows what layer you are on.
* modifiers
This shows what modifiers are active on the screen.
Moifier keys are Caps Lock, Shift, Ctrl, Alt, and GUI (Windows key / Super).
* auto switch layer
This is here to make jonmak the default layer even though game is index 0
* keymap
* game layer
This is the first layer so that all other layers can draw over it.
This makes the GJONMAK layer change key work to temporarily enable the jonmak layer.
This layer is used for gaming and the keyboard switches to jonmak when it is powered on.
* jonmak layer
This is the default layer for the keyboard.
This layout was created by Jon Hull as a modification to Colemak that works better with vim and this keyboard.
* jonmak extended layer
Because this keyboard only has 29 keys another layer is needed to get all the leters and punctuation.
* symbol layer
This layer is used for numbers and arythimetic symbols.
There is a 10 key for easily typing numbers and symbols.
* mouse layer
This layer is for using the mouse keys.
* function layer
This is for miscellaneous functions that don't fit int with other layers.

View File

@@ -0,0 +1,22 @@
# 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 = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
SWAP_HANDS_ENABLE = yes
POINTING_DEVICE_ENABLE = yes
#POINTING_DEVICE_DRIVER = pmw3389 # pmw3360
POINTING_DEVICE_DRIVER = pmw3360
MOUSE_SHARED_EP = yes
SPLIT_KEYBOARD = yes
DEFAULT_FOLDER = handwired/nerdboard/pro_micro_29/arduinomicro

View File

@@ -0,0 +1,19 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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
#include "pro_micro_41.h"

View File

@@ -0,0 +1,34 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
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
#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 }
#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
#define DIODE_DIRECTION COL2ROW
#define SOFT_SERIAL_PIN D3
#undef USE_I2C
#define MASTER_RIGHT
#define PMW3360_LIFTOFF_DISTANCE 0x40
/* PMW3360 Settings */
#define POINTING_DEVICE_CS_PIN B6

View File

@@ -0,0 +1,8 @@
{
"keyboard_name": "Tractyl Manuform(5x6) Arduino Micro (r)/ Pro Micro (l)",
"split": {
"soft_serial_pin": "D3"
},
"processor": "atmega32u4",
"bootloader": "caterina"
}

View File

@@ -0,0 +1,2 @@
OLED_ENABLE = no
LTO_ENABLE = yes

View File

@@ -0,0 +1,47 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
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
#define DIODE_DIRECTION COL2ROW
#define VERSION 6
#if VERSION == 61
// version 6.1
#define ROTATIONAL_TRANSFORM_ANGLE -15
#define POINTING_DEVICE_INVERT_Y
#define CHARYBDIS_DRAGSCROLL_REVERSE_Y
#else
// version 6
#define VERSION 6
#define ROTATIONAL_TRANSFORM_ANGLE -15
#define POINTING_DEVICE_INVERT_X
#define CHARYBDIS_DRAGSCROLL_REVERSE_Y
#endif
#define DYNAMIC_KEYMAP_LAYER_COUNT 16
#define LAYER_STATE_16BIT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
#define POINTING_DEVICE_RIGHT
#define CHARYBDIS_POINTER_ACCELERATION_FACTOR 24

View File

@@ -0,0 +1,60 @@
{
"url": "",
"usb": {
"pid": "0x3536",
"device_version": "0.0.1"
},
"split": {
"bootmagic": {
"matrix": [6, 4]
}
},
"layouts": {
"LAYOUT": {
"layout": [
{"label":"L00", "x":0, "y":0},
{"label":"L01", "x":1, "y":0},
{"label":"L02", "x":2, "y":0},
{"label":"L03", "x":3, "y":0},
{"label":"L04", "x":4, "y":0},
{"label":"L05", "x":5, "y":0},
{"label":"R00", "x":11, "y":0},
{"label":"R01", "x":12, "y":0},
{"label":"R02", "x":13, "y":0},
{"label":"R03", "x":14, "y":0},
{"label":"R04", "x":15, "y":0},
{"label":"R05", "x":16, "y":0},
{"label":"L10", "x":0, "y":1},
{"label":"L11", "x":1, "y":1},
{"label":"L12", "x":2, "y":1},
{"label":"L13", "x":3, "y":1},
{"label":"L14", "x":4, "y":1},
{"label":"L15", "x":5, "y":1},
{"label":"R10", "x":11, "y":1},
{"label":"R11", "x":12, "y":1},
{"label":"R12", "x":13, "y":1},
{"label":"R13", "x":14, "y":1},
{"label":"R14", "x":15, "y":1},
{"label":"R15", "x":16, "y":1},
{"label":"L20", "x":0, "y":2},
{"label":"L21", "x":1, "y":2},
{"label":"L22", "x":2, "y":2},
{"label":"L23", "x":3, "y":2},
{"label":"L24", "x":4, "y":2},
{"label":"L25", "x":5, "y":2},
{"label":"R20", "x":11, "y":2},
{"label":"R21", "x":12, "y":2},
{"label":"R22", "x":13, "y":2},
{"label":"R23", "x":14, "y":2},
{"label":"R24", "x":15, "y":2},
{"label":"R25", "x":16, "y":2},
{"label":"L33", "x":3, "y":3},
{"label":"L34", "x":4, "y":3},
{"label":"L35", "x":5, "y":3},
{"label":"R30", "x":11, "y":3},
{"label":"R31", "x":12, "y":3}
]
}
}
}

View File

@@ -0,0 +1,107 @@
#include QMK_KEYBOARD_H
enum custom_layers {
_QUERTY,
_SYMBOL,
_MOUSE,
_FUNC
};
// layer keys
#define MOUSE MO(_MOUSE)
#define SYMBOL MO(_SYMBOL)
#define FUNC MO(_FUNC)
// alternate keys
#define L KC_LEFT
#define D KC_DOWN
#define U KC_UP
#define R KC_RIGHT
#define PLUS LSFT(KC_EQL)
#define STAR LSFT(KC_8)
#define WS_L G(KC_PGUP)
#define WS_R G(KC_PGDN)
#define T_TAB_L LCTL(KC_PGUP)
#define T_TAB_R LCTL(KC_PGDN)
#define T_TAB_N LSFT(LCTL(KC_T))
#define T_TAB_C LSFT(LCTL(KC_W))
// layer tap
#define MO_TAB LT(MOUSE, KC_TAB)
#define SY_GRV LT(SYMBOL, KC_GRV)
#ifdef OLED_ENABLE
char splash_screen[36] = "NerdBoard V7 41 Key\n\nBy: Jon Hull";
uint32_t timer = 0;
uint8_t show_splash = 1;
static void regular_use(void) {
oled_clear();
oled_set_cursor(0, 0);
oled_write("Layer: ", false);
switch (get_highest_layer(layer_state)) {
case _QUERTY:
oled_write("QWERTY 41", false);
break;
case _SYMBOL:
oled_write("SYMBOLS", false);
break;
case _MOUSE:
oled_write("MOUSE", false);
break;
case _FUNC:
oled_write("FUNCTION", false);
break;
}
led_t led_state = host_keyboard_led_state();
oled_write("\n\nMods:", false);
uint8_t mod = get_mods();
if (led_state.caps_lock) { oled_write(" CAP", false); }
if (mod & MOD_MASK_SHIFT) { oled_write(" SFT", false); }
if (mod & MOD_MASK_CTRL) { oled_write(" CTL", false); }
if (mod & MOD_MASK_ALT) { oled_write(" ALT", false); }
if (mod & MOD_MASK_GUI) { oled_write(" GUI", false); }
return;
}
bool oled_task_user() {
if (timer > 100) { regular_use(); }
else { timer += 1; oled_write(splash_screen, false); }
return false;
}
#endif
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QUERTY] = LAYOUT(
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_BSPC,
KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_RSFT,
KC_LALT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM, KC_DOT,KC_SLSH,KC_LCTL,
SYMBOL, MO_TAB, KC_SPC , SY_GRV , KC_ENT
),
[_SYMBOL] = LAYOUT(
_______,_______, KC_7 , KC_8 , KC_9 ,KC_LCBR, KC_RCBR,KC_MINS, PLUS , STAR ,KC_SLSH,_______,
KC_LSFT,_______, KC_4 , KC_5 , KC_6 ,KC_LBRC, KC_RBRC,KC_BSPC, KC_DEL,KC_QUOT,KC_DQUO,KC_RSFT,
KC_LALT, KC_0 , KC_1 , KC_2 , KC_3 ,KC_LPRN, KC_RPRN, L , D , U , R ,KC_LCTL,
KC_EQL, FUNC , KC_ESC, FUNC ,FUNC
),
[_MOUSE] = LAYOUT(
_______,T_TAB_C,T_TAB_N,_______,_______,_______, _______,KC_BTN3,_______,_______,_______,_______,
KC_LSFT,T_TAB_L,T_TAB_R, WS_L , WS_R ,_______, _______,KC_BTN1,KC_BTN2,SNIPING,DRGSCRL,KC_RSFT,
KC_LALT,_______,_______,_______,_______,_______, _______,KC_BTN4,KC_BTN5,_______,_______,KC_LCTL,
_______, FUNC ,_______, FUNC ,_______
),
[_FUNC] = LAYOUT(
QK_BOOT,_______,KC_VOLU,_______,G(KC_L),_______, _______, KC_INS,KC_PSCR,_______,_______,_______,
KC_LSFT,_______,KC_MUTE,_______,_______,_______, _______,KC_LGUI,KC_MPRV,KC_MPLY,KC_MNXT,KC_RSFT,
KC_LALT,_______,KC_VOLD,KC_HOME, KC_END,_______, _______, G(L) , G(D) , G(U) , G(R) ,KC_LCTL,
_______,_______,_______, _______,_______
)
};

View File

@@ -0,0 +1,40 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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 "pro_micro_41.h"
#ifdef SWAP_HANDS_ENABLE
const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
/* Left hand, matrix positions */
{{5, 6}, {4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}},
{{5, 7}, {4, 7}, {3, 7}, {2, 7}, {1, 7}, {0, 7}},
{{5, 8}, {4, 8}, {3, 8}, {2, 8}, {1, 8}, {0, 8}},
{{5, 9}, {4, 9}, {3, 9}, {2, 9}, {1, 9}, {0, 9}},
//{{5, 10}, {4, 10}, {3, 10}, {2, 10}, {1, 10}},//, {0, 10}},
//{{5, 11}, {4, 11}, {3, 11}, {2, 11}, {1, 11}},//, {0, 11}},
/* Right hand, matrix positions */
{{5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
{{5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
{{5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
{{5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}
//{{5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}}};//, {0, 4}},
//{{5, 5}, {4, 5}, {3, 5}, {2, 5}, {1, 5}},//, {0, 5}}};
};
# ifdef ENCODER_MAP_ENABLE
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {1, 0};
# endif
#endif

View File

@@ -0,0 +1,43 @@
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* 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
#include "nerdboard.h"
#include "arduinomicro.h"
#include "quantum.h"
#define ___ KC_NO
// clang-format off
#define LAYOUT(\
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
L33, L34, L35, R30, R32 \
) \
{ \
{ L00, L01, L02, L03, L04, L05 }, \
{ L10, L11, L12, L13, L14, L15 }, \
{ L20, L21, L22, L23, L24, L25 }, \
{ ___, ___, ___, L33, L34, L35 }, \
\
{ R00, R01, R02, R03, R04, R05 }, \
{ R10, R11, R12, R13, R14, R15 }, \
{ R20, R21, R22, R23, R24, R25 }, \
{ R30, R32, ___, ___, ___, ___ } \
}
// clang-format on

View File

@@ -0,0 +1,98 @@
# Nerdboard #
Nerdboard is a 29 key split ergonomic keyboard with a built in mouse.
Build instructions can be found https://github.com/thelowprokill/nerdboard
* Keyboard Maintainer: [thelowprokill](https://github.com/thelowprokill)
* Hardware Supported: Arduino pro micro
### QMK Firmware ###
This keyboard runs on an open source keyboard firmware called Quantum Mechanical Keyboard (QMK) Firmware.
The qmk_firmware folder is the full firmware files for this keyboard, also available on git hub. [https://github.com/thelowprokill/qmk_firmware]
The nerdboard folder is just the necessary files for nerdboard.
### Set up ###
Go to https://docs.qmk.fm/#/newbs_getting_started and follow the instructions to set up qmk on your operating system.
Copy the nerdboard folder to $qmk_home/keyboards/handwired/nerdboard.
### Flash ###
qmk flash -kb handwired/nerdboard/pro_micro_29 -km default
qmk flash is the command to build the firmware and flash the keyboard.
the -kb flag specifies which keyboard to build.
the -km flag specifies which keymap to use.
This way multiple layouts can be used without copying the entire folder or overwriting existing files.
### Editiing the Keymap ###
Inside $qmk_home/keyboards/handwired/nerdboard/pro_micro_29/keymaps/
there are named folders each with a file called keymap.c
This is where your keymaps are defined.
The name of the folder is specified by the flash command.
The keymap.c file can be edited in any text editor.
I highly recomend changing it to your liking.
This layout works great for me and took me several revissions to get it here.
There are several sections inside the default keymap.
* defining shortcuts and layers
* layer definitions
This is an enumeration of all the layers.
* layer keys
There keys change the layers.
TG is Toggles the layer on or off.
TO Turns the layer on and turns off all other layers.
MO Turns on the layer when held.
* alternate keys
There are shortcuts to diferent keys to make the layout easier to read.
* mod taps
A mod tap is a modifer key when held down and a reqular key when tapped.
The mod taps are for the home row to have home row mods.
There are mod taps defined for both Jonmak and querty layouts.
CTL_ENT is ctrl when held and enter when tapped.
Jonmak
MT_A is shift when held and a when tapped.
MT_R is ctrl when held and r when tapped.
MT_S is alt when held and s when tapped.
MT_T is shift when held and t when tapped.
Querty
MTQ_A is shift when held and a when tapped.
MTQ_S is ctrl when held and s when tapped.
MTQ_D is alt when held and d when tapped.
MTQ_F is shift when held and f when tapped.
These are only for the left side because I type only using the left shift.
Add the right side if you want to type with the right shift.
* layer tap
A layer tap is when you tap a key it does on key and when you hold it it changes layer.
The two layer taps being used are both on the thumb keys.
The MO_TAB is mouse when held and tab when tapped.
The SY_GRV is symbol when held and grave (backtick / "\`") when tapped.
* oled
* splash screen
This screen is showed for the first few seconds when the keyboard is powered on.
* layer
This shows what layer you are on.
* modifiers
This shows what modifiers are active on the screen.
Moifier keys are Caps Lock, Shift, Ctrl, Alt, and GUI (Windows key / Super).
* auto switch layer
This is here to make jonmak the default layer even though game is index 0
* keymap
* game layer
This is the first layer so that all other layers can draw over it.
This makes the GJONMAK layer change key work to temporarily enable the jonmak layer.
This layer is used for gaming and the keyboard switches to jonmak when it is powered on.
* jonmak layer
This is the default layer for the keyboard.
This layout was created by Jon Hull as a modification to Colemak that works better with vim and this keyboard.
* jonmak extended layer
Because this keyboard only has 29 keys another layer is needed to get all the leters and punctuation.
* symbol layer
This layer is used for numbers and arythimetic symbols.
There is a 10 key for easily typing numbers and symbols.
* mouse layer
This layer is for using the mouse keys.
* function layer
This is for miscellaneous functions that don't fit int with other layers.

View File

@@ -0,0 +1,21 @@
# 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 = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
SWAP_HANDS_ENABLE = yes
POINTING_DEVICE_ENABLE = yes
POINTING_DEVICE_DRIVER = pmw3389
MOUSE_SHARED_EP = yes
SPLIT_KEYBOARD = yes
DEFAULT_FOLDER = handwired/nerdboard/pro_micro_41/arduinomicro

View File

@@ -0,0 +1,98 @@
# Nerdboard #
Nerdboard is a 29 key split ergonomic keyboard with a built in mouse.
Build instructions can be found https://github.com/thelowprokill/nerdboard
* Keyboard Maintainer: [thelowprokill](https://github.com/thelowprokill)
* Hardware Supported: Arduino pro micro
### QMK Firmware ###
This keyboard runs on an open source keyboard firmware called Quantum Mechanical Keyboard (QMK) Firmware.
The qmk_firmware folder is the full firmware files for this keyboard, also available on git hub. [https://github.com/thelowprokill/qmk_firmware]
The nerdboard folder is just the necessary files for nerdboard.
### Set up ###
Go to https://docs.qmk.fm/#/newbs_getting_started and follow the instructions to set up qmk on your operating system.
Copy the nerdboard folder to $qmk_home/keyboards/handwired/nerdboard.
### Flash ###
qmk flash -kb handwired/nerdboard/pro_micro_29 -km default
qmk flash is the command to build the firmware and flash the keyboard.
the -kb flag specifies which keyboard to build.
the -km flag specifies which keymap to use.
This way multiple layouts can be used without copying the entire folder or overwriting existing files.
### Editiing the Keymap ###
Inside $qmk_home/keyboards/handwired/nerdboard/pro_micro_29/keymaps/
there are named folders each with a file called keymap.c
This is where your keymaps are defined.
The name of the folder is specified by the flash command.
The keymap.c file can be edited in any text editor.
I highly recomend changing it to your liking.
This layout works great for me and took me several revissions to get it here.
There are several sections inside the default keymap.
* defining shortcuts and layers
* layer definitions
This is an enumeration of all the layers.
* layer keys
There keys change the layers.
TG is Toggles the layer on or off.
TO Turns the layer on and turns off all other layers.
MO Turns on the layer when held.
* alternate keys
There are shortcuts to diferent keys to make the layout easier to read.
* mod taps
A mod tap is a modifer key when held down and a reqular key when tapped.
The mod taps are for the home row to have home row mods.
There are mod taps defined for both Jonmak and querty layouts.
CTL_ENT is ctrl when held and enter when tapped.
Jonmak
MT_A is shift when held and a when tapped.
MT_R is ctrl when held and r when tapped.
MT_S is alt when held and s when tapped.
MT_T is shift when held and t when tapped.
Querty
MTQ_A is shift when held and a when tapped.
MTQ_S is ctrl when held and s when tapped.
MTQ_D is alt when held and d when tapped.
MTQ_F is shift when held and f when tapped.
These are only for the left side because I type only using the left shift.
Add the right side if you want to type with the right shift.
* layer tap
A layer tap is when you tap a key it does on key and when you hold it it changes layer.
The two layer taps being used are both on the thumb keys.
The MO_TAB is mouse when held and tab when tapped.
The SY_GRV is symbol when held and grave (backtick / "\`") when tapped.
* oled
* splash screen
This screen is showed for the first few seconds when the keyboard is powered on.
* layer
This shows what layer you are on.
* modifiers
This shows what modifiers are active on the screen.
Moifier keys are Caps Lock, Shift, Ctrl, Alt, and GUI (Windows key / Super).
* auto switch layer
This is here to make jonmak the default layer even though game is index 0
* keymap
* game layer
This is the first layer so that all other layers can draw over it.
This makes the GJONMAK layer change key work to temporarily enable the jonmak layer.
This layer is used for gaming and the keyboard switches to jonmak when it is powered on.
* jonmak layer
This is the default layer for the keyboard.
This layout was created by Jon Hull as a modification to Colemak that works better with vim and this keyboard.
* jonmak extended layer
Because this keyboard only has 29 keys another layer is needed to get all the leters and punctuation.
* symbol layer
This layer is used for numbers and arythimetic symbols.
There is a 10 key for easily typing numbers and symbols.
* mouse layer
This layer is for using the mouse keys.
* function layer
This is for miscellaneous functions that don't fit int with other layers.