From 892afe5e366622ca21f1267d36931dbc3b26d5e8 Mon Sep 17 00:00:00 2001 From: Thomas Haukland Date: Fri, 31 Mar 2023 23:00:54 +0200 Subject: [PATCH] Fix encoding actions and add Lars keymap --- keyboards/cheapino/encoder.c | 8 +- keyboards/cheapino/keymaps/lars/config.h | 51 ++++++++ keyboards/cheapino/keymaps/lars/keymap.json | 125 ++++++++++++++++++++ 3 files changed, 180 insertions(+), 4 deletions(-) create mode 100644 keyboards/cheapino/keymaps/lars/config.h create mode 100644 keyboards/cheapino/keymaps/lars/keymap.json diff --git a/keyboards/cheapino/encoder.c b/keyboards/cheapino/encoder.c index 8fa3981a92c6..bcaa86010ef3 100644 --- a/keyboards/cheapino/encoder.c +++ b/keyboards/cheapino/encoder.c @@ -7,18 +7,18 @@ static bool colABpressed = false; static bool encoderPressed = false; void clicked(void) { - tap_code(KC_MUTE); + tap_code(KC_MPLY); } void turned(bool clockwise) { if (IS_LAYER_ON(6)) { - tap_code(LGUI(clockwise ? KC_DOWN : KC_UP)); + tap_code(clockwise ? KC_VOLU : KC_VOLD); } else if (IS_LAYER_ON(3)) { - tap_code(clockwise ? KC_TAB : LSFT(KC_TAB)); + tap_code16(clockwise ? LCTL(KC_TAB) : LCTL(LSFT(KC_TAB))); } else if (IS_LAYER_ON(5)) { tap_code(clockwise ? KC_MS_WH_DOWN : KC_MS_WH_UP); } else { - tap_code(clockwise ? KC_VOLU : KC_VOLD); + tap_code16(clockwise ? LGUI(KC_Y) : LGUI(KC_Z)); } } diff --git a/keyboards/cheapino/keymaps/lars/config.h b/keyboards/cheapino/keymaps/lars/config.h new file mode 100644 index 000000000000..f735e9a60e20 --- /dev/null +++ b/keyboards/cheapino/keymaps/lars/config.h @@ -0,0 +1,51 @@ +/* +Copyright 2020 Pierre Chevalier + +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 +// Set the mouse settings to a comfortable speed/accuracy trade-off, +// assuming a screen refresh rate of 60 Htz or higher +// The default is 50. This makes the mouse ~3 times faster and more accurate +#define MOUSEKEY_INTERVAL 16 +// The default is 20. Since we made the mouse about 3 times faster with the previous setting, +// give it more time to accelerate to max speed to retain precise control over short distances. +#define MOUSEKEY_TIME_TO_MAX 40 +// The default is 300. Let's try and make this as low as possible while keeping the cursor responsive +#define MOUSEKEY_DELAY 100 +// It makes sense to use the same delay for the mouseweel +#define MOUSEKEY_WHEEL_DELAY 100 +// The default is 100 +#define MOUSEKEY_WHEEL_INTERVAL 50 +// The default is 40 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 100 + +// Pick good defaults for enabling homerow modifiers +#undef TAPPING_TERM +#define TAPPING_TERM 200 +// #define PERMISSIVE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT +#define TAPPING_FORCE_HOLD +//#define RETRO_TAPPING + +// Underglow configuration +#ifdef RGBLIGHT_ENABLE + #define RGBLIGHT_ANIMATIONS + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 +#endif + +//#define UNICODE_SELECTED_MODES UC_MAC diff --git a/keyboards/cheapino/keymaps/lars/keymap.json b/keyboards/cheapino/keymaps/lars/keymap.json new file mode 100644 index 000000000000..98fd8002dadc --- /dev/null +++ b/keyboards/cheapino/keymaps/lars/keymap.json @@ -0,0 +1,125 @@ +{ + "version": 1, + "notes": "My awesome keymap", + "documentation": "\"This file is a QMK Configurator export. You can import this at . It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: \n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n", + "keyboard": "bastardkb/skeletyl", + "keymap": "default", + "layout": "LAYOUT_split_3x5_3", + "layers": [ + [ + "KC_Q", + "KC_W", + "KC_F", + "KC_P", + "KC_B", + "KC_J", + "KC_L", + "KC_U", + "KC_Y", + "KC_SCLN", + "KC_A", + "KC_R", + "KC_S", + "KC_T", + "KC_G", + "KC_M", + "KC_N", + "KC_E", + "KC_I", + "KC_O", + "LSFT_T(KC_Z)", + "LCTL_T(KC_X)", + "RALT_T(KC_C)", + "KC_D", + "KC_V", + "KC_K", + "KC_H", + "RALT_T(KC_COMM)", + "LCTL_T(KC_DOT)", + "LSFT_T(KC_SLSH)", + "TO(1)", + "KC_BSPC", + "KC_TAB", + "KC_DEL", + "KC_SPC", + "KC_ENT" + ], + [ + "KC_TRNS", + "KC_7", + "KC_8", + "KC_9", + "KC_TRNS", + "KC_QUOT", + "KC_MINS", + "KC_EQL", + "KC_ASTR", + "KC_CIRC", + "KC_TRNS", + "KC_4", + "KC_5", + "KC_6", + "KC_0", + "KC_TAB", + "KC_LPRN", + "KC_RPRN", + "KC_LBRC", + "KC_RBRC", + "KC_LSFT", + "KC_1", + "KC_2", + "KC_3", + "KC_TRNS", + "KC_PIPE", + "KC_GRV", + "KC_LALT", + "KC_LCTL", + "KC_RSFT", + "TO(2)", + "KC_BSPC", + "KC_TAB", + "KC_DEL", + "TO(0)", + "KC_ENT" + ], + [ + "KC_TRNS", + "KC_TRNS", + "KC_PGUP", + "KC_TRNS", + "KC_TRNS", + "ANY(UC(0xE6))", + "ANY(UC(0xF8))", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_LEFT", + "KC_UP", + "KC_DOWN", + "KC_RGHT", + "KC_TRNS", + "KC_TRNS", + "KC_LGUI", + "ANY(UC(0xE5))", + "LCTL(KC_LALT)", + "LCA(KC_LSFT)", + "KC_TRNS", + "KC_HOME", + "KC_PGDN", + "KC_END", + "KC_TRNS", + "KC_TRNS", + "KC_RBRC", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TRNS", + "KC_TAB", + "KC_DEL", + "TO(0)", + "KC_TRNS" + ] + ], + "author": "thomas.haukland@gmail.com" +}