Skip to content

Commit

Permalink
Merge pull request qmk#9 from morganvenable/ee_hands
Browse files Browse the repository at this point in the history
Ee hands
  • Loading branch information
morganvenable authored Jan 24, 2024
2 parents 8224c93 + 60d895b commit 75bf522
Show file tree
Hide file tree
Showing 15 changed files with 368 additions and 58 deletions.
2 changes: 2 additions & 0 deletions bsa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ make svalboard/trackpoint/left:vial
make svalboard/trackpoint/right:vial
make svalboard/trackball/left:vial
make svalboard/trackball/right:vial
make svalboard/mouse/left:vial
make svalboard/mouse/right:vial
make svalboard/left:vial
make svalboard/right:vial
9 changes: 0 additions & 9 deletions keyboards/svalboard/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define SERIAL_USART_TX_PIN GP0
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500 // Timeout window in ms in which the double tap can occur.
#define FORCE_NKRO

//@manna-harbour's automousekeys
#if defined MH_AUTO_BUTTONS
#define MH_AUTO_BUTTONS_LAYER MBO
#define MH_AUTO_BUTTONS_TIMEOUT 5000
#endif

//#define USB_POLLING_INTERVAL_MS 1

#define DYNAMIC_KEYMAP_LAYER_COUNT 10
#define VIAL_TAP_DANCE_ENTRIES 100
Expand Down
14 changes: 9 additions & 5 deletions keyboards/svalboard/keymaps/claussen/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ void keyboard_post_init_user(void) {
//debug_mouse=true;
}

#ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE
void pointing_device_init_user(void) {
set_auto_mouse_layer(5); // only required if AUTO_MOUSE_DEFAULT_LAYER is not set to index of <mouse_layer>
set_auto_mouse_enable(true); // always required before the auto mouse feature will work
}
#endif

