Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vnmm keymaps to some keyboards #20446

Merged
merged 16 commits into from
May 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Copyright 2021 @ Grayson Carr
*
* 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 <http://www.gnu.org/licenses/>.
*/

#pragma once

/* RGB Matrix Configuration */
#ifdef RGB_MATRIX_ENABLE
# define RGB_DISABLE_WHEN_USB_SUSPENDED
# define CAPS_LOCK_INDICATOR_COLOR RGB_RED
// # define CAPS_LOCK_INDICATOR_OTHER RGB_WHITE
# define CAPS_LOCK_INDICATOR_LIGHT_ALPHAS
# define FN_LAYER_TRANSPARENT_KEYS_OFF
#endif
eatmyvenom marked this conversation as resolved.
Show resolved Hide resolved
47 changes: 47 additions & 0 deletions keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* Copyright 2022 Eugenio Pastoral
*
* 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 <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H
#include "keymap_user.h"
#ifdef RGB_MATRIX_ENABLE
# include "rgb_matrix_user.h"
#endif
eatmyvenom marked this conversation as resolved.
Show resolved Hide resolved

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap WIN_BASE: Base Layer (Default Layer)
*/
[WIN_BASE] = LAYOUT(
QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
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_UP, KC_END,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT),
eatmyvenom marked this conversation as resolved.
Show resolved Hide resolved

/* Keymap WIN_FN: Function Layer
*/
[WIN_FN] = LAYOUT(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, KC_VOLU, KC_MPLY,
EE_CLR, _______, _______, QK_BOOT, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT),
};

void matrix_init_user(void) {
#ifdef RGB_MATRIX_ENABLE
rgb_matrix_init_user();
#endif
}
eatmyvenom marked this conversation as resolved.
Show resolved Hide resolved
26 changes: 26 additions & 0 deletions keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/keymap_user.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Copyright 2021 @ Grayson Carr
*
* 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 <http://www.gnu.org/licenses/>.
*/

#pragma once

// clang-format off

enum layers {
WIN_BASE,
WIN_FN
};

// clang-format on
10 changes: 10 additions & 0 deletions keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Vnmm's ANSI GMMKV2 65% Layout

This keymap builds on archrovisual's but with some changes and uses the default key placements

## Features

- Alphabet keys light up red when caps lock is on
- Pressing FN shows keys that have a definition
- Via enabled
- Quick reset with fn+space
eatmyvenom marked this conversation as resolved.
Show resolved Hide resolved
94 changes: 94 additions & 0 deletions keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/rgb_matrix_user.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
*
* 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 <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H
#include "rgb_matrix_user.h"
#include "keymap_user.h"

keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT];
bool is_shift_pressed = false;

void rgb_matrix_init_user(void) {
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
for (uint8_t col = 0; col < MATRIX_COLS; col++) {
uint8_t led_index = g_led_config.matrix_co[row][col];
if (led_index != NO_LED) {
led_index_key_position[led_index] = (keypos_t){.row = row, .col = col};
}
}
}
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_LSFT:
case KC_RSFT:
is_shift_pressed = record->event.pressed;
eatmyvenom marked this conversation as resolved.
Show resolved Hide resolved
break;
}

return true;
}

bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
uint8_t current_layer = get_highest_layer(layer_state);
switch (current_layer) {
case WIN_BASE:
#ifdef CAPS_LOCK_INDICATOR_COLOR
if (host_keyboard_led_state().caps_lock || (is_shift_pressed != host_keyboard_led_state().caps_lock)) {
rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR);
#ifdef CAPS_LOCK_INDICATOR_OTHER
rgb_matrix_set_color_by_not_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_OTHER);
#endif
}
#endif
break;
case WIN_FN:
#ifdef FN_LAYER_TRANSPARENT_KEYS_OFF
rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF);
#endif
break;
}
return false;
}

void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) {
for (uint8_t i = led_min; i < led_max; i++) {
uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]);
if ((*is_keycode)(keycode)) {
rgb_matrix_set_color(i, red, green, blue);
}
}
}

void rgb_matrix_set_color_by_not_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) {
for (uint8_t i = led_min; i < led_max; i++) {
uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]);
if (!(*is_keycode)(keycode)) {
rgb_matrix_set_color(i, red, green, blue);
}
}
}

bool is_caps_lock_indicator(uint16_t keycode) {
#ifdef CAPS_LOCK_INDICATOR_LIGHT_ALPHAS
return (KC_A <= keycode && keycode <= KC_Z) || keycode == KC_CAPS || keycode == KC_LSFT || keycode == KC_RSFT;
#else
return keycode == KC_CAPS;
#endif
}

bool is_transparent(uint16_t keycode) { return keycode == KC_TRNS; }
25 changes: 25 additions & 0 deletions keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/rgb_matrix_user.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
*
* 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 <http://www.gnu.org/licenses/>.
*/

#pragma once

void rgb_matrix_init_user(void);

void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue);
void rgb_matrix_set_color_by_not_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue);

