From 2e19d0d7d14fef69d583886c244d3c67b3c0cc3d Mon Sep 17 00:00:00 2001 From: Christoph Rehmann <1273098+crehmann@users.noreply.github.com> Date: Mon, 10 Jan 2022 11:33:48 +0100 Subject: [Keyboard] Add Buzzard support (#15493) * add buzzerd (untested, WIP) * configured linear actuator and fixed keymap * configuration tweaks and added custom keymap * add custom tapping term for home row mod * added readme * remove ionide folder * added scroll function to trackpoint * keymap reworked * using one shot shift and removed dynamic macros * reworked default keymap * adapted to latest qmk changes * remove caps word from default keymap * use provided coding guidelines * use get_highest_layer in favour of biton32 * fixed formatting * remove unnecessary define statement --- keyboards/buzzard/keymaps/crehmann/config.h | 38 +++ .../keymaps/crehmann/features/haptic_utils.c | 42 ++++ .../keymaps/crehmann/features/haptic_utils.h | 10 + keyboards/buzzard/keymaps/crehmann/keymap.c | 256 +++++++++++++++++++++ keyboards/buzzard/keymaps/crehmann/rules.mk | 9 + 5 files changed, 355 insertions(+) create mode 100644 keyboards/buzzard/keymaps/crehmann/config.h create mode 100644 keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c create mode 100644 keyboards/buzzard/keymaps/crehmann/features/haptic_utils.h create mode 100644 keyboards/buzzard/keymaps/crehmann/keymap.c create mode 100644 keyboards/buzzard/keymaps/crehmann/rules.mk (limited to 'keyboards/buzzard/keymaps/crehmann') diff --git a/keyboards/buzzard/keymaps/crehmann/config.h b/keyboards/buzzard/keymaps/crehmann/config.h new file mode 100644 index 0000000000..d5d9a9bb83 --- /dev/null +++ b/keyboards/buzzard/keymaps/crehmann/config.h @@ -0,0 +1,38 @@ +// Copyright 2021 Christoph Rehmann (crehmann) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Configure the global tapping term (default: 200ms) +#define TAPPING_TERM 200 + +// Prevent normal rollover on alphas from accidentally triggering mods. +#define IGNORE_MOD_TAP_INTERRUPT + +// Enable rapid switch from tap to hold, disables double tap hold auto-repeat. +#define TAPPING_FORCE_HOLD + +// Apply the modifier on keys that are tapped during a short hold of a modtap +#define PERMISSIVE_HOLD + +// Using the right side as master +#define MASTER_RIGHT + +#ifdef HAPTIC_ENABLE +// this configuration has no effect because the haptic exclusion is implemented with +// __attribute__((weak)) bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t *record) +// in the default keymap and reacts only to mouse clicks. +//#define NO_HAPTIC_MOD +#define NO_HAPTIC_FN +#define NO_HAPTIC_ALPHA +#define NO_HAPTIC_PUNCTUATION +#define NO_HAPTIC_NAV +#define NO_HAPTIC_NUMERIC +#define DRV_GREETING alert_750ms +#define DRV_MODE_DEFAULT sharp_tick1 +#endif + +#ifdef PS2_MOUSE_ENABLE +#define PS2_MOUSE_SCROLL_BTN_MASK (1< | / ? | Mute | +// * | CTL | | RALT | | | | | | | | RALT | | Mic | +// * `----------------------------------+------+-------------. ,-------------+------+----------------------------------' +// * | ESC | Space| TAB | | Bksp| Enter| Del | +// * | CTL | NAVR | NUMR | | FUNL| SYML | | +// * `--------------------' `--------------------' +// */ + [_BASE] = LAYOUT( + KC_Q , KC_W , KC_E , KC_R , KC_T , CH_Z , KC_U , KC_I , KC_O , KC_P , + UC_OSFT, GUI_A , ALT_S , CTL_D , SFT_F , KC_G , KC_H , SFT_J , CTL_K , ALT_L , GUI_SCL, KC_BSPC, + CTL_ESC, CH_Y , RALT_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, RALT_DT, KC_SLSH, UC_MUTE, + UC_TL1 , UC_TL2 , UC_TL3 , UC_TR3 , UC_TR2 , UC_TR1 + ), + +// /* +// * Symbol Layer +// * +// * ,----------------------------------. ,----------------------------------. +// * | ` | @ | { | } | $ | | ¨ | ü | / | \ | ^ | +// * | | | | | | | | | | | | +// * ,------+------+------+------+------+------| |------+------+------+------+------+------. +// * | | ä | & | ( | ) | | | | ' | " | ? | ! | + | | +// * | | | | | | | | | | | | | | +// * |------+------+------+------+------+------| |------+------+------+------+------+------| +// * | | % | # | [ | ] | ~ | | € | = | * | < | > | | +// * | | | | | | | | | | | | | | +// * `----------------------------------+------+-------------. ,-------------+------+----------------------------------' +// * | | | TAB | | | | | +// * | | | | | | | | +// * `--------------------' `--------------------' +// */ + [_SYMB] = LAYOUT( + CH_GRV , CH_AT , CH_LCBR, CH_RCBR, CH_DLR , CH_DIAE, CH_UDIA, CH_SLSH, CH_BSLS, KC_CIRC, + _______, CH_ADIA, CH_AMPR, CH_LPRN, CH_RPRN, CH_PIPE, CH_QUOT, CH_DQUO, CH_QUES, CH_EXLM, CH_PLUS, _______, + _______, CH_PERC, CH_HASH, CH_LBRC, CH_RBRC, CH_TILD, CH_EURO, CH_EQL , CH_ASTR, CH_LABK, CH_RABK, _______, + _______, _______, KC_TAB, _______, _______ , _______ + ), + +// /* +// * Navigation Layer (Right) +// * +// * ,----------------------------------. ,----------------------------------. +// * | | | | | | |Insert| Cut | PgUp | PgDn | | +// * | | | | | | | | | | | | +// * ,------+------+------+------+------+------| |------+------+------+------+------+------. +// * | | | | | | | | Copy | ← | ↑ | ↓ | → | | +// * | | | | | | | | | | | | | | +// * |------+------+------+------+------+------| |------+------+------+------+------+------| +// * | | | | | | | | Paste| Home | WH_U | WH_D | End | | +// * | | | | | | | | | | | | | | +// * `----------------------------------+------+-------------. ,-------------+------+----------------------------------' +// * | | | | | Bksp | | Del | +// * | | | | | | | | +// * `--------------------' `--------------------' +// */ + [_NAVR] = LAYOUT( + _______, _______, _______, _______, _______, KC_INS , UC_CUT , KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, UC_COPY, KC_LEFT, KC_UP , KC_DOWN, KC_RGHT, _______, + _______, _______, _______, _______, _______, _______, UC_PSTE, KC_HOME, KC_WH_U, KC_WH_D, KC_END , _______, + _______, _______, _______, KC_BSPC, _______, _______ + ), +// -------------------------------------------------------------------------------------------------------------------------------------------------------- + +// /* +// * Number Layer (Right) +// * +// * ,----------------------------------. ,----------------------------------. +// * | | | | | | | / | 7 | 8 | 9 | - | +// * | | | | | | | | | | | | +// * ,------+------+------+------+------+------| |------+------+------+------+------+------. +// * | | | | | | | | * | 4 | 5 | 6 | + | | +// * | | | | | | | | | | | | | | +// * |------+------+------+------+------+------| |------+------+------+------+------+------| +// * | | | | | | | | 0 | 1 | 2 | 3 | . | | +// * | | | | | | | | | | | | | | +// * `----------------------------------+------+-------------. ,-------------+------+----------------------------------' +// * | | | | | Bksp | Enter| | +// * | | | | | | | | +// * `--------------------' `--------------------' +// */ + [_NUMR] = LAYOUT( + _______, _______, _______, _______, _______, KC_SLSH, KC_7 , KC_8 , KC_9 , KC_MINS, + _______, _______, _______, _______, _______, _______, KC_ASTR, KC_4 , KC_5 , KC_6 , KC_PLUS, _______, + _______, _______, _______, _______, _______, _______, KC_0 , KC_1 , KC_2 , KC_3 , KC_DOT , _______, + _______, _______, _______, KC_BSPC, KC_ENT , _______ + ), + +// /* +// * Function Layer (Left) +// * +// * ,----------------------------------. ,----------------------------------. +// * | F12 | F7 | F8 | F9 | Pause| | | | | | | +// * | | | | | | | | | | | | +// * ,------+------+------+------+------+------| |------+------+------+------+------+------. +// * | | F11 | F4 | F5 | F6 | PrScr| | | | | | | | +// * | | | | | | | | | | | | | | +// * |------+------+------+------+------+------| |------+------+------+------+------+------| +// * | | F10 | F1 | F2 | F3 | CapsL| | | | | | | | +// * | | | | | | | | | | | | | | +// * `----------------------------------+------+-------------. ,-------------+------+----------------------------------' +// * | | Space| TAB | | | | | +// * | | | | | | | | +// * `--------------------' `--------------------' +// */ + [_FUNL] = LAYOUT( + KC_F12 , KC_F7 , KC_F8 , KC_F9 , KC_PAUS, _______, _______, _______, _______, _______, + _______, KC_F11 , KC_F4 , KC_F5 , KC_F6 , KC_PSCR, _______, _______, _______, _______, _______, _______, + _______, KC_F10 , KC_F1 , KC_F2 , KC_F3 , KC_CAPS, _______, _______, _______, _______, _______, _______, + _______, KC_SPC , KC_TAB , _______, _______, _______ + ), + +// /* +// * Mouse & Adjustment Layer +// * +// * ,----------------------------------. ,----------------------------------. +// * | | | | | | | | | | | | +// * | | | | | | | | | | | | +// * ,------+------+------+------+------+------| |------+------+------+------+------+------. +// * | | | BTN3 | BTN2 | BTN1 | | | | | | | | | +// * | | | | | | | | | | | | | | +// * |------+------+------+------+------+------| |------+------+------+------+------+------| +// * | | | Cut | Copy | Paste| | | Play |M Prev| VolDn| VolUp|M Next| | +// * | | | | | | | | | | | | | | +// * `----------------------------------+------+-------------. ,-------------+------+----------------------------------' +// * | | | | | | | | +// * | | | | | | | | +// * `--------------------' `--------------------' +// */ + [_MOAJ] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, _______, _______, _______, _______, _______, _______, + _______, _______, UC_CUT , UC_COPY, UC_PSTE, _______, KC_MPLY, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, _______, + _______, _______, _______, _______, _______, _______ + ), + +// -------------------------------------------------------- TEMPLATE ------------------------------------------------------------------------------------- +// /* +// * Layer +// * +// * ,----------------------------------. ,----------------------------------. +// * | | | | | | | | | | | | +// * | | | | | | | | | | | | +// * ,------+------+------+------+------+------| |------+------+------+------+------+------. +// * | | | | | | | | | | | | | | +// * | | | | | | | | | | | | | | +// * |------+------+------+------+------+------| |------+------+------+------+------+------| +// * | | | | | | | | | | | | | | +// * | | | | | | | | | | | | | | +// * `----------------------------------+------+-------------. ,-------------+------+----------------------------------' +// * | | | | | | | | +// * | | | | | | | | +// * `--------------------' `--------------------' +// */ +// [_LAYERINDEX] = LAYOUT( +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______ +// ), +// -------------------------------------------------------------------------------------------------------------------------------------------------------- +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + process_layer_pulse(state); + return update_tri_layer_state(state, _NAVR, _SYMB, _MOAJ); +} + +uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case GUI_A: + return TAPPING_TERM + 150; + case ALT_S: + return TAPPING_TERM + 50; + case ALT_L: + return TAPPING_TERM + 50; + case GUI_SCL: + return TAPPING_TERM + 150; + default: + return TAPPING_TERM; + } +} diff --git a/keyboards/buzzard/keymaps/crehmann/rules.mk b/keyboards/buzzard/keymaps/crehmann/rules.mk new file mode 100644 index 0000000000..484e7d84a6 --- /dev/null +++ b/keyboards/buzzard/keymaps/crehmann/rules.mk @@ -0,0 +1,9 @@ +SRC += features/haptic_utils.c + +OLED_ENABLE = yes + +HAPTIC_ENABLE = yes +HAPTIC_DRIVER = DRV2605L + +PS2_MOUSE_ENABLE = yes +MOUSEKEY_ENABLE = yes -- cgit v1.2.3