From 48b97f9f192be0146b572dcfbc86b726e5e59c8e Mon Sep 17 00:00:00 2001 From: "Md. Mashur Shalehin Sakib" Date: Tue, 28 Dec 2021 02:34:04 +0600 Subject: [PATCH 1/9] Adding Deskpad for PR --- keyboards/h0oni/deskpad/config.h | 62 +++++ keyboards/h0oni/deskpad/deskpad.c | 17 ++ keyboards/h0oni/deskpad/deskpad.h | 26 ++ keyboards/h0oni/deskpad/info.json | 15 ++ .../h0oni/deskpad/keymaps/default/keymap.c | 223 ++++++++++++++++++ keyboards/h0oni/deskpad/keymaps/via/keymap.c | 223 ++++++++++++++++++ keyboards/h0oni/deskpad/keymaps/via/rules.mk | 2 + keyboards/h0oni/deskpad/readme.md | 12 + keyboards/h0oni/deskpad/rules.mk | 23 ++ 9 files changed, 603 insertions(+) create mode 100644 keyboards/h0oni/deskpad/config.h create mode 100644 keyboards/h0oni/deskpad/deskpad.c create mode 100644 keyboards/h0oni/deskpad/deskpad.h create mode 100644 keyboards/h0oni/deskpad/info.json create mode 100644 keyboards/h0oni/deskpad/keymaps/default/keymap.c create mode 100644 keyboards/h0oni/deskpad/keymaps/via/keymap.c create mode 100644 keyboards/h0oni/deskpad/keymaps/via/rules.mk create mode 100644 keyboards/h0oni/deskpad/readme.md create mode 100644 keyboards/h0oni/deskpad/rules.mk diff --git a/keyboards/h0oni/deskpad/config.h b/keyboards/h0oni/deskpad/config.h new file mode 100644 index 000000000000..c5c8054ca121 --- /dev/null +++ b/keyboards/h0oni/deskpad/config.h @@ -0,0 +1,62 @@ +/* Copyright 2021 Hydrogen BD + * + * 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 . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4D53 +#define PRODUCT_ID 0x4450 //hD +#define DEVICE_VER 0x0001 +#define MANUFACTURER Hydrogen +#define PRODUCT Deskpad + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, C6 } +#define MATRIX_COL_PINS { D0, D4, D1} +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 3 + +/* Defining encoder pads */ +#define ENCODERS_PAD_A { D2 } +#define ENCODERS_PAD_B { D3 } + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* Defining tapping term */ +#define TAPPING_TERM 250 \ No newline at end of file diff --git a/keyboards/h0oni/deskpad/deskpad.c b/keyboards/h0oni/deskpad/deskpad.c new file mode 100644 index 000000000000..7e54b8853371 --- /dev/null +++ b/keyboards/h0oni/deskpad/deskpad.c @@ -0,0 +1,17 @@ +/* Copyright 2021 Hydrogen BD + * + * 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 . + */ + +#include "deskpad.h" \ No newline at end of file diff --git a/keyboards/h0oni/deskpad/deskpad.h b/keyboards/h0oni/deskpad/deskpad.h new file mode 100644 index 000000000000..5f69943360eb --- /dev/null +++ b/keyboards/h0oni/deskpad/deskpad.h @@ -0,0 +1,26 @@ +/* Copyright 2021 Hydrogen BD + * + * 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 . + */ + +#pragma once + +#include "quantum.h" + +#define LAYOUT_all( \ + K00, K01, K02, K10, K11, K12\ +) { \ + { K00, K01, K02 },\ + { K10, K11, K12 } \ +} \ No newline at end of file diff --git a/keyboards/h0oni/deskpad/info.json b/keyboards/h0oni/deskpad/info.json new file mode 100644 index 000000000000..b5622d578f2b --- /dev/null +++ b/keyboards/h0oni/deskpad/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "Deskpad", + "url": "", + "maintainer": "Hydrogen BD", + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"k1", "x":0, "y":0}, + {"label":"k2", "x":1, "y":0}, + {"label":"k3", "x":2, "y":0}, + {"label":"k4", "x":3, "y":0}, + {"label":"k5", "x":4, "y":0}, + {"label":"k6", "x":6, "y":0}] + } + } +} diff --git a/keyboards/h0oni/deskpad/keymaps/default/keymap.c b/keyboards/h0oni/deskpad/keymaps/default/keymap.c new file mode 100644 index 000000000000..d2a7a1656231 --- /dev/null +++ b/keyboards/h0oni/deskpad/keymaps/default/keymap.c @@ -0,0 +1,223 @@ +/* Copyright 2021 Hydrogen BD + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "quantum.h" + +typedef enum { + TD_NONE, + TD_UNKNOWN, + TD_SINGLE_TAP, + TD_SINGLE_HOLD, + TD_DOUBLE_TAP, + TD_DOUBLE_HOLD, + TD_DOUBLE_SINGLE_TAP, // Send two single taps +} td_state_t; + +typedef struct { + bool is_press_action; + td_state_t state; +} td_tap_t; + +enum custom_keycodes { + TD_CUT_REDO, + TD_PLAY_PAUSE_MUTE, + TD_MNXT_RIGHT, + TD_MPRV_LEFT, + TD_SEARCH_REFRESH, + QUAD_LAYER_SWITCH, + QUAD_CVXA, + YOUTUBE=SAFE_RANGE, + FACEBOOK, + DISCORD, + VALORANT, + VSCODE, +}; + +td_state_t cur_dance(qk_tap_dance_state_t *state); + +/* Quad layer switching */ +void layer_finished(qk_tap_dance_state_t *state, void *user_data); +void layer_reset(qk_tap_dance_state_t *state, void *user_data); + +/* Copy, paste, select all, cut */ +void cvxa_finished(qk_tap_dance_state_t *state, void *user_data); +void cvxa_reset(qk_tap_dance_state_t *state, void *user_data); + +static td_tap_t layerTap_state = { + .is_press_action = true, + .state = TD_NONE +}; + +static td_tap_t cvxa_state = { + .is_press_action = true, + .state = TD_NONE +}; + +// Determine the current tap dance state +td_state_t cur_dance(qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) return TD_SINGLE_TAP; + // Key has not been interrupted, but the key is still held. Means you want to send a 'HOLD'. + else return TD_SINGLE_HOLD; + } else if (state->count == 2) { + if (state->interrupted) return TD_DOUBLE_SINGLE_TAP; + else if (state->pressed) return TD_DOUBLE_HOLD; + else return TD_DOUBLE_TAP; + } else return TD_UNKNOWN; +} + +void layer_finished(qk_tap_dance_state_t *state, void *user_data) { + layerTap_state.state = cur_dance(state); + layer_off(get_highest_layer(layer_state)); + switch (layerTap_state.state) { + case TD_SINGLE_TAP: layer_on(0); break; + case TD_SINGLE_HOLD: layer_on(1); break; + case TD_DOUBLE_TAP: layer_on(2); break; + case TD_DOUBLE_HOLD: layer_on(3); break; + default: layer_on(0); + } +} + +void layer_reset(qk_tap_dance_state_t *state, void *user_data) { + layerTap_state.state = TD_NONE; +} + +void cvxa_finished(qk_tap_dance_state_t *state, void *user_data) { + cvxa_state.state = cur_dance(state); + register_mods(MOD_BIT(KC_LCTRL)); + switch (cvxa_state.state) { + case TD_SINGLE_TAP: tap_code(KC_V); break; + case TD_SINGLE_HOLD: tap_code(KC_A); break; + case TD_DOUBLE_TAP: tap_code(KC_C); break; + case TD_DOUBLE_HOLD: tap_code(KC_X); break; + default: tap_code(KC_V); + } + unregister_mods(MOD_BIT(KC_LCTRL)); +} + +void cvxa_reset(qk_tap_dance_state_t *state, void *user_data) { + cvxa_state.state = TD_NONE; +} + +// Tap Dance definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_CUT_REDO] = ACTION_TAP_DANCE_DOUBLE(C(KC_Z), S(C(KC_Z))), + [TD_PLAY_PAUSE_MUTE] = ACTION_TAP_DANCE_DOUBLE(KC_MPLY, KC_MUTE), + [TD_MNXT_RIGHT] = ACTION_TAP_DANCE_DOUBLE(KC_MNXT, KC_RIGHT), + [TD_MPRV_LEFT] = ACTION_TAP_DANCE_DOUBLE(KC_MPRV, KC_LEFT), + [TD_SEARCH_REFRESH] = ACTION_TAP_DANCE_DOUBLE(KC_WREF, KC_WSCH), + [QUAD_LAYER_SWITCH] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, layer_finished, layer_reset), + [QUAD_CVXA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, cvxa_finished, cvxa_reset) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case YOUTUBE: + if (record->event.pressed) { + tap_code16(C(KC_L)); + SEND_STRING("https://www.youtube.com/"); + } else { + tap_code(KC_ENT); + } + break; + case FACEBOOK: + if (record->event.pressed) { + tap_code16(C(KC_L)); + SEND_STRING("https://www.facebook.com/"); + } else { + tap_code(KC_ENT); + } + break; + case VALORANT: + if (record->event.pressed) { + tap_code16(G(KC_S)); + SEND_STRING("valorant"); + } else { + tap_code(KC_ENT); + } + break; + case DISCORD: + if (record->event.pressed) { + tap_code16(G(KC_S)); + SEND_STRING("discord"); + } else { + tap_code(KC_ENT); + } + break; + case VSCODE: + if (record->event.pressed) { + tap_code16(G(KC_S)); + SEND_STRING("vscode"); + } else { + tap_code(KC_ENT); + } + break; + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + TD(TD_CUT_REDO), TD(TD_MPRV_LEFT), TD(TD_PLAY_PAUSE_MUTE), TD(TD_MNXT_RIGHT), TD(QUAD_CVXA), TD(QUAD_LAYER_SWITCH) + ), + + [1] = LAYOUT_all( + YOUTUBE, KC_WBAK, TD(TD_SEARCH_REFRESH), KC_WFWD, FACEBOOK, TD(QUAD_LAYER_SWITCH) + ), + + [2] = LAYOUT_all( + A(KC_F4), LSG(KC_S), KC_MYCM, RCA(KC_DEL), MY_CALC, TD(QUAD_LAYER_SWITCH) + ), + + [3] = LAYOUT_all( + C(KC_SLSH), VALORANT, VSCODE, DISCORD, LSA(KC_A), TD(QUAD_LAYER_SWITCH) + ), +}; + +bool encoder_update_user(uint8_t index, bool clockwise) { + const layer_state_t curr_layer = get_highest_layer(layer_state); + if(curr_layer == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + else if(curr_layer == 1) { + if (clockwise) { + tap_code(KC_WH_D); + } else { + tap_code(KC_WH_U); + } + } + else if(curr_layer == 1) { + if (clockwise) { + tap_code(C(KC_WH_U)); + } else { + tap_code(C(KC_WH_D)); + } + } + else { + if (clockwise) { + tap_code(KC_BRIU); + } else { + tap_code(KC_BRID); + } + } + return false; +} \ No newline at end of file diff --git a/keyboards/h0oni/deskpad/keymaps/via/keymap.c b/keyboards/h0oni/deskpad/keymaps/via/keymap.c new file mode 100644 index 000000000000..d2a7a1656231 --- /dev/null +++ b/keyboards/h0oni/deskpad/keymaps/via/keymap.c @@ -0,0 +1,223 @@ +/* Copyright 2021 Hydrogen BD + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "quantum.h" + +typedef enum { + TD_NONE, + TD_UNKNOWN, + TD_SINGLE_TAP, + TD_SINGLE_HOLD, + TD_DOUBLE_TAP, + TD_DOUBLE_HOLD, + TD_DOUBLE_SINGLE_TAP, // Send two single taps +} td_state_t; + +typedef struct { + bool is_press_action; + td_state_t state; +} td_tap_t; + +enum custom_keycodes { + TD_CUT_REDO, + TD_PLAY_PAUSE_MUTE, + TD_MNXT_RIGHT, + TD_MPRV_LEFT, + TD_SEARCH_REFRESH, + QUAD_LAYER_SWITCH, + QUAD_CVXA, + YOUTUBE=SAFE_RANGE, + FACEBOOK, + DISCORD, + VALORANT, + VSCODE, +}; + +td_state_t cur_dance(qk_tap_dance_state_t *state); + +/* Quad layer switching */ +void layer_finished(qk_tap_dance_state_t *state, void *user_data); +void layer_reset(qk_tap_dance_state_t *state, void *user_data); + +/* Copy, paste, select all, cut */ +void cvxa_finished(qk_tap_dance_state_t *state, void *user_data); +void cvxa_reset(qk_tap_dance_state_t *state, void *user_data); + +static td_tap_t layerTap_state = { + .is_press_action = true, + .state = TD_NONE +}; + +static td_tap_t cvxa_state = { + .is_press_action = true, + .state = TD_NONE +}; + +// Determine the current tap dance state +td_state_t cur_dance(qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) return TD_SINGLE_TAP; + // Key has not been interrupted, but the key is still held. Means you want to send a 'HOLD'. + else return TD_SINGLE_HOLD; + } else if (state->count == 2) { + if (state->interrupted) return TD_DOUBLE_SINGLE_TAP; + else if (state->pressed) return TD_DOUBLE_HOLD; + else return TD_DOUBLE_TAP; + } else return TD_UNKNOWN; +} + +void layer_finished(qk_tap_dance_state_t *state, void *user_data) { + layerTap_state.state = cur_dance(state); + layer_off(get_highest_layer(layer_state)); + switch (layerTap_state.state) { + case TD_SINGLE_TAP: layer_on(0); break; + case TD_SINGLE_HOLD: layer_on(1); break; + case TD_DOUBLE_TAP: layer_on(2); break; + case TD_DOUBLE_HOLD: layer_on(3); break; + default: layer_on(0); + } +} + +void layer_reset(qk_tap_dance_state_t *state, void *user_data) { + layerTap_state.state = TD_NONE; +} + +void cvxa_finished(qk_tap_dance_state_t *state, void *user_data) { + cvxa_state.state = cur_dance(state); + register_mods(MOD_BIT(KC_LCTRL)); + switch (cvxa_state.state) { + case TD_SINGLE_TAP: tap_code(KC_V); break; + case TD_SINGLE_HOLD: tap_code(KC_A); break; + case TD_DOUBLE_TAP: tap_code(KC_C); break; + case TD_DOUBLE_HOLD: tap_code(KC_X); break; + default: tap_code(KC_V); + } + unregister_mods(MOD_BIT(KC_LCTRL)); +} + +void cvxa_reset(qk_tap_dance_state_t *state, void *user_data) { + cvxa_state.state = TD_NONE; +} + +// Tap Dance definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_CUT_REDO] = ACTION_TAP_DANCE_DOUBLE(C(KC_Z), S(C(KC_Z))), + [TD_PLAY_PAUSE_MUTE] = ACTION_TAP_DANCE_DOUBLE(KC_MPLY, KC_MUTE), + [TD_MNXT_RIGHT] = ACTION_TAP_DANCE_DOUBLE(KC_MNXT, KC_RIGHT), + [TD_MPRV_LEFT] = ACTION_TAP_DANCE_DOUBLE(KC_MPRV, KC_LEFT), + [TD_SEARCH_REFRESH] = ACTION_TAP_DANCE_DOUBLE(KC_WREF, KC_WSCH), + [QUAD_LAYER_SWITCH] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, layer_finished, layer_reset), + [QUAD_CVXA] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, cvxa_finished, cvxa_reset) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case YOUTUBE: + if (record->event.pressed) { + tap_code16(C(KC_L)); + SEND_STRING("https://www.youtube.com/"); + } else { + tap_code(KC_ENT); + } + break; + case FACEBOOK: + if (record->event.pressed) { + tap_code16(C(KC_L)); + SEND_STRING("https://www.facebook.com/"); + } else { + tap_code(KC_ENT); + } + break; + case VALORANT: + if (record->event.pressed) { + tap_code16(G(KC_S)); + SEND_STRING("valorant"); + } else { + tap_code(KC_ENT); + } + break; + case DISCORD: + if (record->event.pressed) { + tap_code16(G(KC_S)); + SEND_STRING("discord"); + } else { + tap_code(KC_ENT); + } + break; + case VSCODE: + if (record->event.pressed) { + tap_code16(G(KC_S)); + SEND_STRING("vscode"); + } else { + tap_code(KC_ENT); + } + break; + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + TD(TD_CUT_REDO), TD(TD_MPRV_LEFT), TD(TD_PLAY_PAUSE_MUTE), TD(TD_MNXT_RIGHT), TD(QUAD_CVXA), TD(QUAD_LAYER_SWITCH) + ), + + [1] = LAYOUT_all( + YOUTUBE, KC_WBAK, TD(TD_SEARCH_REFRESH), KC_WFWD, FACEBOOK, TD(QUAD_LAYER_SWITCH) + ), + + [2] = LAYOUT_all( + A(KC_F4), LSG(KC_S), KC_MYCM, RCA(KC_DEL), MY_CALC, TD(QUAD_LAYER_SWITCH) + ), + + [3] = LAYOUT_all( + C(KC_SLSH), VALORANT, VSCODE, DISCORD, LSA(KC_A), TD(QUAD_LAYER_SWITCH) + ), +}; + +bool encoder_update_user(uint8_t index, bool clockwise) { + const layer_state_t curr_layer = get_highest_layer(layer_state); + if(curr_layer == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + else if(curr_layer == 1) { + if (clockwise) { + tap_code(KC_WH_D); + } else { + tap_code(KC_WH_U); + } + } + else if(curr_layer == 1) { + if (clockwise) { + tap_code(C(KC_WH_U)); + } else { + tap_code(C(KC_WH_D)); + } + } + else { + if (clockwise) { + tap_code(KC_BRIU); + } else { + tap_code(KC_BRID); + } + } + return false; +} \ No newline at end of file diff --git a/keyboards/h0oni/deskpad/keymaps/via/rules.mk b/keyboards/h0oni/deskpad/keymaps/via/rules.mk new file mode 100644 index 000000000000..36b7ba9cbc98 --- /dev/null +++ b/keyboards/h0oni/deskpad/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/h0oni/deskpad/readme.md b/keyboards/h0oni/deskpad/readme.md new file mode 100644 index 000000000000..8a116db1ca43 --- /dev/null +++ b/keyboards/h0oni/deskpad/readme.md @@ -0,0 +1,12 @@ +# Hydrogen Deskpad + +A 5 key macropad with an encoder, that can be mounted to a desk or below your monitor. + +* Keyboard Maintainer: Hydrogen BD +* Hardware Supported: 5k Deskpad + +Make example for this keyboard (after setting up your build environment): + + make h0oni/deskpad:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/h0oni/deskpad/rules.mk b/keyboards/h0oni/deskpad/rules.mk new file mode 100644 index 000000000000..2773d967de81 --- /dev/null +++ b/keyboards/h0oni/deskpad/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# 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 +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes +TAP_DANCE_ENABLE = yes \ No newline at end of file From 0cc16e8b9955fccfc65fa34e181088e76bdd6ca4 Mon Sep 17 00:00:00 2001 From: "Md. Mashur Shalehin Sakib" <41992136+h0oni@users.noreply.github.com> Date: Tue, 28 Dec 2021 13:17:57 +0600 Subject: [PATCH 2/9] fixed the default keycap.c there were some typos. --- keyboards/h0oni/deskpad/keymaps/default/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/h0oni/deskpad/keymaps/default/keymap.c b/keyboards/h0oni/deskpad/keymaps/default/keymap.c index d2a7a1656231..a3d788fcb571 100644 --- a/keyboards/h0oni/deskpad/keymaps/default/keymap.c +++ b/keyboards/h0oni/deskpad/keymaps/default/keymap.c @@ -181,7 +181,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [2] = LAYOUT_all( - A(KC_F4), LSG(KC_S), KC_MYCM, RCA(KC_DEL), MY_CALC, TD(QUAD_LAYER_SWITCH) + A(KC_F4), SGUI(KC_S), KC_MYCM, LCA(KC_DEL), KC_CALC, TD(QUAD_LAYER_SWITCH) ), [3] = LAYOUT_all( @@ -207,9 +207,9 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } else if(curr_layer == 1) { if (clockwise) { - tap_code(C(KC_WH_U)); + tap_code16(C(KC_WH_U)); } else { - tap_code(C(KC_WH_D)); + tap_code16(C(KC_WH_D)); } } else { @@ -220,4 +220,4 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } } return false; -} \ No newline at end of file +} From f5e4e6ec870da78da0e97175645f2de980f36084 Mon Sep 17 00:00:00 2001 From: "Md. Mashur Shalehin Sakib" <41992136+h0oni@users.noreply.github.com> Date: Tue, 28 Dec 2021 13:18:42 +0600 Subject: [PATCH 3/9] fixed the via keymap.c --- keyboards/h0oni/deskpad/keymaps/via/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/h0oni/deskpad/keymaps/via/keymap.c b/keyboards/h0oni/deskpad/keymaps/via/keymap.c index d2a7a1656231..a3d788fcb571 100644 --- a/keyboards/h0oni/deskpad/keymaps/via/keymap.c +++ b/keyboards/h0oni/deskpad/keymaps/via/keymap.c @@ -181,7 +181,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [2] = LAYOUT_all( - A(KC_F4), LSG(KC_S), KC_MYCM, RCA(KC_DEL), MY_CALC, TD(QUAD_LAYER_SWITCH) + A(KC_F4), SGUI(KC_S), KC_MYCM, LCA(KC_DEL), KC_CALC, TD(QUAD_LAYER_SWITCH) ), [3] = LAYOUT_all( @@ -207,9 +207,9 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } else if(curr_layer == 1) { if (clockwise) { - tap_code(C(KC_WH_U)); + tap_code16(C(KC_WH_U)); } else { - tap_code(C(KC_WH_D)); + tap_code16(C(KC_WH_D)); } } else { @@ -220,4 +220,4 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } } return false; -} \ No newline at end of file +} From 1f7f5a77e0807f03e3a72c16d7ca089bec172e90 Mon Sep 17 00:00:00 2001 From: "Md. Mashur Shalehin Sakib" Date: Wed, 29 Dec 2021 17:34:51 +0600 Subject: [PATCH 4/9] fixes on Drashna's sugg --- keyboards/h0oni/deskpad/deskpad.c | 35 ++++++++++++++++- keyboards/h0oni/deskpad/deskpad.h | 4 +- .../h0oni/deskpad/keymaps/default/keymap.c | 38 +------------------ .../h0oni/deskpad/keymaps/default/rules.mk | 1 + keyboards/h0oni/deskpad/keymaps/via/keymap.c | 38 +------------------ keyboards/h0oni/deskpad/keymaps/via/rules.mk | 1 + keyboards/h0oni/deskpad/rules.mk | 3 +- 7 files changed, 44 insertions(+), 76 deletions(-) create mode 100644 keyboards/h0oni/deskpad/keymaps/default/rules.mk diff --git a/keyboards/h0oni/deskpad/deskpad.c b/keyboards/h0oni/deskpad/deskpad.c index 7e54b8853371..b5e3a26a329d 100644 --- a/keyboards/h0oni/deskpad/deskpad.c +++ b/keyboards/h0oni/deskpad/deskpad.c @@ -14,4 +14,37 @@ * along with this program. If not, see . */ -#include "deskpad.h" \ No newline at end of file +#include "deskpad.h" + +bool encoder_update_user(uint8_t index, bool clockwise) { + const layer_state_t curr_layer = get_highest_layer(layer_state); + if(curr_layer == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + else if(curr_layer == 1) { + if (clockwise) { + tap_code(KC_WH_D); + } else { + tap_code(KC_WH_U); + } + } + else if(curr_layer == 1) { + if (clockwise) { + tap_code16(C(KC_WH_U)); + } else { + tap_code16(C(KC_WH_D)); + } + } + else { + if (clockwise) { + tap_code(KC_BRIU); + } else { + tap_code(KC_BRID); + } + } + return false; +} \ No newline at end of file diff --git a/keyboards/h0oni/deskpad/deskpad.h b/keyboards/h0oni/deskpad/deskpad.h index 5f69943360eb..4c0936f8bf29 100644 --- a/keyboards/h0oni/deskpad/deskpad.h +++ b/keyboards/h0oni/deskpad/deskpad.h @@ -23,4 +23,6 @@ ) { \ { K00, K01, K02 },\ { K10, K11, K12 } \ -} \ No newline at end of file +} + + diff --git a/keyboards/h0oni/deskpad/keymaps/default/keymap.c b/keyboards/h0oni/deskpad/keymaps/default/keymap.c index a3d788fcb571..993200f18c52 100644 --- a/keyboards/h0oni/deskpad/keymaps/default/keymap.c +++ b/keyboards/h0oni/deskpad/keymaps/default/keymap.c @@ -15,7 +15,6 @@ */ #include QMK_KEYBOARD_H -#include "quantum.h" typedef enum { TD_NONE, @@ -40,7 +39,7 @@ enum custom_keycodes { TD_SEARCH_REFRESH, QUAD_LAYER_SWITCH, QUAD_CVXA, - YOUTUBE=SAFE_RANGE, + YOUTUBE = SAFE_RANGE, FACEBOOK, DISCORD, VALORANT, @@ -187,37 +186,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [3] = LAYOUT_all( C(KC_SLSH), VALORANT, VSCODE, DISCORD, LSA(KC_A), TD(QUAD_LAYER_SWITCH) ), -}; - -bool encoder_update_user(uint8_t index, bool clockwise) { - const layer_state_t curr_layer = get_highest_layer(layer_state); - if(curr_layer == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - else if(curr_layer == 1) { - if (clockwise) { - tap_code(KC_WH_D); - } else { - tap_code(KC_WH_U); - } - } - else if(curr_layer == 1) { - if (clockwise) { - tap_code16(C(KC_WH_U)); - } else { - tap_code16(C(KC_WH_D)); - } - } - else { - if (clockwise) { - tap_code(KC_BRIU); - } else { - tap_code(KC_BRID); - } - } - return false; -} +}; \ No newline at end of file diff --git a/keyboards/h0oni/deskpad/keymaps/default/rules.mk b/keyboards/h0oni/deskpad/keymaps/default/rules.mk new file mode 100644 index 000000000000..e5ddcae8d927 --- /dev/null +++ b/keyboards/h0oni/deskpad/keymaps/default/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes diff --git a/keyboards/h0oni/deskpad/keymaps/via/keymap.c b/keyboards/h0oni/deskpad/keymaps/via/keymap.c index a3d788fcb571..993200f18c52 100644 --- a/keyboards/h0oni/deskpad/keymaps/via/keymap.c +++ b/keyboards/h0oni/deskpad/keymaps/via/keymap.c @@ -15,7 +15,6 @@ */ #include QMK_KEYBOARD_H -#include "quantum.h" typedef enum { TD_NONE, @@ -40,7 +39,7 @@ enum custom_keycodes { TD_SEARCH_REFRESH, QUAD_LAYER_SWITCH, QUAD_CVXA, - YOUTUBE=SAFE_RANGE, + YOUTUBE = SAFE_RANGE, FACEBOOK, DISCORD, VALORANT, @@ -187,37 +186,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [3] = LAYOUT_all( C(KC_SLSH), VALORANT, VSCODE, DISCORD, LSA(KC_A), TD(QUAD_LAYER_SWITCH) ), -}; - -bool encoder_update_user(uint8_t index, bool clockwise) { - const layer_state_t curr_layer = get_highest_layer(layer_state); - if(curr_layer == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - else if(curr_layer == 1) { - if (clockwise) { - tap_code(KC_WH_D); - } else { - tap_code(KC_WH_U); - } - } - else if(curr_layer == 1) { - if (clockwise) { - tap_code16(C(KC_WH_U)); - } else { - tap_code16(C(KC_WH_D)); - } - } - else { - if (clockwise) { - tap_code(KC_BRIU); - } else { - tap_code(KC_BRID); - } - } - return false; -} +}; \ No newline at end of file diff --git a/keyboards/h0oni/deskpad/keymaps/via/rules.mk b/keyboards/h0oni/deskpad/keymaps/via/rules.mk index 36b7ba9cbc98..f61b35461043 100644 --- a/keyboards/h0oni/deskpad/keymaps/via/rules.mk +++ b/keyboards/h0oni/deskpad/keymaps/via/rules.mk @@ -1,2 +1,3 @@ VIA_ENABLE = yes LTO_ENABLE = yes +TAP_DANCE_ENABLE = yes \ No newline at end of file diff --git a/keyboards/h0oni/deskpad/rules.mk b/keyboards/h0oni/deskpad/rules.mk index 2773d967de81..a1bea899bef6 100644 --- a/keyboards/h0oni/deskpad/rules.mk +++ b/keyboards/h0oni/deskpad/rules.mk @@ -19,5 +19,4 @@ NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output -ENCODER_ENABLE = yes -TAP_DANCE_ENABLE = yes \ No newline at end of file +ENCODER_ENABLE = yes \ No newline at end of file From 755a8a4b26ae73ed4d5ccb8932f5454a99159c44 Mon Sep 17 00:00:00 2001 From: "Md. Mashur Shalehin Sakib" <41992136+h0oni@users.noreply.github.com> Date: Mon, 3 Jan 2022 20:06:44 +0600 Subject: [PATCH 5/9] Update keyboards/h0oni/deskpad/deskpad.c Co-authored-by: Drashna Jaelre --- keyboards/h0oni/deskpad/deskpad.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/h0oni/deskpad/deskpad.c b/keyboards/h0oni/deskpad/deskpad.c index b5e3a26a329d..31bb35071162 100644 --- a/keyboards/h0oni/deskpad/deskpad.c +++ b/keyboards/h0oni/deskpad/deskpad.c @@ -47,4 +47,5 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } } return false; -} \ No newline at end of file +} +#endif \ No newline at end of file From 1c9a60ac7df4156706dd60e18ce362c185118ee4 Mon Sep 17 00:00:00 2001 From: "Md. Mashur Shalehin Sakib" <41992136+h0oni@users.noreply.github.com> Date: Mon, 3 Jan 2022 20:06:57 +0600 Subject: [PATCH 6/9] Update keyboards/h0oni/deskpad/deskpad.c Co-authored-by: Drashna Jaelre --- keyboards/h0oni/deskpad/deskpad.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/h0oni/deskpad/deskpad.c b/keyboards/h0oni/deskpad/deskpad.c index 31bb35071162..b5a06ce429ee 100644 --- a/keyboards/h0oni/deskpad/deskpad.c +++ b/keyboards/h0oni/deskpad/deskpad.c @@ -16,7 +16,9 @@ #include "deskpad.h" +#ifdef ENCODER_ENABLE bool encoder_update_user(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } const layer_state_t curr_layer = get_highest_layer(layer_state); if(curr_layer == 0) { if (clockwise) { From d49966d7a2812fd6f6d62a3d95c93c7d3e985ed1 Mon Sep 17 00:00:00 2001 From: "Md. Mashur Shalehin Sakib" <41992136+h0oni@users.noreply.github.com> Date: Wed, 5 Jan 2022 10:25:48 +0600 Subject: [PATCH 7/9] Major changes in readme --- keyboards/h0oni/deskpad/deskpad.c | 2 +- keyboards/h0oni/deskpad/readme.md | 11 +++++++++-- keyboards/h0oni/deskpad/rules.mk | 3 --- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/keyboards/h0oni/deskpad/deskpad.c b/keyboards/h0oni/deskpad/deskpad.c index b5a06ce429ee..792ff9609d42 100644 --- a/keyboards/h0oni/deskpad/deskpad.c +++ b/keyboards/h0oni/deskpad/deskpad.c @@ -34,7 +34,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { tap_code(KC_WH_U); } } - else if(curr_layer == 1) { + else if(curr_layer == 2) { if (clockwise) { tap_code16(C(KC_WH_U)); } else { diff --git a/keyboards/h0oni/deskpad/readme.md b/keyboards/h0oni/deskpad/readme.md index 8a116db1ca43..a79983fff779 100644 --- a/keyboards/h0oni/deskpad/readme.md +++ b/keyboards/h0oni/deskpad/readme.md @@ -2,11 +2,18 @@ A 5 key macropad with an encoder, that can be mounted to a desk or below your monitor. -* Keyboard Maintainer: Hydrogen BD -* Hardware Supported: 5k Deskpad +* Keyboard Maintainer: [Hydrogen BD](https://www.facebook.com/hgenbd/) +* Hardware Supported: [5k Deskpad](https://fb.watch/akRLW7s-UT/) Make example for this keyboard (after setting up your build environment): make h0oni/deskpad:default +## Bootloader + +Enter the bootloader in 2 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (the left most key) and plug in the keyboard. +* **Physical reset button**: Press the button at the back of the PCB twice to enter into the bootloader mode. + See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/h0oni/deskpad/rules.mk b/keyboards/h0oni/deskpad/rules.mk index a1bea899bef6..aac5b3c914b6 100644 --- a/keyboards/h0oni/deskpad/rules.mk +++ b/keyboards/h0oni/deskpad/rules.mk @@ -12,9 +12,6 @@ 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 -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow From fbe313597306096c3423910951f9d9a2e9c56d8a Mon Sep 17 00:00:00 2001 From: "Md. Mashur Shalehin Sakib" <41992136+h0oni@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:01:18 +0600 Subject: [PATCH 8/9] Update keyboards/h0oni/deskpad/deskpad.c Co-authored-by: Drashna Jaelre --- keyboards/h0oni/deskpad/deskpad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/h0oni/deskpad/deskpad.c b/keyboards/h0oni/deskpad/deskpad.c index 792ff9609d42..d93a9df900e2 100644 --- a/keyboards/h0oni/deskpad/deskpad.c +++ b/keyboards/h0oni/deskpad/deskpad.c @@ -17,7 +17,7 @@ #include "deskpad.h" #ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { +bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; } const layer_state_t curr_layer = get_highest_layer(layer_state); if(curr_layer == 0) { From 82e3e47f27f84c95fd6648425a466ed2d8f3162b Mon Sep 17 00:00:00 2001 From: "Md. Mashur Shalehin Sakib" <41992136+h0oni@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:36:22 +0600 Subject: [PATCH 9/9] Update keyboards/h0oni/deskpad/rules.mk Co-authored-by: Ryan --- keyboards/h0oni/deskpad/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/h0oni/deskpad/rules.mk b/keyboards/h0oni/deskpad/rules.mk index aac5b3c914b6..f28bef72baa5 100644 --- a/keyboards/h0oni/deskpad/rules.mk +++ b/keyboards/h0oni/deskpad/rules.mk @@ -12,7 +12,7 @@ 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 # USB Nkey Rollover +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