bool is_caps_lock_indicator(uint16_t keycode);
bool is_transparent(uint16_t keycode);
6 changes: 6 additions & 0 deletions keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
VIA_ENABLE = yes
MOUSEKEY_ENABLE = no

ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
SRC += rgb_matrix_user.c
endif
eatmyvenom marked this conversation as resolved.
Show resolved Hide resolved
89 changes: 89 additions & 0 deletions keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/

#pragma once

#ifdef RGB_MATRIX_ENABLE
#define RGB_MATRIX_TIMEOUT 1200000 // 20 minutes (20 * 60 * 1000ms)


// When caps lock is pressed, the letter keys, caps lock, and both shift keys, will light up this color.
# define CAPS_LOCK_INDICATOR_COLOR RGB_RED

// When caps lock is pressed, all other keys will light up this color. If undefined, they keys will adhere to the rgb profile
// # define CAPS_LOCK_INDICATOR_OTHER RGB_WHITE

// If defined, all alphabet keys will light up, otherwise just caps lock.
# define CAPS_LOCK_INDICATOR_LIGHT_ALPHAS

// If defined, keys not defined in the current layer will turn off their RGB
# define FN_LAYER_TRANSPARENT_KEYS_OFF

// Below added per: https://beta.docs.qmk.fm/using-qmk/hardware-features/lighting/feature_rgb_matrix#suspended-state-id-suspended-state
#define RGB_DISABLE_WHEN_USB_SUSPENDED

// Effects
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Heatmap, Rain
#define RGB_MATRIX_KEYPRESSES // REACTIVE, SPLASH modes

// Disable effects you don't like.
// Soon, you'll have to explicitly enable effects you want: https://github.com/qmk/qmk_firmware/pull/13758
// #define DISABLE_RGB_MATRIX_SOLID_COLOR, // Static single hue, no speed support
// #define DISABLE_RGB_MATRIX_ALPHAS_MODS, // Static dual hue, speed is hue for secondary hue
// #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN, // Static gradient top to bottom, speed controls how much gradient changes
// #define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT, // Static gradient left to right, speed controls how much gradient changes
// #define DISABLE_RGB_MATRIX_BREATHING, // Single hue brightness cycling animation
// #define DISABLE_RGB_MATRIX_BAND_SAT, // Single hue band fading saturation scrolling left to right
// #define DISABLE_RGB_MATRIX_BAND_VAL, // Single hue band fading brightness scrolling left to right
#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades saturation
// #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL, // Single hue 3 blade spinning pinwheel fades brightness
// #define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT, // Single hue spinning spiral fades saturation
#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL // Single hue spinning spiral fades brightness
// #define DISABLE_RGB_MATRIX_CYCLE_ALL, // Full keyboard solid hue cycling through full gradient
// #define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right
// #define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom
// #define DISABLE_RGB_MATRIX_CYCLE_OUT_IN, // Full gradient scrolling out to in
// #define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL, // Full dual gradients scrolling out to in
// #define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON, // Full gradent Chevron shapped scrolling left to right
// #define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL, // Full gradient spinning pinwheel around center of keyboard
// #define DISABLE_RGB_MATRIX_CYCLE_SPIRAL, // Full gradient spinning spiral around center of keyboard
// #define DISABLE_RGB_MATRIX_DUAL_BEACON, // Full gradient spinning around center of keyboard
// #define DISABLE_RGB_MATRIX_RAINBOW_BEACON, // Full tighter gradient spinning around center of keyboard
// #define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS, // Full dual gradients spinning two halfs of keyboard
#define DISABLE_RGB_MATRIX_RAINDROPS // Randomly changes a single key's hue
#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Randomly changes a single key's hue and saturation
#define DISABLE_RGB_MATRIX_HUE_BREATHING // Hue shifts up a slight ammount at the same time, then shifts back
#define DISABLE_RGB_MATRIX_HUE_PENDULUM // Hue shifts up a slight ammount in a wave to the right, then back to the left
#define DISABLE_RGB_MATRIX_HUE_WAVE // Hue shifts up a slight ammount and then back down in a wave to the right

// Framebuffer effects
#define DISABLE_RGB_MATRIX_TYPING_HEATMAP // How hot is your WPM!
#define DISABLE_RGB_MATRIX_DIGITAL_RAIN // That famous computer simulation

// Reactive effects
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE // Pulses keys hit to hue & value then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out
// #define DISABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out
// #define DISABLE_RGB_MATRIX_MULTISPLASH // Full gradient & value pulse away from multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out

#endif
57 changes: 57 additions & 0 deletions keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* Copyright 2021 Glorious, LLC <salman@pcgamingrace.com>

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 <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H
#include "keymap_user.h"
#ifdef RGB_MATRIX_ENABLE
# include "rgb_matrix_user.h"
#endif

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[WIN_BASE] = LAYOUT(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_MUTE,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
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_UP, KC_END,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),

[WIN_FN] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD,RGB_VAD, RGB_SPD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______,
EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, _______, KC_MNXT
),
};

void matrix_init_user(void) {
#ifdef RGB_MATRIX_ENABLE
rgb_matrix_init_user();
#endif
}

bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
//return true; //set to return false to counteract enabled encoder in pro.c
return false;
}
eatmyvenom marked this conversation as resolved.
Show resolved Hide resolved
Loading