enum my_keycodes {
KC_NORMAL_HOLD = SAFE_RANGE,
KC_FUNC_HOLD
Expand All @@ -45,7 +52,7 @@ enum layer {
const uint16_t PROGMEM keymaps[NUM_LAYERS][MATRIX_ROWS][MATRIX_COLS] = {
[NORMAL] = LAYOUT(
/*Center North East South West*/
/*L4*/ KC_A, KC_Q, KC_LBRC, KC_Z, KC_DEL,

/*R1*/ KC_J, KC_U, KC_QUOTE, KC_M, KC_H,
/*R2*/ KC_K, KC_I, KC_COLON, KC_COMMA, KC_Y,
/*R3*/ KC_L, KC_O, KC_LGUI, KC_DOT, KC_N,
Expand All @@ -54,7 +61,7 @@ const uint16_t PROGMEM keymaps[NUM_LAYERS][MATRIX_ROWS][MATRIX_COLS] = {
/*L1*/ KC_F, KC_R, KC_G, KC_V, KC_DOUBLE_QUOTE,
/*L2*/ KC_D, KC_E, KC_T, KC_C, KC_GRAVE,
/*L3*/ KC_S, KC_W, KC_B, KC_X, KC_ESC,

/*L4*/ KC_A, KC_Q, KC_LBRC, KC_Z, KC_DEL,

/*Down Inner (pad) Upper (Mode) O.Upper (nail) OL (knuckle) Pushthrough*/
/*RT*/ MO(NAS), KC_SPACE, TO(FUNC), KC_BSPC, KC_LALT, TG(NAS),
Expand Down Expand Up @@ -180,11 +187,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {

case KC_NORMAL_HOLD:
if (record->event.pressed) {
layer_clear();
layer_on(NORMAL_HOLD);
SEND_STRING(SS_LCTL(SS_TAP(X_F19)));
} else {
layer_off(NORMAL_HOLD);
}
return false;
/* case KC_FUNC_HOLD:
Expand Down
18 changes: 14 additions & 4 deletions keyboards/svalboard/keymaps/vial/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ void keyboard_post_init_user(void) {
//debug_mouse=true;
}

// in keymap.c:
#ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE
void pointing_device_init_user(void) {
set_auto_mouse_layer(5); // only required if AUTO_MOUSE_DEFAULT_LAYER is not set to index of <mouse_layer>
set_auto_mouse_enable(true); // always required before the auto mouse feature will work
}
#endif

enum my_keycodes {
KC_NORMAL_HOLD = SAFE_RANGE,
KC_FUNC_HOLD
Expand Down Expand Up @@ -131,9 +139,9 @@ const uint16_t PROGMEM keymaps[NUM_LAYERS][MATRIX_ROWS][MATRIX_COLS] = {

[MBO] = LAYOUT(
/*Center North East South West*/
/*R1*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
/*R2*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
/*R3*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
/*R1*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_TRNS,
/*R2*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_TRNS,
/*R3*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_TRNS,
/*R4*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
/*L1*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_TRNS,
/*L2*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_TRNS,
Expand Down Expand Up @@ -179,14 +187,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {

case KC_NORMAL_HOLD:
if (record->event.pressed) {
/* if (record->event.pressed) {
layer_clear();
layer_on(NORMAL_HOLD);
SEND_STRING(SS_LCTL(SS_TAP(X_F19)));
} else {
layer_off(NORMAL_HOLD);
}
return false;
*/

/* case KC_FUNC_HOLD:
if (record->event.pressed) {
layer_clear();
Expand Down
Empty file added keyboards/svalboard/mouse/.noci
Empty file.
150 changes: 150 additions & 0 deletions keyboards/svalboard/mouse/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
/*
Copyright 2023 Morgan Venable @_claussen
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

/* key matrix size */
// Rows are doubled-up
#define MATRIX_ROWS 10
#define MATRIX_COLS 6
#define PFET_ROWS
#define EE_HANDS
#define FORCE_NKRO
#undef PS2_MOUSE_ENABLE
// #ifndef MH_AUTO_BUTTONS
// #define MH_AUTO_BUTTONS
// #endif
#ifndef POINTING_DEVICE_ENABLE
#define POINTING_DEVICE_ENABLE
#endif

// in config.h:
#define POINTING_DEVICE_AUTO_MOUSE_ENABLE
// only required if not setting mouse layer elsewhere
#define AUTO_MOUSE_DEFAULT_LAYER 5

//#define DEBUG_MATRIX_SCAN_RATE

// wiring of each half
//Layout for svalboard v0 (different from lalboard_v2)
//1 2 3 4 5 6
//S E D N W None
//Both Thumbs (these are same as lalboard_v2)
//OL OU D IL MODE DOUBLE
//Knuckle Nail Down Pad Up Double
//#define THUMB_DOWN_ACTIVE_DARK

#ifndef MATRIX_COL_PUSHED_STATES
#define MATRIX_COL_PUSHED_STATES { 0, 0, 1, 0, 0, 0 }
#endif
#define MATRIX_COL_PUSHED_STATES { 0, 0, 1, 0, 0, 0 }
#ifndef MATRIX_COL_PUSHED_STATES_THUMBS
#ifdef THUMB_DOWN_ACTIVE_DARK
#define MATRIX_COL_PUSHED_STATES_THUMBS { 0, 0, 1, 0, 0, 0 }
#else
#define MATRIX_COL_PUSHED_STATES_THUMBS { 0, 0, 0, 0, 0, 0 }
#endif
#endif
#define DOUBLEDOWN_COL 5 // need a pullup on COL6
#define PREWAIT_US 90
#define POSTWAIT_US 90

#define SERIAL_DEBUG
#define SERIAL_USART_TX_PIN GP0
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500 // Timeout window in ms in which the double tap can occur.

#ifdef PS2_MOUSE_ENABLE
//#define SERIAL_PIO_USE_PIO1
#define PS2_PIO_USE_PIO1
#define PS2_RESET_PIN GP25
#define PS2_CLOCK_PIN GP24
#define PS2_DATA_PIN GP23
#define PS2_MOUSE_ROTATE 270
#endif

#if defined(POINTING_DEVICE_ENABLE)

// Pointing device stuff
#define SPLIT_POINTING_ENABLE
#define POINTING_DEVICE_COMBINED

#if defined(POINTING_DEVICE_IS_PIMORONI)

#define I2C_DRIVER I2CD1
#define I2C1_SDA_PIN GP18
#define I2C1_SCL_PIN GP19
#define PIMORONI_TRACKBALL_SCALE 5

#endif

#if (defined(POINTING_DEVICE_IS_PMW3360) || defined(POINTING_DEVICE_IS_PMW3389))
// SPI stuff
#define USE_FFC_SPI

#ifdef USE_FFC_SPI
#define SPI_DRIVER SPID1
// for FFC connector
#define SPI_SCK_PIN GP26
// Use TX# pin from SPI set.
#define SPI_MOSI_PIN GP27
// Use RX# pin from SPI set.
#define SPI_MISO_PIN GP24
// PMW33XX stuff
// Use CS# pin from SPI set. Might not actually have to be the CS# pin, since
// there's supposed to be support for multiple PMW33XX sensors, with different
// CS pins.
#define PMW33XX_CS_PIN GP25
#else
//for Separate Pimoroni Connector
#define SPI_DRIVER SPID0
#define SPI_SCK_PIN GP18
// Use TX# pin from SPI set.
#define SPI_MOSI_PIN GP19
// Use RX# pin from SPI set.
#define SPI_MISO_PIN GP16
// PMW33XX stuff
// Use CS# pin from SPI set. Might not actually have to be the CS# pin, since
// there's supposed to be support for multiple PMW33XX sensors, with different
// CS pins.
#define PMW33XX_CS_PIN GP17
#endif
#define PMW33XX_CS_DIVISOR 4
#define PMW33XX_CPI 1600
//#define POINTING_DEVICE_INVERT_Y
#define ROTATIONAL_TRANSFORM_ANGLE_RIGHT 180
#endif
#endif

#if defined MH_AUTO_BUTTONS
#define MH_AUTO_BUTTONS_LAYER MBO
#define MH_AUTO_BUTTONS_TIMEOUT 5000
#define PS2_MOUSE_SCROLL_BTN_MASK 0
//(1<<PS2_MOUSE_BTN_MIDDLE) // this mask disables the key for non-PS2 purposes
#endif

//#define USB_POLLING_INTERVAL_MS 1




#define DYNAMIC_KEYMAP_LAYER_COUNT 10
#define VIAL_TAP_DANCE_ENTRIES 100
#define VIAL_TAP_COMBO_ENTRIES 100
#define VIAL_COMBO_ENTRIES 100
#define VIAL_KEY_OVERRIDE_ENTRIES 10
#define DYNAMIC_KEYMAP_MACRO_COUNT 100
26 changes: 26 additions & 0 deletions keyboards/svalboard/mouse/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#pragma once

#include_next <halconf.h>

#if defined(POINTING_DEVICE_DRIVER)

#if defined(POINTING_DEVICE_IS_PIMORONI)

#undef HAL_USE_I2C
#define HAL_USE_I2C TRUE

#endif

#if (defined(POINTING_DEVICE_IS_PMW3360) || defined(POINTING_DEVICE_IS_PMW3389))

#undef HAL_USE_SPI
#define HAL_USE_SPI TRUE

#undef SPI_USE_WAIT
#define SPI_USE_WAIT TRUE

#undef SPI_SELECT_MODE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD

#endif
#endif
Loading

0 comments on commit 75bf522

Please sign in to comment.