diff --git a/.github/workflows/keyball44.yml b/.github/workflows/keyball44.yml new file mode 100644 index 000000000..6956c2e5d --- /dev/null +++ b/.github/workflows/keyball44.yml @@ -0,0 +1,64 @@ +name: Keyball44 firmware + +on: + push: + branches: + - '*' + tags: + - 'keyball44/v[0-9]+.[0-9]+.[0-9]+*' + pull_request: + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Checkout source + uses: actions/checkout@v2 + + - name: Setup QMK firmware + uses: ./.github/actions/setup-qmk + + - name: Install a link to own source + run: ln -s $(pwd)/qmk_firmware/keyboards/keyball __qmk__/keyboards/keyball + + - run: qmk compile -j 4 -kb keyball/keyball44 -km default + continue-on-error: true + + - run: qmk compile -j 4 -kb keyball/keyball44 -km test + continue-on-error: true + + - run: qmk compile -j 4 -kb keyball/keyball44 -km via + continue-on-error: true + + - name: Archive firmwares + uses: actions/upload-artifact@v2 + with: + name: keyball44-firmwares + path: __qmk__/*.hex + + release: + name: Release + runs-on: ubuntu-latest + needs: [ build ] + if: github.ref_type == 'tag' && startsWith(github.ref_name, 'keyball44/v') + + steps: + - name: Download built firmwares + uses: actions/download-artifact@v2 + with: + name: keyball44-firmwares + - name: List assets + run: ls -l *.hex + - name: Release + uses: softprops/action-gh-release@v1 + with: + draft: true + prerelease: ${{ contains(github.ref_name, '-alpha.') || contains(github.ref_name, '-beta.') }} + files: | + *.hex + fail_on_unmatched_files: true + generate_release_notes: true + append_body: true diff --git a/qmk_firmware/keyboards/keyball/keyball39/keymaps/default/keymap.c b/qmk_firmware/keyboards/keyball/keyball39/keymaps/default/keymap.c index 4a6e4a187..c5ab10e5c 100644 --- a/qmk_firmware/keyboards/keyball/keyball39/keymaps/default/keymap.c +++ b/qmk_firmware/keyboards/keyball/keyball39/keymaps/default/keymap.c @@ -22,7 +22,7 @@ along with this program. If not, see . // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // keymap for development + // keymap for default [0] = LAYOUT_universal( KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_MINS , diff --git a/qmk_firmware/keyboards/keyball/keyball39/keymaps/via/keymap.c b/qmk_firmware/keyboards/keyball/keyball39/keymaps/via/keymap.c index 785372c20..2ed0033bf 100644 --- a/qmk_firmware/keyboards/keyball/keyball39/keymaps/via/keymap.c +++ b/qmk_firmware/keyboards/keyball/keyball39/keymaps/via/keymap.c @@ -22,7 +22,7 @@ along with this program. If not, see . // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // keymap for development + // keymap for default (VIA) [0] = LAYOUT_universal( KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , diff --git a/qmk_firmware/keyboards/keyball/keyball44/.noci b/qmk_firmware/keyboards/keyball/keyball44/.noci new file mode 100644 index 000000000..e69de29bb diff --git a/qmk_firmware/keyboards/keyball/keyball44/config.h b/qmk_firmware/keyboards/keyball/keyball44/config.h new file mode 100644 index 000000000..82deb4725 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/config.h @@ -0,0 +1,81 @@ +/* +Copyright 2022 @Yowkees +Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya) + +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 parameters +#define VENDOR_ID 0x5957 // "YW" = Yowkees +#define PRODUCT_ID 0x0400 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yowkees +#define PRODUCT Keyball44 + +// Key matrix parameters +#define MATRIX_ROWS (4 * 2) // split keyboard +#define MATRIX_COLS 6 +#define MATRIX_ROW_PINS { F4, F5, F6, F7 } +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } +#define MATRIX_MASKED +#define DEBOUNCE 5 +#define DIODE_DIRECTION COL2ROW + +// Split parameters +#define SOFT_SERIAL_PIN D2 +#define SPLIT_HAND_MATRIX_GRID F7, D4 +#define SPLIT_USB_DETECT +#define SPLIT_USB_TIMEOUT 500 + +#define SPLIT_TRANSACTION_IDS_KB KEYBALL_GET_INFO, KEYBALL_GET_MOTION, KEYBALL_SET_CPI + +// RGB LED settings +#define RGB_DI_PIN D3 +#ifdef RGBLIGHT_ENABLE +# define RGBLED_NUM 60 +# define RGBLED_SPLIT { 30, 30 } // (30 + 29) +# ifndef RGBLIGHT_LIMIT_VAL +# define RGBLIGHT_LIMIT_VAL 150 // limitated for power consumption +# endif +# ifndef RGBLIGHT_VAL_STEP +# define RGBLIGHT_VAL_STEP 15 +# endif +# ifndef RGBLIGHT_HUE_STEP +# define RGBLIGHT_HUE_STEP 17 +# endif +# ifndef RGBLIGHT_SAT_STEP +# define RGBLIGHT_SAT_STEP 17 +# endif +#endif +#ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_SPLIT { 30, 30 } +#endif + +#ifndef OLED_FONT_H +# define OLED_FONT_H "keyboards/keyball/lib/glcdfont.c" +#endif + +#if !defined(LAYER_STATE_8BIT) && !defined(LAYER_STATE_16BIT) && !defined(LAYER_STATE_32BIT) +# define LAYER_STATE_8BIT +#endif + +// To squeeze firmware size +#undef LOCKING_SUPPORT_ENABLE +#undef LOCKING_RESYNC_ENABLE +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/qmk_firmware/keyboards/keyball/keyball44/keyball44.c b/qmk_firmware/keyboards/keyball/keyball44/keyball44.c new file mode 100644 index 000000000..2fc24dfb0 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keyball44.c @@ -0,0 +1,46 @@ +/* +Copyright 2022 @Yowkees +Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya) + +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 "lib/keyball/keyball.h" + +////////////////////////////////////////////////////////////////////////////// + +// clang-format off +matrix_row_t matrix_mask[MATRIX_ROWS] = { + 0b00111111, + 0b00111111, + 0b00111111, + 0b00111110, + 0b00111111, + 0b00111111, + 0b00111111, + 0b00111110, +}; +// clang-format on + +void keyball_on_adjust_layout(keyball_adjust_t v) { +#ifdef RGBLIGHT_ENABLE + // adjust RGBLIGHT's clipping and effect ranges + uint8_t lednum_this = keyball.this_have_ball ? 29 : 30; + uint8_t lednum_that = !keyball.that_enable ? 0 : keyball.that_have_ball ? 29 : 30; + rgblight_set_clipping_range(is_keyboard_left() ? 0 : lednum_that, lednum_this); + rgblight_set_effect_range(0, lednum_this + lednum_that); +#endif +} diff --git a/qmk_firmware/keyboards/keyball/keyball44/keyball44.h b/qmk_firmware/keyboards/keyball/keyball44/keyball44.h new file mode 100644 index 000000000..0a39a4fa3 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keyball44.h @@ -0,0 +1,97 @@ +/* +Copyright 2022 @Yowkees +Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya) + +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" +#include "lib/keyball/keyball.h" + +// clang-format off + +#define LAYOUT_right_ball( \ + L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \ + L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \ + L20, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, R20, \ + L31, L32, L33, L34, L35, R35, R34, R31 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { KC_NO, L31, L32, L33, L34, L35 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { KC_NO, R31, KC_NO, KC_NO, R34, R35 }, \ + } + +#define LAYOUT_left_ball( \ + L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \ + L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \ + L20, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, R20, \ + L31, L34, L35, R35, R34, R33, R32, R31 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { KC_NO, L31, KC_NO, KC_NO, L34, L35 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { KC_NO, R31, R32, R33, R34, R35 }, \ + } + +#define LAYOUT_dual_ball( \ + L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \ + L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \ + L20, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, R20, \ + L31, L34, L35, R35, R34, R31 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { KC_NO, L31, KC_NO, KC_NO, L34, L35 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { KC_NO, R31, KC_NO, KC_NO, R34, R35 }, \ + } + +#define LAYOUT_no_ball( \ + L00, L01, L02, L03, L04, L05, R05, R04, R03, R02, R01, R00, \ + L10, L11, L12, L13, L14, L15, R15, R14, R13, R12, R11, R10, \ + L20, L21, L22, L23, L24, L25, R25, R24, R23, R22, R21, R20, \ + L31, L32, L33, L34, L35, R35, R34, R33, R32, R31 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { KC_NO, L31, L32, L33, L34, L35 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { KC_NO, R31, R32, R33, R34, R35 }, \ + } + +// clang-format on + +#define LAYOUT LAYOUT_right_ball +#define LAYOUT_universal LAYOUT_no_ball diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/default/config.h b/qmk_firmware/keyboards/keyball/keyball44/keymaps/default/config.h new file mode 100644 index 000000000..e22f3c945 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/default/config.h @@ -0,0 +1,34 @@ +/* +This is the c configuration file for the keymap + +Copyright 2022 @Yowkees +Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya) + +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 + +#ifdef RGBLIGHT_ENABLE +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_RAINBOW_MOOD +# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +# define RGBLIGHT_EFFECT_SNAKE +# define RGBLIGHT_EFFECT_KNIGHT +# define RGBLIGHT_EFFECT_CHRISTMAS +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +# define RGBLIGHT_EFFECT_RGB_TEST +# define RGBLIGHT_EFFECT_ALTERNATING +# define RGBLIGHT_EFFECT_TWINKLE +#endif diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/default/keymap.c b/qmk_firmware/keyboards/keyball/keyball44/keymaps/default/keymap.c new file mode 100644 index 000000000..30de66387 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/default/keymap.c @@ -0,0 +1,70 @@ +/* +Copyright 2022 @Yowkees +Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya) + +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" + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // keymap for default + [0] = LAYOUT_universal( + KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_DEL , + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , S(KC_7) , + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_INT1 , + KC_LALT,KC_LGUI,LCTL_T(KC_LANG2) ,LT(1,KC_SPC),LT(3,KC_LANG2), KC_BSPC,LT(2,KC_ENT), RCTL_T(KC_LANG2), KC_RALT , KC_PSCR + ), + + [1] = LAYOUT_universal( + _______ , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , + _______ , _______ , _______ , KC_UP , KC_ENT , KC_DEL , KC_PGUP , KC_BTN1 , KC_UP , KC_BTN2 , KC_BTN3 , KC_F12 , + _______ , _______ , KC_LEFT , KC_DOWN , KC_RGHT , KC_BSPC , KC_PGDN , KC_LEFT , KC_DOWN , KC_RGHT , _______ , _______ , + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + + [2] = LAYOUT_universal( + _______ ,S(KC_QUOT), KC_7 , KC_8 , KC_9 , S(KC_8) , S(KC_9) , S(KC_1) , S(KC_6) , KC_LBRC , S(KC_4) , _______ , + _______ ,S(KC_SCLN), KC_4 , KC_5 , KC_6 , KC_RBRC , KC_NUHS , KC_MINS , S(KC_EQL), S(KC_3) , KC_QUOT , S(KC_2) , + _______ ,S(KC_MINS), KC_1 , KC_2 , KC_3 ,S(KC_RBRC), S(KC_NUHS),S(KC_INT1), KC_EQL ,S(KC_LBRC),S(KC_SLSH),S(KC_INT3), + KC_0 , KC_DOT , _______ , _______ , _______ , KC_DEL , _______ , _______ , _______ , _______ + ), + + [3] = LAYOUT_universal( + RGB_TOG , _______ , _______ , _______ , _______ , _______ , RGB_M_P , RGB_M_B , RGB_M_R , RGB_M_SW , RGB_M_SN , RGB_M_K , + RGB_MOD , RGB_HUI , RGB_SAI , RGB_VAI , _______ , SCRL_DVI , RGB_M_X , RGB_M_G , RGB_M_T , RGB_M_TW , _______ , _______ , + RGB_RMOD , RGB_HUD , RGB_SAD , RGB_VAD , _______ , SCRL_DVD , CPI_D1K , CPI_D100 , CPI_I100 , CPI_I1K , _______ , KBC_SAVE , + RESET , KBC_RST , _______ , _______ , _______ , _______ , _______ , _______ , KBC_RST , RESET + ), +}; +// clang-format on + +layer_state_t layer_state_set_user(layer_state_t state) { + // Auto enable scroll mode when the highest layer is 3 + keyball_set_scroll_mode(get_highest_layer(state) == 3); + return state; +} + +#ifdef OLED_ENABLE + +# include "lib/oledkit/oledkit.h" + +void oledkit_render_info_user(void) { + keyball_oled_render_keyinfo(); + keyball_oled_render_ballinfo(); +} +#endif diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/default/rules.mk b/qmk_firmware/keyboards/keyball/keyball44/keymaps/default/rules.mk new file mode 100644 index 000000000..5746ccd28 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes + +OLED_ENABLE = yes diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/develop/config.h b/qmk_firmware/keyboards/keyball/keyball44/keymaps/develop/config.h new file mode 100644 index 000000000..7c18d0969 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/develop/config.h @@ -0,0 +1,33 @@ +/* +This is the c configuration file for the keymap + +Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya) + +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 + +#ifdef RGBLIGHT_ENABLE +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_RAINBOW_MOOD +# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +# define RGBLIGHT_EFFECT_SNAKE +# define RGBLIGHT_EFFECT_KNIGHT +# define RGBLIGHT_EFFECT_CHRISTMAS +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +# define RGBLIGHT_EFFECT_RGB_TEST +# define RGBLIGHT_EFFECT_ALTERNATING +# define RGBLIGHT_EFFECT_TWINKLE +#endif diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/develop/keymap.c b/qmk_firmware/keyboards/keyball/keyball44/keymaps/develop/keymap.c new file mode 100644 index 000000000..3b1bdfc90 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/develop/keymap.c @@ -0,0 +1,50 @@ +/* +Copyright 2022 @Yowkees +Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya) + +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" + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // keymap for development + [0] = LAYOUT_universal( + KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_MINS , + KC_LCTL , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT , + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_ENT , + KC_LGUI , KC_LALT , SCRL_MO , KC_SPC , LT(1,KC_TAB), LT(1,KC_BSPC), KC_ENT , SCRL_MO , KC_RALT , KC_RGUI + ), + + [1] = LAYOUT_universal( + RGB_TOG , _______ , _______ , _______ , _______ , _______ , RGB_M_P , RGB_M_B , RGB_M_R , RGB_M_SW , RGB_M_SN , RGB_M_K , + RGB_MOD , RGB_HUI , RGB_SAI , RGB_VAI , _______ , SCRL_DVI , RGB_M_X , RGB_M_G , RGB_M_T , RGB_M_TW , _______ , _______ , + RGB_RMOD , RGB_HUD , RGB_SAD , RGB_VAD , _______ , SCRL_DVD , CPI_D1K , CPI_D100 , CPI_I100 , CPI_I1K , _______ , KBC_SAVE , + RESET , KBC_RST , _______ , _______ , _______ , _______ , _______ , _______ , KBC_RST , RESET + ), +}; +// clang-format on + +#ifdef OLED_ENABLE + +# include "lib/oledkit/oledkit.h" + +void oledkit_render_info_user(void) { + keyball_oled_render_keyinfo(); + keyball_oled_render_ballinfo(); +} +#endif diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/develop/rules.mk b/qmk_firmware/keyboards/keyball/keyball44/keymaps/develop/rules.mk new file mode 100644 index 000000000..98615de5f --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/develop/rules.mk @@ -0,0 +1,6 @@ +RGBLIGHT_ENABLE = yes + +OLED_ENABLE = yes + +# for debug +#CONSOLE_ENABLE = yes diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/test/config.h b/qmk_firmware/keyboards/keyball/keyball44/keymaps/test/config.h new file mode 100644 index 000000000..b8849eed0 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/test/config.h @@ -0,0 +1,25 @@ +/* +This is the c configuration file for the keymap + +Copyright 2022 @Yowkees +Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya) + +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 + +#ifdef RGBLIGHT_ENABLE +# define RGBLIGHT_EFFECT_RGB_TEST // required for LED test +#endif diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/test/keymap.c b/qmk_firmware/keyboards/keyball/keyball44/keymaps/test/keymap.c new file mode 100644 index 000000000..f39130532 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/test/keymap.c @@ -0,0 +1,50 @@ +/* +Copyright 2022 @Yowkees +Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya) + +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" + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_universal( + KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_MINS , + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT , + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT , + KC_LCTL , KC_LGUI , KC_LALT , KC_SPC , KC_DEL , KC_BSPC , KC_ENT , KC_RALT , KC_RGUI , KC_RCTL + ), +}; +// clang-format on + +void keyboard_post_init_user() { +#ifdef RGBLIGHT_ENABLE + // Force RGB lights to show test animation without writing EEPROM. + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST); +#endif +} + +#ifdef OLED_ENABLE + +# include "lib/oledkit/oledkit.h" + +void oledkit_render_info_user(void) { + keyball_oled_render_keyinfo(); + keyball_oled_render_ballinfo(); +} +#endif diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/test/rules.mk b/qmk_firmware/keyboards/keyball/keyball44/keymaps/test/rules.mk new file mode 100644 index 000000000..98615de5f --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/test/rules.mk @@ -0,0 +1,6 @@ +RGBLIGHT_ENABLE = yes + +OLED_ENABLE = yes + +# for debug +#CONSOLE_ENABLE = yes diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/via/config.h b/qmk_firmware/keyboards/keyball/keyball44/keymaps/via/config.h new file mode 100644 index 000000000..f01744531 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/via/config.h @@ -0,0 +1,34 @@ +/* +This is the c configuration file for the keymap + +Copyright 2022 @Yowkees +Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya) + +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 + +#ifdef RGBLIGHT_ENABLE +# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_RAINBOW_MOOD +# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +//# define RGBLIGHT_EFFECT_SNAKE +# define RGBLIGHT_EFFECT_KNIGHT +//# define RGBLIGHT_EFFECT_CHRISTMAS +# define RGBLIGHT_EFFECT_STATIC_GRADIENT +//# define RGBLIGHT_EFFECT_RGB_TEST +//# define RGBLIGHT_EFFECT_ALTERNATING +//# define RGBLIGHT_EFFECT_TWINKLE +#endif diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/via/keymap.c b/qmk_firmware/keyboards/keyball/keyball44/keymaps/via/keymap.c new file mode 100644 index 000000000..ff6add22f --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/via/keymap.c @@ -0,0 +1,70 @@ +/* +Copyright 2022 @Yowkees +Copyright 2022 MURAOKA Taro (aka KoRoN, @kaoriya) + +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" + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // keymap for default (VIA) + [0] = LAYOUT_universal( + KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_DEL , + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , S(KC_7) , + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_INT1 , + KC_LALT,KC_LGUI,LCTL_T(KC_LANG2) ,LT(1,KC_SPC),LT(3,KC_LANG1), KC_BSPC,LT(2,KC_ENT), RCTL_T(KC_LANG2), KC_RALT , KC_PSCR + ), + + [1] = LAYOUT_universal( + _______ , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , + _______ , _______ , _______ , KC_UP , KC_ENT , KC_DEL , KC_PGUP , KC_BTN1 , KC_UP , KC_BTN2 , KC_BTN3 , KC_F12 , + _______ , _______ , KC_LEFT , KC_DOWN , KC_RGHT , KC_BSPC , KC_PGDN , KC_LEFT , KC_DOWN , KC_RGHT , _______ , _______ , + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + + [2] = LAYOUT_universal( + _______ ,S(KC_QUOT), KC_7 , KC_8 , KC_9 , S(KC_8) , S(KC_9) , S(KC_1) , S(KC_6) , KC_LBRC , S(KC_4) , _______ , + _______ ,S(KC_SCLN), KC_4 , KC_5 , KC_6 , KC_RBRC , KC_NUHS , KC_MINS , S(KC_EQL), S(KC_3) , KC_QUOT , S(KC_2) , + _______ ,S(KC_MINS), KC_1 , KC_2 , KC_3 ,S(KC_RBRC), S(KC_NUHS),S(KC_INT1), KC_EQL ,S(KC_LBRC),S(KC_SLSH),S(KC_INT3), + KC_0 , KC_DOT , _______ , _______ , _______ , KC_DEL , _______ , _______ , _______ , _______ + ), + + [3] = LAYOUT_universal( + RGB_TOG , _______ , _______ , _______ , _______ , _______ , RGB_M_P , RGB_M_B , RGB_M_R , RGB_M_SW , RGB_M_SN , RGB_M_K , + RGB_MOD , RGB_HUI , RGB_SAI , RGB_VAI , _______ , SCRL_DVI , RGB_M_X , RGB_M_G , RGB_M_T , RGB_M_TW , _______ , _______ , + RGB_RMOD , RGB_HUD , RGB_SAD , RGB_VAD , _______ , SCRL_DVD , CPI_D1K , CPI_D100 , CPI_I100 , CPI_I1K , _______ , KBC_SAVE , + RESET , KBC_RST , _______ , _______ , _______ , _______ , _______ , _______ , KBC_RST , RESET + ), +}; +// clang-format on + +layer_state_t layer_state_set_user(layer_state_t state) { + // Auto enable scroll mode when the highest layer is 3 + keyball_set_scroll_mode(get_highest_layer(state) == 3); + return state; +} + +#ifdef OLED_ENABLE + +# include "lib/oledkit/oledkit.h" + +void oledkit_render_info_user(void) { + keyball_oled_render_keyinfo(); + keyball_oled_render_ballinfo(); +} +#endif diff --git a/qmk_firmware/keyboards/keyball/keyball44/keymaps/via/rules.mk b/qmk_firmware/keyboards/keyball/keyball44/keymaps/via/rules.mk new file mode 100644 index 000000000..d80df3fa4 --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/keymaps/via/rules.mk @@ -0,0 +1,5 @@ +RGBLIGHT_ENABLE = yes + +OLED_ENABLE = yes + +VIA_ENABLE = yes diff --git a/qmk_firmware/keyboards/keyball/keyball44/readme.md b/qmk_firmware/keyboards/keyball/keyball44/readme.md new file mode 100644 index 000000000..43166800b --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/readme.md @@ -0,0 +1,36 @@ +# Keyball44 + +![Keyball44] + +A split keyboard with 44 vertically staggered keys and 34mm track ball. + +* Keyboard Maintainer: [@Yowkees](https://twitter.com/Yowkees) +* Hardware Supported: Keyball44 PCB, ProMicro +* Hardware Availability: + * + +Make example for this keyboard (after setting up your build environment): + + make keyball/keyball44: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). + +## Special keycodes + +Value | Keycode |Description +---------|------------|------------------------------------------------------------------ +`0x5DA5` | `KBC_RST` |Reset Keyball configuration +`0x5DA6` | `KBC_SAVE` |Persist Keyball configuration to EEPROM +`0x5DA7` | `CPI_I100` |Increase 100 CPI (max 12000) +`0x5DA8` | `CPI_D100` |Decrease 100 CPI (min 100) +`0x5DA9` | `CPI_I1K` |Increase 1000 CPI (max 12000) +`0x5DAA` | `CPI_D1K` |Decrease 1000 CPI (min 100) +`0x5DAB` | `SCRL_TO` |Toggle scroll mode +`0x5DAC` | `SCRL_MO` |Enable scroll mode when pressing +`0x5DAD` | `SCRL_DVI` |Increase scroll divider (max 7 = 1/128) +`0x5DAE` | `SCRL_DVD` |Decrease scroll divider (min 0 = 1/1) + +***NOTE*** + +* The values are for VIA/Remap +* The values are for QMK/0.16.3. It will be different when you use another version of QMK. diff --git a/qmk_firmware/keyboards/keyball/keyball44/rules.mk b/qmk_firmware/keyboards/keyball/keyball44/rules.mk new file mode 100644 index 000000000..5cbd3805d --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/rules.mk @@ -0,0 +1,49 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Link Time Optimization required for size. +LTO_ENABLE = yes + +# Build Options +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +EXTRAKEY_ENABLE = no # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no # Audio output + +# Keyball39 is split keyboard. +SPLIT_KEYBOARD = yes + +# Optical sensor driver for trackball. +POINTING_DEVICE_ENABLE = yes +POINTING_DEVICE_DRIVER = custom +SRC += drivers/pmw3360/pmw3360.c +QUANTUM_LIB_SRC += spi_master.c # Optical sensor use SPI to communicate + +# This is unnecessary for processing KC_MS_BTN*. +MOUSEKEY_ENABLE = no + +# Enabled only one of RGBLIGHT and RGB_MATRIX if necessary. +RGBLIGHT_ENABLE = no # Enable RGBLIGHT +RGBLIGHT_DRIVER = WS2812 +RGB_MATRIX_ENABLE = no # Enable RGB_MATRIX (not work yet) +RGB_MATRIX_DRIVER = WS2812 + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# To support OLED +OLED_ENABLE = no # Please Enable this in each keymaps. +SRC += lib/oledkit/oledkit.c # OLED utility for Keyball series. + +# Include common library +SRC += lib/keyball/keyball.c + +# Disable other features to squeeze firmware size +SPACE_CADET_ENABLE = no +MAGIC_ENABLE = no diff --git a/qmk_firmware/keyboards/keyball/keyball44/via.json b/qmk_firmware/keyboards/keyball/keyball44/via.json new file mode 100644 index 000000000..e4e9915fd --- /dev/null +++ b/qmk_firmware/keyboards/keyball/keyball44/via.json @@ -0,0 +1,37 @@ +{ + "name": "Keyball44", + "vendorId": "0x5957", + "productId": "0x0400", + "matrix": { "rows": 8, "cols": 6 }, + "lighting": "qmk_rgblight", + "layouts" : { + "labels": [ + [ "Ball availability", "None", "Right", "Left", "Dual" ] + ], + "keymap": [ + [{"x":3}, "0,3", {"x": 8.5}, "4,3" ], + [{"y":-0.875,"x":4}, "0,4", {"x": 6.5}, "4,4" ], + [{"y":-0.875,"x":2}, "0,2",{"x":2}, "0,5", {"x": 4.5}, "4,5",{"x":2}, "4,2" ], + [{"y":-0.65,"c":"#aaaaaa"}, "0,0",{"c":"#cccccc"},"0,1", {"x":12.5}, "4,1",{"c":"#aaaaaa"},"4,0" ], + + [{"y":-0.6,"x":3,"c":"#cccccc"}, "1,3", {"x": 8.5}, "5,3" ], + [{"y":-0.875,"x":4}, "1,4", {"x": 6.5}, "5,4" ], + [{"y":-0.875,"x":2}, "1,2",{"x": 2.0}, "1,5", {"x": 4.5}, "5,5",{"x":2}, "5,2" ], + [{"y":-0.65,"c":"#aaaaaa"}, "1,0",{"c":"#cccccc"},"1,1", {"x":12.5}, "5,1",{"c":"#aaaaaa"},"5,0" ], + + [{"y":-0.6,"x":3,"c":"#cccccc"}, "2,3", {"x": 8.5}, "6,3" ], + [{"y":-0.875,"x":4}, "2,4", {"x": 6.5}, "6,4" ], + [{"y":-0.875,"x":2}, "2,2",{"x":2}, "2,5", {"x": 4.5}, "6,5",{"x":2}, "6,2" ], + [{"y":-0.65,"c":"#aaaaaa"}, "2,0",{"c":"#cccccc"},"2,1", {"x":12.5}, "6,1",{"c":"#aaaaaa"},"6,0" ], + + [{"y":-0.6, "x":3}, "3,2", {"x": 8.5}, "7,2" ], + [{"y":-0.75,"x":2}, "3,1", {"x":10.5}, "7,1" ], + [{"y":-0.75,"x":4.3}, "3,3", {"x": 5.9}, "7,3" ], + + [{"r": 10, "rx": 5.35, "ry":4.5, "y":-1.00 }, "3,4" ], + [{"r": 20, "rx": 6.40, "ry":4.7, "y":-0.99, "x":-0.03}, "3,5" ], + [{"r":-20, "rx":10.15, "y":-1.00, "x":-1.02}, "7,5" ], + [{"r":-10, "rx":11.15, "ry":4.5, "y":-0.98, "x":-1.00}, "7,4" ] + ] + } +} diff --git a/qmk_firmware/keyboards/keyball/lib/keyball/keyball.c b/qmk_firmware/keyboards/keyball/lib/keyball/keyball.c index 41789d293..5d38d66e5 100644 --- a/qmk_firmware/keyboards/keyball/lib/keyball/keyball.c +++ b/qmk_firmware/keyboards/keyball/lib/keyball/keyball.c @@ -137,7 +137,7 @@ void pointing_device_driver_set_cpi(uint16_t cpi) { } static void motion_to_mouse_move(keyball_motion_t *m, report_mouse_t *r, bool is_left) { -#if KEYBALL_MODEL == 61 || KEYBALL_MODEL == 39 || KEYBALL_MODEL == 147 +#if KEYBALL_MODEL == 61 || KEYBALL_MODEL == 39 || KEYBALL_MODEL == 147 || KEYBALL_MODEL == 44 r->x = clip2int8(m->y); r->y = clip2int8(m->x); if (is_left) { @@ -164,7 +164,7 @@ static void motion_to_mouse_scroll(keyball_motion_t *m, report_mouse_t *r, bool m->y -= y << div; // apply to mouse report. -#if KEYBALL_MODEL == 61 || KEYBALL_MODEL == 39 || KEYBALL_MODEL == 147 +#if KEYBALL_MODEL == 61 || KEYBALL_MODEL == 39 || KEYBALL_MODEL == 147 || KEYBALL_MODEL == 44 r->h = clip2int8(y); r->v = -clip2int8(x); if (is_left) { diff --git a/qmk_firmware/keyboards/keyball/lib/keyball/keyball.h b/qmk_firmware/keyboards/keyball/lib/keyball/keyball.h index c275b7d58..37970ea64 100644 --- a/qmk_firmware/keyboards/keyball/lib/keyball/keyball.h +++ b/qmk_firmware/keyboards/keyball/lib/keyball/keyball.h @@ -63,6 +63,8 @@ along with this program. If not, see . # define KEYBALL_MODEL 39 #elif (PRODUCT_ID & 0xff00) == 0x0300 # define KEYBALL_MODEL 147 +#elif (PRODUCT_ID & 0xff00) == 0x0400 +# define KEYBALL_MODEL 44 #endif ////////////////////////////////////////////////////////////////////////////// diff --git a/qmk_firmware/keyboards/keyball/readme.md b/qmk_firmware/keyboards/keyball/readme.md index 33b72174b..63c37f23a 100644 --- a/qmk_firmware/keyboards/keyball/readme.md +++ b/qmk_firmware/keyboards/keyball/readme.md @@ -8,6 +8,7 @@ This directory includes source code of Keyball keyboard seriers: |[Keyball61](./keyball61)|A split keyboard with 61 vertically staggered keys and 34mm track ball. |[Keyball39](./keyball39)|A split keyboard with 39 vertically staggered keys and 34mm track ball. |[ONE47](./one47)|A keyboard with 47 vertically keys and 34mm trackball. It will support BLE Micro Pro. +|[Keyball44](./keyball44)|A split keyboard with 44 vertically staggered keys and 34mm track ball. * Keyboard Designer: [@Yowkees](https://twitter.com/Yowkees) * Hardware Supported: ProMicro like footprint @@ -29,7 +30,7 @@ See each directories for each keyboards in a table above. $ git clone https://github.com/qmk/qmk_firmware.git --depth 1 --recurse-submodules --shallow-submodules -b 0.15.13 qmk ``` - Currently Keyball firmwares are verified to compile with QMK 0.15.13 + Currently Keyball firmwares are verified to compile with QMK 0.16.13 3. Create a symbolic link to this `keyball/` directory from [qmk/qmk_firmware]'s `keyboards/` directory.