From a25b0f07780951b2486c182ca776c219e49355ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurij=20Podgor=C5=A1ek?= Date: Tue, 25 Jun 2024 00:34:33 +0200 Subject: [PATCH] Update daktil config for latest QMK --- keyboards/handwired/daktil/config.h | 18 --- keyboards/handwired/daktil/keyboard.json | 117 ++++++++++++++++++ .../handwired/daktil/keymaps/default/keymap.c | 36 +++--- keyboards/handwired/daktil/matrix.c | 23 +--- keyboards/handwired/daktil/rules.mk | 24 +--- 5 files changed, 142 insertions(+), 76 deletions(-) create mode 100644 keyboards/handwired/daktil/keyboard.json diff --git a/keyboards/handwired/daktil/config.h b/keyboards/handwired/daktil/config.h index dc0a3e117a..b67404273c 100644 --- a/keyboards/handwired/daktil/config.h +++ b/keyboards/handwired/daktil/config.h @@ -20,16 +20,6 @@ along with this program. If not, see . #ifndef DACTYL_CONFIG_H #define DACTYL_CONFIG_H -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x6660 -#define PRODUCT_ID 0xD571 -#define DEVICE_VER 0x0002 -#define MANUFACTURER Ludamila -#define PRODUCT Daktil -#define DESCRIPTION Dober stukar. Vec: wiki.ljudmila.org - /* key matrix size * At this time, "row" in the dactyl's code actually means "column" on the * physical keyboard. It's confusing. I'm sorry. Blame Jack Humbert :P @@ -44,10 +34,7 @@ along with this program. If not, see . #define MOUSEKEY_WHEEL_MAX_SPEED 3 #define MOUSEKEY_WHEEL_TIME_TO_MAX 40 -#define TAPPING_TOGGLE 1 - #define TAPPING_TERM 200 -#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) /* key combination for command */ #define IS_COMMAND() ( \ @@ -58,11 +45,6 @@ along with this program. If not, see . /* fix space cadet rollover issue */ #define DISABLE_SPACE_CADET_ROLLOVER -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 15 - -#define PREVENT_STUCK_MODIFIERS - #define USB_MAX_POWER_CONSUMPTION 500 #endif diff --git a/keyboards/handwired/daktil/keyboard.json b/keyboards/handwired/daktil/keyboard.json new file mode 100644 index 0000000000..181930fec1 --- /dev/null +++ b/keyboards/handwired/daktil/keyboard.json @@ -0,0 +1,117 @@ +{ + "keyboard_name": "Daktil", + "manufacturer": "Ludamila", + "url": "https://wiki.ljudmila.org/Tipkovnica_dactyl", + "maintainer": "qmk", + "usb": { + "vid": "0x6660", + "pid": "0xD571", + "device_version": "0.0.3" + }, + "processor": "atmega32u4", + "bootloader": "caterina", + "diode_direction": "COL2ROW", + "features": { + "mousekey": true, + "extrakey": true, + "nkro": true, + "unicode": true, + "swap_hands": true, + "dynamic_macros": true + }, + "debounce": 5, + "tapping": { + "toggle": 1 + }, + "layout_aliases": { + "LAYOUT_daktil": "LAYOUT" + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 1], "x": 1, "y": 0}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + + {"matrix": [6, 0], "x": 11, "y": 0}, + {"matrix": [6, 1], "x": 12, "y": 0}, + {"matrix": [6, 2], "x": 13, "y": 0}, + {"matrix": [6, 3], "x": 14, "y": 0}, + {"matrix": [6, 4], "x": 15, "y": 0}, + {"matrix": [6, 5], "x": 16, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1}, + {"matrix": [1, 5], "x": 5, "y": 1}, + + {"matrix": [7, 0], "x": 11, "y": 1}, + {"matrix": [7, 1], "x": 12, "y": 1}, + {"matrix": [7, 2], "x": 13, "y": 1}, + {"matrix": [7, 3], "x": 14, "y": 1}, + {"matrix": [7, 4], "x": 15, "y": 1}, + {"matrix": [7, 5], "x": 16, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2}, + {"matrix": [2, 5], "x": 5, "y": 2}, + + {"matrix": [8, 0], "x": 11, "y": 2}, + {"matrix": [8, 1], "x": 12, "y": 2}, + {"matrix": [8, 2], "x": 13, "y": 2}, + {"matrix": [8, 3], "x": 14, "y": 2}, + {"matrix": [8, 4], "x": 15, "y": 2}, + {"matrix": [8, 5], "x": 16, "y": 2}, + + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3}, + {"matrix": [3, 5], "x": 5, "y": 3}, + + {"matrix": [9, 0], "x": 11, "y": 3}, + {"matrix": [9, 1], "x": 12, "y": 3}, + {"matrix": [9, 2], "x": 13, "y": 3}, + {"matrix": [9, 3], "x": 14, "y": 3}, + {"matrix": [9, 4], "x": 15, "y": 3}, + {"matrix": [9, 5], "x": 16, "y": 3}, + + {"matrix": [4, 2], "x": 2, "y": 4}, + {"matrix": [4, 3], "x": 3, "y": 4}, + + {"matrix": [10, 2], "x": 13, "y": 4}, + {"matrix": [10, 3], "x": 14, "y": 4}, + + {"matrix": [4, 4], "x": 4, "y": 5}, + {"matrix": [4, 5], "x": 5, "y": 5}, + + {"matrix": [10, 0], "x": 11, "y": 5}, + {"matrix": [10, 1], "x": 12, "y": 5}, + + {"matrix": [5, 4], "x": 6, "y": 6}, + {"matrix": [5, 5], "x": 7, "y": 6}, + + {"matrix": [11, 0], "x": 9, "y": 6}, + {"matrix": [11, 1], "x": 10, "y": 6}, + + {"matrix": [5, 2], "x": 6, "y": 7}, + {"matrix": [5, 3], "x": 7, "y": 7}, + + {"matrix": [11, 2], "x": 9, "y": 7}, + {"matrix": [11, 3], "x": 10, "y": 7} + ] + } + }, + "macros": { + + } +} diff --git a/keyboards/handwired/daktil/keymaps/default/keymap.c b/keyboards/handwired/daktil/keymaps/default/keymap.c index 09bdaf1667..6fa4acd9f8 100644 --- a/keyboards/handwired/daktil/keymaps/default/keymap.c +++ b/keyboards/handwired/daktil/keymaps/default/keymap.c @@ -42,15 +42,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // left hand LALT(KC_LSFT), KC_1, KC_2, KC_3, KC_4, KC_5, LT(TKTK,KC_EQL), KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_LSPO, KC_A, KC_S, KC_D, KC_F, KC_G, + SC_LSPO, KC_A, KC_S, KC_D, KC_F, KC_G, LT(SYMB,KC_GRV), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, - KC_DELT, KC_INS, KC_SPC,KC_BSPC, + KC_DEL, KC_INS, KC_SPC,KC_BSPC, ALT_T(KC_APP), LGUI_T(KC_ESC), KC_END, KC_HOME, // right hand KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_Y, KC_U, KC_I, KC_O, KC_P,LT(TKTK,KC_BSLS), - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), KC_RSPC, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), SC_RSPC, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH),LT(SYMB,KC_QUOT), KC_TAB, KC_ENT, KC_LBRC, KC_RBRC, LGUI_T(KC_ESC), KC_RALT, @@ -120,15 +120,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // MEDIA AND MOUSE [MDIA] = LAYOUT_dactyl( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RESET, KC_TRNS, KC_WH_U, KC_MS_U, KC_WH_D, KC_TRNS, + KC_TRNS, KC_TRNS, KC_WH_U, KC_MS_U, KC_WH_D, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_MPLY, KC_BTN3, KC_MPRV, KC_MNXT, // right hand - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, @@ -138,20 +138,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // TK LAYER [TKTK] = LAYOUT_dactyl( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RESET, KC_TRNS, KC_WH_U, KC_MS_U, KC_WH_D, KC_TRNS, + KC_TRNS, KC_TRNS, KC_WH_U, KC_MS_U, KC_WH_D, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, DYN_MACRO_PLAY1, DYN_REC_START1, - KC_MPLY, DYN_REC_STOP, - KC_MPRV, KC_MNXT, + KC_TRNS, KC_TRNS, DM_PLY1, DM_REC1, + KC_MPLY, DM_RSTP, + KC_MPRV, KC_MNXT, // right hand - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - DYN_REC_START2, DYN_MACRO_PLAY2, KC_VOLD, KC_VOLU, - DYN_REC_STOP, KC_MUTE, - KC_TRNS, KC_TRNS + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + DM_REC2, DM_PLY2, KC_VOLD, KC_VOLU, + DM_RSTP, KC_MUTE, + KC_TRNS, KC_TRNS ), }; @@ -159,6 +159,7 @@ const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) }; +/* TODO add this back! const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function @@ -192,6 +193,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } +*/ // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/keyboards/handwired/daktil/matrix.c b/keyboards/handwired/daktil/matrix.c index d58826e25f..54290b24f8 100644 --- a/keyboards/handwired/daktil/matrix.c +++ b/keyboards/handwired/daktil/matrix.c @@ -89,18 +89,6 @@ void matrix_scan_kb(void) { matrix_scan_user(); } -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - void matrix_init(void) { // initialize row and col @@ -124,8 +112,7 @@ void matrix_init(void) matrix_scan_count = 0; #endif - matrix_init_quantum(); - + matrix_init_kb(); } void matrix_power_up(void) { @@ -210,7 +197,7 @@ uint8_t matrix_scan(void) unselect_rows(); } - matrix_scan_quantum(); + matrix_scan_kb(); return 1; } @@ -220,13 +207,11 @@ bool matrix_is_modified(void) // deprecated and evidently not called. return true; } -inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1<