Skip to content

Commit

Permalink
Merge pull request qmk#18 from svalboard/ballpoint
Browse files Browse the repository at this point in the history
merge Ballpoint to Mule
  • Loading branch information
morganvenable authored Mar 24, 2024
2 parents e92cdda + b3f4a9c commit a3187ae
Show file tree
Hide file tree
Showing 16 changed files with 166 additions and 17 deletions.
2 changes: 2 additions & 0 deletions builddefs/build_vial.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

QMK_SETTINGS ?= yes
TAP_DANCE_ENABLE ?= yes

SERIAL_SUFFIX ?= "a1"

ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
OPT_DEFS += -DTAPPING_TERM_PER_KEY
endif
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Pointing device stuff
#define SPLIT_POINTING_ENABLE
#define POINTING_DEVICE_LEFT
#define POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE

#if defined(POINTING_DEVICE_IS_PIMORONI)

Expand Down Expand Up @@ -67,7 +68,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PMW33XX_CS_PIN GP17
#endif
#define PMW33XX_CS_DIVISOR 4
#define PMW33XX_CPI 400
#define PMW33XX_CPI 2000
#define POINTING_DEVICE_LEFT
#define POINTING_DEVICE_INVERT_Y
#define ROTATIONAL_TRANSFORM_ANGLE 90
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define SERIAL_USART_TX_PIN GP0
#define SERIAL_USART_RX_PIN GP1
#define SERIAL_USART_FULL_DUPLEX
#define SERIAL_PIO_USE_PIO0
#define SERIAL_PIO_USE_PIO0
File renamed without changes.
116 changes: 116 additions & 0 deletions keyboards/svalboard/ballpoint/left/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"manufacturer": "Svalboard",
"keyboard_name": "svalboard",
"maintainer": "MorganVenable",
"url": "http://svalboard.com",
"bootloader": "rp2040",
"diode_direction": "COL2ROW",
"features": {
"audio": false,
"backlight": false,
"bluetooth": false,
"bootmagic": false,
"command": true,
"console": true,
"extrakey": true,
"fauxclicky": false,
"midi": false,
"mousekey": true,
"nkro": true,
"rgblight": false,
"sleep_led": false,
"unicode": false
},
"height": 10,
"matrix_pins": {
"cols": ["GP14", "GP13", "GP12", "GP11", "GP10", "GP9"],
"rows": ["GP8", "GP7", "GP6", "GP5", "GP4"]
},
"mousekey": {
"delay": 150,
"interval": 60,
"max_speed": 5,
"time_to_max": 7
},
"processor": "RP2040",
"split": {
"enabled": true,
"transport": {
"protocol": "serial",
"sync_matrix_state": false,
"sync_modifiers": false
}
},
"tapping": {
"term": 200
},
"ps2": {
"enabled": false,
"driver": "vendor"
},
"usb": {
"device_version": "0.0.2",
"pid": "0x4044",
"polling_interval": 1,
"vid": "0x303A"
},
"width": 20.5,
"layouts": {
"LAYOUT": {
"layout": [
{"label": "r1c", "matrix": [1, 2], "x": 0.5, "y": 1.5},
{"label": "r1n", "matrix": [1, 3], "x": 0.5, "y": 1, "h": 0.5},
{"label": "r1e", "matrix": [1, 1], "x": 1.5, "y": 1.5, "w": 0.5},
{"label": "r1s", "matrix": [1, 0], "x": 0.5, "y": 2.5, "h": 0.5},
{"label": "r1w", "matrix": [1, 4], "x": 0, "y": 1.5, "w": 0.5},
{"label": "r2c", "matrix": [2, 2], "x": 2.5, "y": 1},
{"label": "r2n", "matrix": [2, 3], "x": 2.5, "y": 0.5, "h": 0.5},
{"label": "r2e", "matrix": [2, 1], "x": 3.5, "y": 1, "w": 0.5},
{"label": "r2s", "matrix": [2, 0], "x": 2.5, "y": 2, "h": 0.5},
{"label": "r2w", "matrix": [2, 4], "x": 2, "y": 1, "w": 0.5},
{"label": "r3c", "matrix": [3, 2], "x": 4.5, "y": 0.5},
{"label": "r3n", "matrix": [3, 3], "x": 4.5, "y": 0, "h": 0.5},
{"label": "r3e", "matrix": [3, 1], "x": 5.5, "y": 0.5, "w": 0.5},
{"label": "r3s", "matrix": [3, 0], "x": 4.5, "y": 1.5, "h": 0.5},
{"label": "r3w", "matrix": [3, 4], "x": 4, "y": 0.5, "w": 0.5},
{"label": "r4c", "matrix": [4, 2], "x": 6.5, "y": 1},
{"label": "r4n", "matrix": [4, 3], "x": 6.5, "y": 0.5, "h": 0.5},
{"label": "r4e", "matrix": [4, 1], "x": 7.5, "y": 1, "w": 0.5},
{"label": "r4s", "matrix": [4, 0], "x": 6.5, "y": 2, "h": 0.5},
{"label": "r4w", "matrix": [4, 4], "x": 6, "y": 1, "w": 0.5},
{"label": "l1c", "matrix": [6, 2], "x": 8.5, "y": 4, "h": 2},
{"label": "l1n", "matrix": [6, 3], "x": 8, "y": 3.5, "w": 0.5, "h": 1.5},
{"label": "l1e", "matrix": [6, 1], "x": 7.5, "y": 3.5, "w": 0.5},
{"label": "l1w", "matrix": [6, 0], "x": 9.5, "y": 3.5, "w": 0.5, "h": 1.5},
{"label": "l1s", "matrix": [6, 4], "x": 9.5, "y": 5, "w": 0.5, "h": 1.5},
{"label": "l2c", "matrix": [7, 2], "x": 8.5, "y": 5, "w": 0.5, "h": 1.5},
{"label": "l2n", "matrix": [7, 3], "x": 11, "y": 4, "h": 2},
{"label": "l2e", "matrix": [7, 1], "x": 12, "y": 3.5, "w": 0.5, "h": 1.5},
{"label": "l2w", "matrix": [7, 0], "x": 12.5, "y": 3.5, "w": 0.5},
{"label": "l2s", "matrix": [7, 4], "x": 10.5, "y": 3.5, "w": 0.5, "h": 1.5},
{"label": "l3c", "matrix": [8, 2], "x": 10.5, "y": 5, "w": 0.5, "h": 1.5},
{"label": "l3n", "matrix": [8, 3], "x": 11, "y": 5, "w": 0.5, "h": 1.5},
{"label": "l3e", "matrix": [8, 1], "x": 13, "y": 1},
{"label": "l3w", "matrix": [8, 0], "x": 13, "y": 0.5, "h": 0.5},
{"label": "l3s", "matrix": [8, 4], "x": 12.5, "y": 1, "w": 0.5},
{"label": "l4c", "matrix": [9, 2], "x": 13, "y": 2, "h": 0.5},
{"label": "l4n", "matrix": [9, 3], "x": 14, "y": 1, "w": 0.5},
{"label": "l4e", "matrix": [9, 1], "x": 15, "y": 0.5},
{"label": "l4s", "matrix": [9, 0], "x": 15, "y": 0, "h": 0.5},
{"label": "l4w", "matrix": [9, 4], "x": 16, "y": 0.5, "w": 0.5},
{"label": "rtd", "matrix": [0, 2], "x": 15, "y": 1.5, "h": 0.5},
{"label": "rti", "matrix": [0, 3], "x": 14.5, "y": 0.5, "w": 0.5},
{"label": "rtu", "matrix": [0, 4], "x": 17, "y": 1},
{"label": "rtuo", "matrix": [0, 1], "x": 17, "y": 0.5, "h": 0.5},
{"label": "rtlo", "matrix": [0, 0], "x": 18, "y": 1, "w": 0.5},
{"label": "rtdd", "matrix": [0, 5], "x": 17, "y": 2, "h": 0.5},
{"label": "ltd", "matrix": [5, 2], "x": 16.5, "y": 1, "w": 0.5},
{"label": "lti", "matrix": [5, 3], "x": 19, "y": 1.5},
{"label": "ltu", "matrix": [5, 4], "x": 19, "y": 1, "h": 0.5},
{"label": "ltuo", "matrix": [5, 1], "x": 20, "y": 1.5, "w": 0.5},
{"label": "ltlo", "matrix": [5, 0], "x": 19, "y": 2.5, "h": 0.5},
{"label": "ltdd", "matrix": [5, 5], "x": 18.5, "y": 1.5, "w": 0.5}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once

#include_next "mcuconf.h"

#if defined(POINTING_DEVICE_IS_PIMORONI)
Expand All @@ -17,4 +16,4 @@
#undef RP_SPI_USE_SPI0
#define RP_SPI_USE_SPI0 TRUE
#endif
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ POINTING_DEVICE_ENABLE = yes
# this selects trackball driver
POINTING_DEVICE_DRIVER = pmw3360
# pimoroni_trackball
# pmw3389
# pmw3389
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
#define SERIAL_USART_RX_PIN GP0
#define SERIAL_USART_FULL_DUPLEX
#define SERIAL_PIO_USE_PIO0
#define SPLIT_POINTING_ENABLE
#define POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
OPT_DEFS += -DINIT_EE_HANDS_RIGHT
# # this turns on trackpoint:
# PS2_MOUSE_ENABLE = yes
PS2_MOUSE_ENABLE = yes
# # this turns on Manna-Harbour's automousekeys:
# MH_AUTO_BUTTONS = yes
MH_AUTO_BUTTONS = yes
# # this selects trackball driver

POINTING_DEVICE_ENABLE = yes
POINTING_DEVICE_DRIVER = custom
# this selects trackball driver
POINTING_DEVICE_DRIVER = pmw3360
#POINTING_DEVICE_DRIVER = pmw3360
File renamed without changes.
34 changes: 31 additions & 3 deletions keyboards/svalboard/keymaps/vial/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,33 @@ const uint16_t PROGMEM keymaps[NUM_LAYERS][MATRIX_ROWS][MATRIX_COLS] = {
};


#if defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && defined MOUSEKEY_ENABLE
void mouse_mode(bool);
#if (defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && defined MOUSEKEY_ENABLE) || defined(POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE)

static uint16_t mh_auto_buttons_timer;
extern int tp_buttons; // mousekey button state set in action.c and used in ps2_mouse.c

void mouse_mode(bool);

#endif

#if defined(POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE)
report_mouse_t pointing_device_task_user(report_mouse_t reportMouse) {
print("mh_auto_buttons: called\n");
if (reportMouse.x == 0 && reportMouse.y == 0)
return reportMouse;

if (mh_auto_buttons_timer) {
mh_auto_buttons_timer = timer_read();
} else {
mouse_mode(true);
#if defined CONSOLE_ENABLE
print("mh_auto_buttons: on\n");
#endif
}
return reportMouse;
}
#endif


bool process_record_user(uint16_t keycode, keyrecord_t *record) {

Expand All @@ -179,14 +199,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %u, time: %5u, int: %u, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count);
#endif

#if defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && defined MOUSEKEY_ENABLE
#if (defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && defined MOUSEKEY_ENABLE) || defined(POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE)
if (mh_auto_buttons_timer) {
switch (keycode) {
case KC_BTN1:
case KC_BTN2:
case KC_BTN3:
case KC_BTN4:
case KC_BTN5:
case KC_WH_U:
case KC_WH_D:
case KC_WH_R:
case KC_WH_L:
break;
default:
mouse_mode(false);
Expand Down Expand Up @@ -234,7 +258,11 @@ void ps2_mouse_moved_user(report_mouse_t *mouse_report) {
}
}
}
#endif



#if (defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && defined MOUSEKEY_ENABLE) || defined(POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE)
void matrix_scan_user(void) {
if (mh_auto_buttons_timer && (timer_elapsed(mh_auto_buttons_timer) > MH_AUTO_BUTTONS_TIMEOUT)) {
if (!tp_buttons) {
Expand Down
8 changes: 4 additions & 4 deletions keyboards/svalboard/trackball/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#undef PS2_MOUSE_ENABLE
// in config.h:
#define POINTING_DEVICE_AUTO_MOUSE_ENABLE

#ifdef PS2_MOUSE_ENABLE
//#define SERIAL_PIO_USE_PIO1
Expand All @@ -35,6 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Pointing device stuff
#define SPLIT_POINTING_ENABLE
#define POINTING_DEVICE_COMBINED
#define POINTING_DEVICE_AUTO_MOUSE_ENABLE

#if defined(POINTING_DEVICE_IS_PIMORONI)

Expand Down Expand Up @@ -77,7 +77,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PMW33XX_CS_PIN GP17
#endif
#define PMW33XX_CS_DIVISOR 4
#define PMW33XX_CPI 400
#define PMW33XX_CPI 2000
#define POINTING_DEVICE_COMBINED
#define POINTING_DEVICE_INVERT_Y_RIGHT
//#define POINTING_DEVICE_INVERT_X_RIGHT
Expand All @@ -88,7 +88,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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
// #define PS2_MOUSE_SCROLL_BTN_MASK 0
#define PS2_MOUSE_SCROLL_BTN_MASK (1<<PS2_MOUSE_BTN_MIDDLE) // this mask disables the key for non-PS2 purposes
#endif

2 changes: 1 addition & 1 deletion keyboards/svalboard/trackball/left/config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define SERIAL_USART_TX_PIN GP0
#define SERIAL_USART_RX_PIN GP1
#define SERIAL_USART_FULL_DUPLEX
#define SERIAL_PIO_USE_PIO0
#define SERIAL_PIO_USE_PIO0
2 changes: 1 addition & 1 deletion keyboards/svalboard/trackball/right/config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define SERIAL_USART_TX_PIN GP1
#define SERIAL_USART_RX_PIN GP0
#define SERIAL_USART_FULL_DUPLEX
#define SERIAL_PIO_USE_PIO0
#define SERIAL_PIO_USE_PIO0

0 comments on commit a3187ae

Please sign in to comment.