~ruther/qmk_firmware

c4a67d3f3302f3096bb6b15921c9587643164ba9 — jack 2 years ago 74fbd5a
Remove encoder in-matrix workaround code (#20389)

241 files changed, 1105 insertions(+), 5234 deletions(-)

M keyboards/atlantis/ak81_ve/config.h
M keyboards/atlantis/ak81_ve/keymaps/via/keymap.c
M keyboards/atlantis/ak81_ve/keymaps/via/rules.mk
D keyboards/atlantis/encoder_actions.c
D keyboards/atlantis/encoder_actions.h
M keyboards/custommk/evo70/info.json
M keyboards/custommk/evo70/keymaps/default/keymap.c
M keyboards/custommk/evo70/keymaps/via/keymap.c
M keyboards/custommk/evo70/keymaps/via/rules.mk
M keyboards/custommk/genesis/rev2/info.json
M keyboards/custommk/genesis/rev2/keymaps/via/keymap.c
M keyboards/custommk/genesis/rev2/keymaps/via/rules.mk
M keyboards/dailycraft/owl8/info.json
M keyboards/dailycraft/owl8/keymaps/default/keymap.c
M keyboards/dailycraft/owl8/keymaps/via/keymap.c
M keyboards/dailycraft/owl8/keymaps/via/rules.mk
M keyboards/dailycraft/stickey4/info.json
M keyboards/dailycraft/stickey4/keymaps/default/keymap.c
M keyboards/dailycraft/stickey4/keymaps/via/keymap.c
M keyboards/dailycraft/stickey4/keymaps/via/rules.mk
M keyboards/dailycraft/wings42/rev2/info.json
M keyboards/dailycraft/wings42/rev2/keymaps/default/keymap.c
M keyboards/dailycraft/wings42/rev2/keymaps/via/keymap.c
M keyboards/dailycraft/wings42/rev2/keymaps/via/rules.mk
M keyboards/gl516/n51gl/info.json
D keyboards/gl516/n51gl/keymaps/salicylic/config.h
D keyboards/gl516/n51gl/keymaps/salicylic/keymap.c
M keyboards/gl516/n51gl/keymaps/via/keymap.c
M keyboards/gl516/n51gl/keymaps/via/rules.mk
M keyboards/jones/v1/info.json
M keyboards/jones/v1/keymaps/default/keymap.c
D keyboards/jones/v1/keymaps/via/config.h
M keyboards/jones/v1/keymaps/via/keymap.c
M keyboards/jones/v1/keymaps/via/rules.mk
M keyboards/kabedon/kabedon98e/config.h
M keyboards/kabedon/kabedon98e/info.json
D keyboards/kabedon/kabedon98e/kabedon98e.c
M keyboards/kabedon/kabedon98e/keymaps/default/keymap.c
A keyboards/kabedon/kabedon98e/keymaps/default/rules.mk
M keyboards/kabedon/kabedon98e/keymaps/via/keymap.c
M keyboards/kabedon/kabedon98e/keymaps/via/rules.mk
M keyboards/keebio/bamfk1/config.h
M keyboards/keebio/bamfk1/info.json
M keyboards/keebio/bamfk1/keymaps/default/keymap.c
A keyboards/keebio/bamfk1/keymaps/default/rules.mk
M keyboards/keebio/bamfk1/keymaps/via/keymap.c
M keyboards/keebio/bamfk1/keymaps/via/rules.mk
M keyboards/keebio/bamfk1/rules.mk
D keyboards/keebio/encoder_actions.c
D keyboards/keebio/encoder_actions.h
M keyboards/meletrix/zoom65/info.json
M keyboards/meletrix/zoom65/keymaps/default/keymap.c
M keyboards/meletrix/zoom65/keymaps/via/keymap.c
M keyboards/meletrix/zoom65/keymaps/via/rules.mk
D keyboards/meletrix/zoom65/zoom65.c
D keyboards/meletrix/zoom65_lite/config.h
M keyboards/meletrix/zoom65_lite/info.json
M keyboards/meletrix/zoom65_lite/keymaps/default/keymap.c
M keyboards/meletrix/zoom65_lite/keymaps/via/keymap.c
M keyboards/meletrix/zoom65_lite/keymaps/via/rules.mk
M keyboards/ml/gas75/info.json
M keyboards/ml/gas75/keymaps/default/keymap.c
M keyboards/ml/gas75/keymaps/via/keymap.c
M keyboards/ml/gas75/keymaps/via/rules.mk
M keyboards/monarch/info.json
M keyboards/monarch/keymaps/default/keymap.c
M keyboards/monarch/keymaps/iso/keymap.c
M keyboards/monarch/keymaps/via/keymap.c
M keyboards/monarch/keymaps/via/rules.mk
M keyboards/mwstudio/alicekk/keymaps/via/keymap.c
M keyboards/mwstudio/alicekk/keymaps/via/rules.mk
M keyboards/mwstudio/mw65_rgb/info.json
M keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c
M keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap.c
M keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap_stuff.h
M keyboards/mwstudio/mw65_rgb/keymaps/thearesia/keymap.c
M keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c
M keyboards/mwstudio/mw65_rgb/keymaps/via/rules.mk
M keyboards/mwstudio/mw75r2/keymaps/via/keymap.c
M keyboards/mwstudio/mw75r2/keymaps/via/rules.mk
D keyboards/nightly_boards/adellein/adellein.c
D keyboards/nightly_boards/adellein/adellein.h
M keyboards/nightly_boards/adellein/config.h
D keyboards/nightly_boards/adellein/encoder_action.c
D keyboards/nightly_boards/adellein/encoder_action.h
M keyboards/nightly_boards/adellein/info.json
M keyboards/nightly_boards/adellein/keymaps/via/keymap.c
M keyboards/nightly_boards/adellein/keymaps/via/rules.mk
M keyboards/nightly_boards/adellein/rules.mk
M keyboards/nightly_boards/n40_o/config.h
D keyboards/nightly_boards/n40_o/encoder_action.c
D keyboards/nightly_boards/n40_o/encoder_action.h
M keyboards/nightly_boards/n40_o/info.json
M keyboards/nightly_boards/n40_o/keymaps/via/keymap.c
M keyboards/nightly_boards/n40_o/keymaps/via/rules.mk
D keyboards/nightly_boards/n40_o/n40_o.c
M keyboards/nightly_boards/n40_o/rules.mk
M keyboards/nightly_boards/n60_s/config.h
D keyboards/nightly_boards/n60_s/encoder_action.c
D keyboards/nightly_boards/n60_s/encoder_action.h
M keyboards/nightly_boards/n60_s/info.json
D keyboards/nightly_boards/n60_s/keymaps/ansi_encoder/keymap.c
D keyboards/nightly_boards/n60_s/keymaps/tsangan_encoder/keymap.c
M keyboards/nightly_boards/n60_s/keymaps/via/keymap.c
M keyboards/nightly_boards/n60_s/keymaps/via/rules.mk
D keyboards/nightly_boards/n60_s/n60_s.c
D keyboards/nightly_boards/n60_s/n60_s.h
M keyboards/nightly_boards/n60_s/rules.mk
M keyboards/nightly_boards/octopad/config.h
D keyboards/nightly_boards/octopad/encoder_action.c
D keyboards/nightly_boards/octopad/encoder_action.h
M keyboards/nightly_boards/octopad/info.json
M keyboards/nightly_boards/octopad/keymaps/default/keymap.c
A keyboards/nightly_boards/octopad/keymaps/default/rules.mk
M keyboards/nightly_boards/octopad/keymaps/via/keymap.c
M keyboards/nightly_boards/octopad/keymaps/via/rules.mk
D keyboards/nightly_boards/octopad/octopad.c
D keyboards/nightly_boards/octopad/octopad.h
M keyboards/nightly_boards/octopad/rules.mk
M keyboards/nullbitsco/tidbit/info.json
M keyboards/nullbitsco/tidbit/keymaps/default/keymap.c
A keyboards/nullbitsco/tidbit/keymaps/default/rules.mk
M keyboards/nullbitsco/tidbit/keymaps/oled/keymap.c
M keyboards/nullbitsco/tidbit/keymaps/oled/rules.mk
M keyboards/nullbitsco/tidbit/keymaps/snailmap_lite/keymap.c
M keyboards/nullbitsco/tidbit/keymaps/snailmap_lite/rules.mk
M keyboards/nullbitsco/tidbit/keymaps/via/keymap.c
M keyboards/nullbitsco/tidbit/keymaps/via/rules.mk
M keyboards/nullbitsco/tidbit/tidbit.c
M keyboards/owlab/voice65/hotswap/hotswap.c
D keyboards/owlab/voice65/hotswap/hotswap.h
M keyboards/owlab/voice65/hotswap/keymaps/default/keymap.c
A keyboards/owlab/voice65/hotswap/keymaps/default/rules.mk
M keyboards/owlab/voice65/hotswap/keymaps/via/keymap.c
M keyboards/owlab/voice65/hotswap/keymaps/via/rules.mk
M keyboards/owlab/voice65/soldered/keymaps/default/keymap.c
A keyboards/owlab/voice65/soldered/keymaps/default/rules.mk
M keyboards/owlab/voice65/soldered/keymaps/via/keymap.c
M keyboards/owlab/voice65/soldered/keymaps/via/rules.mk
M keyboards/owlab/voice65/soldered/soldered.c
D keyboards/owlab/voice65/soldered/soldered.h
M keyboards/rate/pistachio_mp/keymaps/default/keymap.c
M keyboards/rate/pistachio_mp/keymaps/via/keymap.c
M keyboards/rate/pistachio_mp/keymaps/via/rules.mk
M keyboards/rate/pistachio_pro/keymaps/default/keymap.c
M keyboards/rate/pistachio_pro/keymaps/via/keymap.c
M keyboards/rate/pistachio_pro/keymaps/via/rules.mk
M keyboards/rgbkb/mun/keymaps/default/keymap.c
A keyboards/rgbkb/mun/keymaps/default/rules.mk
M keyboards/rgbkb/mun/keymaps/peott-fr/keymap.c
A keyboards/rgbkb/mun/keymaps/peott-fr/rules.mk
M keyboards/rgbkb/mun/keymaps/via/keymap.c
M keyboards/rgbkb/mun/keymaps/via/rules.mk
M keyboards/rgbkb/mun/keymaps/xulkal2/keymap.c
M keyboards/rgbkb/mun/keymaps/xulkal2/rules.mk
M keyboards/rgbkb/mun/rev1/info.json
M keyboards/rgbkb/mun/rev1/rev1.c
M keyboards/rgbkb/sol3/keymaps/default/keymap.c
A keyboards/rgbkb/sol3/keymaps/default/rules.mk
M keyboards/rgbkb/sol3/keymaps/kageurufu/keymap.c
M keyboards/rgbkb/sol3/keymaps/kageurufu/rules.mk
M keyboards/rgbkb/sol3/keymaps/via/keymap.c
M keyboards/rgbkb/sol3/keymaps/via/rules.mk
M keyboards/rgbkb/sol3/rev1/info.json
M keyboards/rgbkb/sol3/rev1/rev1.c
M keyboards/rmi_kb/chevron/info.json
M keyboards/rmi_kb/chevron/keymaps/via/keymap.c
M keyboards/rmi_kb/chevron/keymaps/via/rules.mk
M keyboards/rmi_kb/herringbone/pro/info.json
M keyboards/rmi_kb/herringbone/pro/keymaps/via/keymap.c
M keyboards/rmi_kb/herringbone/pro/keymaps/via/rules.mk
M keyboards/rmi_kb/squishytkl/info.json
M keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c
M keyboards/rmi_kb/squishytkl/keymaps/via/rules.mk
M keyboards/rmi_kb/wete/v2/info.json
M keyboards/rmi_kb/wete/v2/keymaps/via/keymap.c
M keyboards/rmi_kb/wete/v2/keymaps/via/rules.mk
M keyboards/sawnsprojects/krush/krush65/hotswap/config.h
D keyboards/sawnsprojects/krush/krush65/hotswap/encoder_actions.c
D keyboards/sawnsprojects/krush/krush65/hotswap/encoder_actions.h
D keyboards/sawnsprojects/krush/krush65/hotswap/hotswap.h
M keyboards/sawnsprojects/krush/krush65/hotswap/info.json
M keyboards/sawnsprojects/krush/krush65/hotswap/keymaps/default/keymap.c
M keyboards/sawnsprojects/krush/krush65/hotswap/keymaps/via/keymap.c
M keyboards/sawnsprojects/krush/krush65/hotswap/keymaps/via/rules.mk
D keyboards/sofle/keymaps/keyhive_via/encoder.c
M keyboards/sofle/keymaps/keyhive_via/keymap.c
M keyboards/sofle/keymaps/keyhive_via/rules.mk
D keyboards/stello65/beta/beta.c
M keyboards/synthlabs/solo/config.h
M keyboards/synthlabs/solo/info.json
M keyboards/synthlabs/solo/keymaps/default/keymap.c
M keyboards/synthlabs/solo/keymaps/gamepad/keymap.c
M keyboards/synthlabs/solo/keymaps/via/keymap.c
M keyboards/synthlabs/solo/keymaps/via/rules.mk
D keyboards/synthlabs/solo/solo.c
D keyboards/takashicompany/dogtag/dogtag.c
M keyboards/takashicompany/dogtag/info.json
M keyboards/takashicompany/dogtag/keymaps/default/keymap.c
A keyboards/takashicompany/dogtag/keymaps/default/rules.mk
M keyboards/takashicompany/dogtag/keymaps/via/keymap.c
M keyboards/takashicompany/dogtag/keymaps/via/rules.mk
M keyboards/takashicompany/spreadwriter/info.json
M keyboards/takashicompany/spreadwriter/keymaps/default/keymap.c
M keyboards/takashicompany/spreadwriter/keymaps/via/keymap.c
M keyboards/takashicompany/spreadwriter/keymaps/via/rules.mk
M keyboards/tkc/portico75/info.json
M keyboards/tkc/portico75/keymaps/via/keymap.c
D keyboards/wekey/we27/encoder_actions.c
D keyboards/wekey/we27/encoder_actions.h
M keyboards/wekey/we27/info.json
M keyboards/wekey/we27/keymaps/default/keymap.c
A keyboards/wekey/we27/keymaps/default/rules.mk
M keyboards/wekey/we27/keymaps/via/keymap.c
M keyboards/wekey/we27/keymaps/via/rules.mk
M keyboards/wekey/we27/rules.mk
M keyboards/wekey/we27/we27.c
D keyboards/winry/winry315/keymaps/via/encoder_actions.c
D keyboards/winry/winry315/keymaps/via/encoder_actions.h
M keyboards/winry/winry315/keymaps/via/keymap.c
M keyboards/winry/winry315/keymaps/via/rules.mk
M keyboards/wuque/mammoth20x/config.h
M keyboards/wuque/mammoth20x/info.json
M keyboards/wuque/mammoth20x/keymaps/default/keymap.c
M keyboards/wuque/mammoth20x/keymaps/via/keymap.c
M keyboards/wuque/mammoth20x/keymaps/via/rules.mk
D keyboards/wuque/mammoth20x/mammoth20x.c
M keyboards/wuque/mammoth75x/config.h
M keyboards/wuque/mammoth75x/info.json
M keyboards/wuque/mammoth75x/keymaps/default/keymap.c
M keyboards/wuque/mammoth75x/keymaps/via/keymap.c
M keyboards/wuque/mammoth75x/keymaps/via/rules.mk
D keyboards/wuque/mammoth75x/mammoth75x.c
M keyboards/wuque/serneity65/info.json
M keyboards/wuque/serneity65/keymaps/default/keymap.c
M keyboards/wuque/serneity65/keymaps/via/keymap.c
M keyboards/wuque/serneity65/keymaps/via/rules.mk
D keyboards/wuque/serneity65/serneity65.c
M keyboards/yandrstudio/nz67v2/info.json
M keyboards/yandrstudio/nz67v2/keymaps/default/keymap.c
M keyboards/yandrstudio/nz67v2/keymaps/via/keymap.c
M keyboards/atlantis/ak81_ve/config.h => keyboards/atlantis/ak81_ve/config.h +0 -3
@@ 16,9 16,6 @@

#pragma once

#define ENCODERS_CCW_KEY { { 4, 5 } } // Note:  array is { col, row )
#define ENCODERS_CW_KEY  { { 3, 5 } } // Note:  array is { col, row )

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE


M keyboards/atlantis/ak81_ve/keymaps/via/keymap.c => keyboards/atlantis/ak81_ve/keymaps/via/keymap.c +42 -49
@@ 16,54 16,47 @@

#include QMK_KEYBOARD_H

#define LAYOUT_via( \
	K000, K001, K002, K003, K004, K005, K006, K007, K008,       K010, K011, K012, K013, K014, \
	K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
	K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \
	K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312,       K314, \
	K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411,       K413, K414, \
	K500, K501, K502, K503, K504,       K506,                   K510, K511, K512, K513, K514  \
) { \
	{ K000,  K001,  K002,  K003,  K004,  K005,  K006,  K007,  K008,  KC_NO, K010,  K011,  K012,  K013,  K014 }, \
	{ K100,  K101,  K102,  K103,  K104,  K105,  K106,  K107,  K108,  K109,  K110,  K111,  K112,  K113,  K114 }, \
	{ K200,  K201,  K202,  K203,  K204,  K205,  K206,  K207,  K208,  K209,  K210,  K211,  K212,  K213,  K214 }, \
	{ K300,  K301,  K302,  K303,  K304,  K305,  K306,  K307,  K308,  K309,  K310,  K311,  K312,  KC_NO, K314 }, \
	{ K400,  K401,  K402,  K403,  K404,  K405,  K406,  K407,  K408,  K409,  K410,  K411,  KC_NO, K413,  K414 }, \
	{ K500,  K501,  K502,  K503,  K504, KC_NO, K506,  KC_NO, KC_NO, KC_NO, K510,  K511,  K512,  K513,  K514 } \
}

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

	[0] = LAYOUT_via(
		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_DEL, 
		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_HOME, 
		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_VOLU, KC_VOLD, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT),

	[1] = LAYOUT_via(
		KC_SYSTEM_SLEEP, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, RGB_TOG, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPI, 
		_______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, _______, RGB_VAI, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, 
		_______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, RGB_HUI, RGB_SPD, 
		_______, _______, _______, RGB_MOD, RGB_RMOD, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_SAI),

	[2] = LAYOUT_via(
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),

	[3] = LAYOUT_via(
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)

};
\ No newline at end of file
	[0] = 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_DEL,
		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_HOME,
		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),

	[1] = LAYOUT(
		KC_SYSTEM_SLEEP, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, RGB_TOG,
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPI,
		_______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, _______, RGB_VAI,
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD,
		_______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, RGB_HUI, RGB_SPD,
		_______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_SAI),

	[2] = LAYOUT(
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______, _______, _______, _______, _______),

	[3] = LAYOUT(
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______, _______, _______, _______, _______)

};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/atlantis/ak81_ve/keymaps/via/rules.mk => keyboards/atlantis/ak81_ve/keymaps/via/rules.mk +1 -2
@@ 1,3 1,2 @@
VIA_ENABLE = yes

SRC += encoder_actions.c
\ No newline at end of file
ENCODER_MAP_ENABLE = yes

D keyboards/atlantis/encoder_actions.c => keyboards/atlantis/encoder_actions.c +0 -63
@@ 1,63 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 * Copyright 2021 drashna jael're (@drashna)
 *
 * 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 3 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 "encoder_actions.h"

#if defined(VIA_ENABLE) && defined(ENCODER_ENABLE)
static uint8_t  encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS]    = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS]   = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
    // don't return user actions, because they are in the keymap
    // encoder_update_user(index, clockwise);
    return true;
};

#endif

D keyboards/atlantis/encoder_actions.h => keyboards/atlantis/encoder_actions.h +0 -23
@@ 1,23 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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

#include "quantum.h"

void encoder_action_unregister(void);

void encoder_action_register(uint8_t index, bool clockwise);

M keyboards/custommk/evo70/info.json => keyboards/custommk/evo70/info.json +0 -4
@@ 143,13 143,9 @@

                {"matrix": [5, 6], "x": 0.5, "y": 1.1},

                {"matrix": [4, 7], "x": 0, "y": 0},

                {"matrix": [4, 8], "x": 12.5, "y": 5.1, "w": 1.25},
                {"matrix": [4, 9], "x": 13.75, "y": 5.1, "w": 1.25},

                {"matrix": [4, 10], "x": 1, "y": 0},

                {"matrix": [4, 11], "x": 15.5, "y": 5.1},
                {"matrix": [4, 12], "x": 16.5, "y": 5.1},
                {"matrix": [4, 13], "x": 17.5, "y": 5.1}

M keyboards/custommk/evo70/keymaps/default/keymap.c => keyboards/custommk/evo70/keymaps/default/keymap.c +3 -3
@@ 23,7 23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
						  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_F1,   KC_F2,   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_F3,   KC_F4,	           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_F5,   KC_F6,   KC_LCTL, KC_LWIN,          KC_LALT,                    KC_SPACE, KC_NO,   KC_VOLD, KC_RALT, KC_RCTL, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT
		KC_F5,   KC_F6,   KC_LCTL, KC_LWIN,          KC_LALT,                    KC_SPACE, KC_NO,   KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
    ),

	[1] = LAYOUT(


@@ 31,6 31,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
						  KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_F7,   KC_F8,   KC_TRNS,          BL_TOGG, BL_STEP, BL_BRTG,  KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
	    KC_F9,   KC_F10,           KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD, RGB_VAI, RGB_VAD,  RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_F11,  KC_F12,  KC_TRNS, KC_TRNS,          KC_TRNS,                    KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),
		KC_F11,  KC_F12,  KC_TRNS, KC_TRNS,          KC_TRNS,                    KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    )
};

M keyboards/custommk/evo70/keymaps/via/keymap.c => keyboards/custommk/evo70/keymaps/via/keymap.c +7 -51
@@ 23,7 23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
						  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_F1,   KC_F2,   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_F3,   KC_F4,            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_F5,   KC_F6,   KC_LCTL, KC_LWIN,          KC_LALT,                    KC_SPACE, KC_NO,   KC_VOLD, KC_RALT, KC_RCTL, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT
		KC_F5,   KC_F6,   KC_LCTL, KC_LWIN,          KC_LALT,                    KC_SPACE, KC_NO,   KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
    ),

	[1] = LAYOUT(


@@ 31,57 31,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
						  KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_F7,   KC_F8,   KC_TRNS,          BL_TOGG, BL_STEP, BL_BRTG,  KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
	    KC_F9,   KC_F10,           KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD, RGB_VAI, RGB_VAD,  RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_F11,  KC_F12,  KC_TRNS, KC_TRNS,          KC_TRNS,                    KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
		KC_F11,  KC_F12,  KC_TRNS, KC_TRNS,          KC_TRNS,                    KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),
};

static bool custom_encoder_mode = false;

void set_custom_encoder_mode_user(bool custom_mode) {
	custom_encoder_mode = custom_mode;
}


keyevent_t encoder_ccw = {
    .key = (keypos_t){.row = 4, .col = 7},
    .pressed = false,
	.type = KEY_EVENT
};

keyevent_t encoder_cw = {
    .key = (keypos_t){.row = 4, .col = 10},
    .pressed = false,
	.type = KEY_EVENT
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
};


bool encoder_update_user(uint8_t index, bool clockwise) {
	if (custom_encoder_mode) {
	    if (clockwise) {
	        encoder_cw.pressed = true;
		    encoder_cw.time = timer_read();
		    action_exec(encoder_cw);
	    }
	    else {
		    encoder_ccw.pressed = true;
		    encoder_ccw.time = timer_read();
		    action_exec(encoder_ccw);
	    }
		return false;
	}
	return true;
}

void matrix_scan_user(void) {
	if (encoder_ccw.pressed) {
		encoder_ccw.pressed = false;
		encoder_ccw.time = timer_read();
		action_exec(encoder_ccw);
	}

	if (encoder_cw.pressed) {
		encoder_cw.pressed = false;
		encoder_cw.time = timer_read();
		action_exec(encoder_cw);
	}
}
#endif

M keyboards/custommk/evo70/keymaps/via/rules.mk => keyboards/custommk/evo70/keymaps/via/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/custommk/genesis/rev2/info.json => keyboards/custommk/genesis/rev2/info.json +0 -33
@@ 81,39 81,6 @@
                {"matrix": [4, 2], "x": 0, "y": 4, "w": 2},
                {"matrix": [4, 3], "x": 2, "y": 4}
            ]
        },
        "LAYOUT_via_6x4": {
            "layout": [
                {"matrix": [5, 0], "x": 0, "y": 0},
                {"matrix": [5, 1], "x": 1, "y": 0},
                {"matrix": [5, 2], "x": 3, "y": 0},
                {"matrix": [5, 3], "x": 4, "y": 0},

                {"matrix": [0, 0], "x": 0.5, "y": 1.1},
                {"matrix": [0, 1], "x": 1.5, "y": 1.1},
                {"matrix": [0, 2], "x": 2.5, "y": 1.1},
                {"matrix": [0, 3], "x": 3.5, "y": 1.1},

                {"matrix": [1, 0], "x": 0.5, "y": 2.1},
                {"matrix": [1, 1], "x": 1.5, "y": 2.1},
                {"matrix": [1, 2], "x": 2.5, "y": 2.1},
                {"matrix": [1, 3], "x": 3.5, "y": 2.1},

                {"matrix": [2, 0], "x": 0.5, "y": 3.1},
                {"matrix": [2, 1], "x": 1.5, "y": 3.1},
                {"matrix": [2, 2], "x": 2.5, "y": 3.1},
                {"matrix": [2, 3], "x": 3.5, "y": 3.1},

                {"matrix": [3, 0], "x": 0.5, "y": 4.1},
                {"matrix": [3, 1], "x": 1.5, "y": 4.1},
                {"matrix": [3, 2], "x": 2.5, "y": 4.1},
                {"matrix": [3, 3], "x": 3.5, "y": 4.1},

                {"matrix": [4, 0], "x": 0.5, "y": 5.1},
                {"matrix": [4, 1], "x": 1.5, "y": 5.1},
                {"matrix": [4, 2], "x": 2.5, "y": 5.1},
                {"matrix": [4, 3], "x": 3.5, "y": 5.1}
            ]
        }
    }
}

M keyboards/custommk/genesis/rev2/keymaps/via/keymap.c => keyboards/custommk/genesis/rev2/keymaps/via/keymap.c +28 -101
@@ 13,7 13,7 @@
 * 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

//#define GENESIS_LAYER_COLORS


@@ 24,36 24,32 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

	[0] = LAYOUT_via_6x4(
		    KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU,
			MO(1),   KC_PSLS, KC_PAST, KC_PMNS,
			KC_P7,   KC_P8,   KC_P9,   KC_PGUP,
			KC_P4,   KC_P5,   KC_P6,   KC_PPLS,
			KC_P1,   KC_P2,   KC_P3,   KC_PGDN,
	[0] = LAYOUT_ortho_5x4(
			MO(1),   KC_PSLS, KC_PAST, KC_PMNS, 
			KC_P7,   KC_P8,   KC_P9,   KC_PGUP, 
			KC_P4,   KC_P5,   KC_P6,   KC_PPLS, 
			KC_P1,   KC_P2,   KC_P3,   KC_PGDN, 
			KC_P0,   KC_SPC,  KC_PDOT, KC_PENT),

	[1] = LAYOUT_via_6x4(
		    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
	[1] = LAYOUT_ortho_5x4(
			KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS),

	[2] = LAYOUT_via_6x4(
		    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
	[2] = LAYOUT_ortho_5x4(
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),

	[3] = LAYOUT_via_6x4(
		    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
	[3] = LAYOUT_ortho_5x4(
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),

};


@@ 92,80 88,11 @@ void keyboard_post_init_user(void) {
}
#endif


keyevent_t encoder_left_ccw = {
    .key = (keypos_t){.row = 5, .col = 0},
    .pressed = false,
	.type = KEY_EVENT
};

keyevent_t encoder_left_cw = {
    .key = (keypos_t){.row = 5, .col = 1},
    .pressed = false,
	.type = KEY_EVENT
};

keyevent_t encoder_right_ccw = {
    .key = (keypos_t){.row = 5, .col = 2},
    .pressed = false,
	.type = KEY_EVENT
};

keyevent_t encoder_right_cw = {
    .key = (keypos_t){.row = 5, .col = 3},
    .pressed = false,
	.type = KEY_EVENT
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =   { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU)  },
    [1] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [2] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [3] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  }
};

void matrix_scan_user(void) {
    if (encoder_left_ccw.pressed) {
        encoder_left_ccw.pressed = false;
        encoder_left_ccw.time = timer_read();
        action_exec(encoder_left_ccw);
    }

    if (encoder_left_cw.pressed) {
        encoder_left_cw.pressed = false;
        encoder_left_cw.time = timer_read();
        action_exec(encoder_left_cw);
    }

    if (encoder_right_ccw.pressed) {
        encoder_right_ccw.pressed = false;
        encoder_right_ccw.time = timer_read();
        action_exec(encoder_right_ccw);
    }

    if (encoder_right_cw.pressed) {
        encoder_right_cw.pressed = false;
        encoder_right_cw.time = timer_read();
        action_exec(encoder_right_cw);
    }

}


bool encoder_update_user(uint8_t index, bool clockwise) {
	if (index == 0) {
		if (clockwise) {
			encoder_left_cw.pressed = true;
			encoder_left_cw.time = timer_read();
			action_exec(encoder_left_cw);
		} else {
			encoder_left_ccw.pressed = true;
			encoder_left_ccw.time = timer_read();
			action_exec(encoder_left_ccw);
		}
	} else {
		if (clockwise) {
			encoder_right_cw.pressed = true;
			encoder_right_cw.time = timer_read();
			action_exec(encoder_right_cw);
		} else {
			encoder_right_ccw.pressed = true;
			encoder_right_ccw.time = timer_read();
			action_exec(encoder_right_ccw);
		}
	}
    return false;
}
#endif

M keyboards/custommk/genesis/rev2/keymaps/via/rules.mk => keyboards/custommk/genesis/rev2/keymaps/via/rules.mk +2 -1
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/dailycraft/owl8/info.json => keyboards/dailycraft/owl8/info.json +5 -10
@@ 18,21 18,16 @@
    "bootloader": "atmel-dfu",
    "matrix_pins": {
        "direct": [
            ["F4", "F7", "B3", "B6", "F5", "F6", "B1", "B2", "D4", "C6", "D7", "E6", null, null, null, null]
            ["F4", "F7", "B3", "B6", "F5", "F6", "B1", "B2", "D4", "C6", "D7", "E6"]
        ]
    },
    "layouts": {
        "LAYOUT": {
            "layout": [
                {"x": 0, "y": 0, "matrix": [0, 12]},
                {"x": 1, "y": 0, "matrix": [0, 13]},
                {"x": 2, "y": 0, "matrix": [0, 14]},
                {"x": 3, "y": 0, "matrix": [0, 15]},

                {"x": 0, "y": 1.25, "matrix": [0, 8]},
                {"x": 1, "y": 1.25, "matrix": [0, 9]},
                {"x": 2, "y": 1.25, "matrix": [0, 10]},
                {"x": 3, "y": 1.25, "matrix": [0, 11]},
                {"x":0, "y":1.25, "matrix": [0, 8]},
                {"x":1, "y":1.25, "matrix": [0, 9]},
                {"x":2, "y":1.25, "matrix": [0, 10]},
                {"x":3, "y":1.25, "matrix": [0, 11]},

                {"x": 0, "y": 2.5, "matrix": [0, 0]},
                {"x": 1, "y": 2.5, "matrix": [0, 1]},

M keyboards/dailycraft/owl8/keymaps/default/keymap.c => keyboards/dailycraft/owl8/keymaps/default/keymap.c +1 -5
@@ 25,26 25,22 @@ enum layer_names {

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [_BASE] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO, // for encoders
        KC_NO,   KC_NO,   KC_NO,  KC_NO, // for ext keys
        MO(1),   KC_BSPC, KC_SPC, KC_ENT,
        KC_LEFT, KC_DOWN, KC_UP,  KC_RGHT
    ),
    [_FN1] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_1,    KC_2,    KC_3,   KC_4,
        KC_5,    KC_6,    KC_7,   KC_8
    ),
    [_FN2] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_1,    KC_2,    KC_3,   KC_4,
        KC_5,    KC_6,    KC_7,   KC_8
    ),
    [_FN3] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_1,    KC_2,    KC_3,   KC_4,
        KC_5,    KC_6,    KC_7,   KC_8
    )


@@ 64,5 60,5 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
            tap_code(KC_UP);
        }
    }
    return true;
    return false;
}

M keyboards/dailycraft/owl8/keymaps/via/keymap.c => keyboards/dailycraft/owl8/keymaps/via/keymap.c +7 -78
@@ 25,103 25,32 @@ enum layer_names {

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [_BASE] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO, // for encoders
        KC_NO,   KC_NO,   KC_NO,  KC_NO, // for ext keys
        MO(1),   KC_BSPC, KC_SPC, KC_ENT,
        KC_LEFT, KC_DOWN, KC_UP,  KC_RGHT
    ),
    [_FN1] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_1,    KC_2,    KC_3,   KC_4,
        KC_5,    KC_6,    KC_7,   KC_8
    ),
    [_FN2] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_1,    KC_2,    KC_3,   KC_4,
        KC_5,    KC_6,    KC_7,   KC_8
    ),
    [_FN3] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_1,    KC_2,    KC_3,   KC_4,
        KC_5,    KC_6,    KC_7,   KC_8
    )
};

keyevent_t encoder1_ccw = {
    .key = (keypos_t){.row = 0, .col = 12},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder1_cw = {
    .key = (keypos_t){.row = 0, .col = 13},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder2_ccw = {
    .key = (keypos_t){.row = 0, .col = 14},
    .pressed = false,
    .type = KEY_EVENT
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [1] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [2] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [3] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  }
};

keyevent_t encoder2_cw = {
    .key = (keypos_t){.row = 0, .col = 15},
    .pressed = false,
    .type = KEY_EVENT
};

void matrix_scan_user(void) {
    if (encoder1_ccw.pressed) {
        encoder1_ccw.pressed = false;
        encoder1_ccw.time = timer_read();
        action_exec(encoder1_ccw);
    }

    if (encoder1_cw.pressed) {
        encoder1_cw.pressed = false;
        encoder1_cw.time = timer_read();
        action_exec(encoder1_cw);
    }

    if (encoder2_ccw.pressed) {
        encoder2_ccw.pressed = false;
        encoder2_ccw.time = timer_read();
        action_exec(encoder2_ccw);
    }

    if (encoder2_cw.pressed) {
        encoder2_cw.pressed = false;
        encoder2_cw.time = timer_read();
        action_exec(encoder2_cw);
    }
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) { /* First encoder */
        if (clockwise) {
            encoder1_cw.pressed = true;
            encoder1_cw.time = timer_read();
            action_exec(encoder1_cw);
        } else {
            encoder1_ccw.pressed = true;
            encoder1_ccw.time = timer_read();
            action_exec(encoder1_ccw);
        }
    } else if (index == 1) {
        if (clockwise) {
            encoder2_cw.pressed = true;
            encoder2_cw.time = timer_read();
            action_exec(encoder2_cw);
        } else {
            encoder2_ccw.pressed = true;
            encoder2_ccw.time = timer_read();
            action_exec(encoder2_ccw);
        }
    }

    return true;
}
#endif

M keyboards/dailycraft/owl8/keymaps/via/rules.mk => keyboards/dailycraft/owl8/keymaps/via/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/dailycraft/stickey4/info.json => keyboards/dailycraft/stickey4/info.json +2 -7
@@ 18,7 18,7 @@
    "bootloader": "atmel-dfu",
    "matrix_pins": {
        "direct": [
            ["D4", "C6", "D7", "E6", null, null, null, null]
            ["D4", "C6", "D7", "E6"]
        ]
    },
    "layouts": {


@@ 27,12 27,7 @@
                {"x": 0, "y": 0, "matrix": [0, 0]},
                {"x": 1, "y": 0, "matrix": [0, 1]},
                {"x": 2, "y": 0, "matrix": [0, 2]},
                {"x": 3, "y": 0, "matrix": [0, 3]},

                {"label": "Encoder 1 CCW", "x": 0, "y": 1, "matrix": [0, 4]},
                {"label": "Encoder 1 CW", "x": 1, "y": 1, "matrix": [0, 5]},
                {"label": "Encoder 2 CCW", "x": 2, "y": 1, "matrix": [0, 6]},
                {"label": "Encoder 2 CW", "x": 3, "y": 1, "matrix": [0, 7]}
                {"x": 3, "y": 0, "matrix": [0, 3]}
            ]
        }
    }

M keyboards/dailycraft/stickey4/keymaps/default/keymap.c => keyboards/dailycraft/stickey4/keymaps/default/keymap.c +1 -14
@@ 25,19 25,6 @@ enum layer_names {

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [_BASE] = LAYOUT(
        KC_A,    KC_B,    KC_C,   KC_D,
        KC_NO,   KC_NO,   KC_NO,  KC_NO // for encoders
    ),
    [_FN1] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO
    ),
    [_FN2] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO
    ),
    [_FN3] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO
        KC_A,    KC_B,    KC_C,   KC_D
    )
};

M keyboards/dailycraft/stickey4/keymaps/via/keymap.c => keyboards/dailycraft/stickey4/keymaps/via/keymap.c +8 -79
@@ 25,95 25,24 @@ enum layer_names {

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [_BASE] = LAYOUT(
        KC_A,    KC_B,    KC_C,   KC_D,
        KC_NO,   KC_NO,   KC_NO,  KC_NO // for encoders
        KC_A,    KC_B,    KC_C,   KC_D
    ),
    [_FN1] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO
    ),
    [_FN2] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO
    ),
    [_FN3] = LAYOUT(
        KC_NO,   KC_NO,   KC_NO,  KC_NO,
        KC_NO,   KC_NO,   KC_NO,  KC_NO
    )
};

keyevent_t encoder1_ccw = {
    .key = (keypos_t){.row = 0, .col = 4},
    .pressed = false,
    .type = KEY_EVENT
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [1] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [2] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [3] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  }
};

keyevent_t encoder1_cw = {
    .key = (keypos_t){.row = 0, .col = 5},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder2_ccw = {
    .key = (keypos_t){.row = 0, .col = 6},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder2_cw = {
    .key = (keypos_t){.row = 0, .col = 7},
    .pressed = false,
    .type = KEY_EVENT
};

void matrix_scan_user(void) {
    if (encoder1_ccw.pressed) {
        encoder1_ccw.pressed = false;
        encoder1_ccw.time = timer_read();
        action_exec(encoder1_ccw);
    }

    if (encoder1_cw.pressed) {
        encoder1_cw.pressed = false;
        encoder1_cw.time = timer_read();
        action_exec(encoder1_cw);
    }

    if (encoder2_ccw.pressed) {
        encoder2_ccw.pressed = false;
        encoder2_ccw.time = timer_read();
        action_exec(encoder2_ccw);
    }

    if (encoder2_cw.pressed) {
        encoder2_cw.pressed = false;
        encoder2_cw.time = timer_read();
        action_exec(encoder2_cw);
    }
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) { /* First encoder */
        if (clockwise) {
            encoder1_cw.pressed = true;
            encoder1_cw.time = timer_read();
            action_exec(encoder1_cw);
        } else {
            encoder1_ccw.pressed = true;
            encoder1_ccw.time = timer_read();
            action_exec(encoder1_ccw);
        }
    } else if (index == 1) {
        if (clockwise) {
            encoder2_cw.pressed = true;
            encoder2_cw.time = timer_read();
            action_exec(encoder2_cw);
        } else {
            encoder2_ccw.pressed = true;
            encoder2_ccw.time = timer_read();
            action_exec(encoder2_ccw);
        }
    }

    return true;
}
#endif

M keyboards/dailycraft/stickey4/keymaps/via/rules.mk => keyboards/dailycraft/stickey4/keymaps/via/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/dailycraft/wings42/rev2/info.json => keyboards/dailycraft/wings42/rev2/info.json +9 -4
@@ 16,6 16,15 @@
    "split": {
        "soft_serial_pin": "D2"
    },
    "features": {
      "encoder": true
    },
    "encoder": {
        "rotary": [
            { "pin_a": "B5", "pin_b": "B4" },
            { "pin_a": "B6", "pin_b": "B2" }
        ]
    },
    "processor": "atmega32u4",
    "bootloader": "caterina",
    "layouts": {


@@ 41,9 50,7 @@
                {"matrix": [1, 3], "x": 3, "y": 1},
                {"matrix": [1, 4], "x": 4, "y": 1},
                {"matrix": [1, 5], "x": 5, "y": 1.125},
                {"matrix": [3, 1], "x": 6, "y": 1.625},

                {"matrix": [8, 2], "x": 8, "y": 1.625},
                {"matrix": [6, 5], "x": 9, "y": 1.125},
                {"matrix": [6, 4], "x": 10, "y": 1},
                {"matrix": [6, 3], "x": 11, "y": 1},


@@ 57,9 64,7 @@
                {"matrix": [2, 3], "x": 3, "y": 2},
                {"matrix": [2, 4], "x": 4, "y": 2},
                {"matrix": [2, 5], "x": 5, "y": 2.125},
                {"matrix": [3, 2], "x": 6, "y": 2.625},

                {"matrix": [8, 1], "x": 8, "y": 2.625},
                {"matrix": [7, 5], "x": 9, "y": 2.125},
                {"matrix": [7, 4], "x": 10, "y": 2},
                {"matrix": [7, 3], "x": 11, "y": 2},

M keyboards/dailycraft/wings42/rev2/keymaps/default/keymap.c => keyboards/dailycraft/wings42/rev2/keymaps/default/keymap.c +8 -8
@@ 35,9 35,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    //,--------+--------+--------+--------+--------+--------.                     ,--------+---------+--------+---------+--------+--------.
        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_G_TAB, KC_A   , KC_S   , KC_D   , KC_F   , KC_G   ,  KC_BSPC, KC_BSPC,    KC_H   , KC_J    , KC_K   , KC_L    , KC_SCLN, KC_G_BS,
       KC_G_TAB, KC_A   , KC_S   , KC_D   , KC_F   , KC_G   ,                       KC_H   , KC_J    , KC_K   , KC_L    , KC_SCLN, KC_G_BS,
    //|--------+--------+--------+--------+--------+--------|                     |--------+---------+--------+---------+--------+--------|
        KC_LCTL, KC_Z   , KC_X   , KC_C   , KC_V   , KC_B   ,  KC_DEL , KC_DEL ,    KC_N   , KC_M    , KC_COMM, KC_DOT  , KC_SLSH, KC_RCTL,
        KC_LCTL, KC_Z   , KC_X   , KC_C   , KC_V   , KC_B   ,                       KC_N   , KC_M    , KC_COMM, KC_DOT  , KC_SLSH, KC_RCTL,
    //`--------+--------+--------+--------+--------+--------/                     \--------+---------+--------+---------+--------+--------'
                                  KC_A_DEL,KC_S_EN ,KC_L_SPC,                      KC_R_ENT, KC_S_JA , KC_A_DEL
    //                          `+--------+--------+--------'                     `--------+---------+--------+'


@@ 47,9 47,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    //,--------+--------+--------+--------+--------+--------.                     ,--------+--------+--------+--------+--------+--------.
        _______, KC_BSLS, KC_CIRC, KC_EXLM, KC_AMPR, KC_PIPE,                       KC_AT  , KC_EQL , KC_PLUS, KC_ASTR, KC_PERC, KC_MINS,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        KC_LPRN, KC_HASH, KC_DLR , KC_DQT , KC_QUOT, KC_TILD,  _______, _______,    KC_LEFT, KC_DOWN,  KC_UP , KC_RGHT, KC_GRV , KC_RPRN,
        KC_LPRN, KC_HASH, KC_DLR , KC_DQT , KC_QUOT, KC_TILD,                       KC_LEFT, KC_DOWN,  KC_UP , KC_RGHT, KC_GRV , KC_RPRN,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        _______, _______, _______, _______, KC_LCBR, KC_LBRC,  _______, _______,    KC_RBRC, KC_RCBR, _______, _______, _______, _______,
        _______, _______, _______, _______, KC_LCBR, KC_LBRC,                       KC_RBRC, KC_RCBR, _______, _______, _______, _______,
    //`--------+--------+--------+--------+--------+--------/                     \--------+--------+--------+--------+--------+--------'
                                  _______, _______, _______,                        _______, _______, QK_BOOT
    //                          `+--------+--------+--------'                      `--------+-------+--------+'


@@ 59,9 59,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    //,--------+--------+--------+--------+--------+--------.                     ,--------+--------+--------+--------+--------+--------.
        KC_F1  , KC_F2  , KC_F3  , KC_F4  , KC_F5  , KC_F6  ,                       _______, KC_EQL , KC_PLUS, KC_ASTR, KC_PERC, KC_MINS,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        _______, KC_1   , KC_2   , KC_3   , KC_4   , KC_5   ,  _______, _______,    KC_6   , KC_7   , KC_8   , KC_9   , KC_0   , _______,
        _______, KC_1   , KC_2   , KC_3   , KC_4   , KC_5   ,                       KC_6   , KC_7   , KC_8   , KC_9   , KC_0   , _______,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        KC_F7  , KC_F8  , KC_F9  , KC_F10 , KC_F11 , KC_F12 ,  _______, _______,    _______, _______, KC_COMM, KC_DOT , KC_SLSH, _______,
        KC_F7  , KC_F8  , KC_F9  , KC_F10 , KC_F11 , KC_F12 ,                       _______, _______, KC_COMM, KC_DOT , KC_SLSH, _______,
    //`--------+--------+--------+--------+--------+--------/                     \--------+--------+--------+--------+--------+--------'
                                  QK_BOOT  , _______, _______,                        _______, _______, _______
    //                          `+--------+--------+--------'                     `--------+--------+--------+'


@@ 71,9 71,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    //,--------+--------+--------+--------+--------+--------.                     ,--------+--------+--------+--------+--------+--------.
        _______, _______, _______, _______, _______, _______,                       _______, _______, _______, _______, _______, _______,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        _______, _______, _______, _______, _______, _______,  _______, _______,    _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______,                       _______, _______, _______, _______, _______, _______,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        _______, _______, _______, _______, _______, _______,  _______, _______,    _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______,                       _______, _______, _______, _______, _______, _______,
    //`--------+--------+--------+--------+--------+--------/                     \--------+--------+--------+--------+--------+--------'
                                  _______, _______, _______,                        _______, _______, _______
    //                          `+--------+--------+--------'                     `--------+--------+--------+'

M keyboards/dailycraft/wings42/rev2/keymaps/via/keymap.c => keyboards/dailycraft/wings42/rev2/keymaps/via/keymap.c +15 -151
@@ 35,9 35,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    //,--------+--------+--------+--------+--------+--------.                     ,--------+---------+--------+---------+--------+--------.
        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_G_TAB, KC_A   , KC_S   , KC_D   , KC_F   , KC_G   ,  KC_BSPC, KC_BSPC,    KC_H   , KC_J    , KC_K   , KC_L    , KC_SCLN, KC_G_BS,
       KC_G_TAB, KC_A   , KC_S   , KC_D   , KC_F   , KC_G   ,                       KC_H   , KC_J    , KC_K   , KC_L    , KC_SCLN, KC_G_BS,
    //|--------+--------+--------+--------+--------+--------|                     |--------+---------+--------+---------+--------+--------|
        KC_LCTL, KC_Z   , KC_X   , KC_C   , KC_V   , KC_B   ,  KC_DEL , KC_DEL ,    KC_N   , KC_M    , KC_COMM, KC_DOT  , KC_SLSH, KC_RCTL,
        KC_LCTL, KC_Z   , KC_X   , KC_C   , KC_V   , KC_B   ,                       KC_N   , KC_M    , KC_COMM, KC_DOT  , KC_SLSH, KC_RCTL,
    //`--------+--------+--------+--------+--------+--------/                     \--------+---------+--------+---------+--------+--------'
                                  KC_A_DEL,KC_S_EN ,KC_L_SPC,                      KC_R_ENT, KC_S_JA , KC_A_DEL
    //                          `+--------+--------+--------'                     `--------+---------+--------+'


@@ 47,9 47,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    //,--------+--------+--------+--------+--------+--------.                     ,--------+--------+--------+--------+--------+--------.
        _______, KC_BSLS, KC_CIRC, KC_EXLM, KC_AMPR, KC_PIPE,                       KC_AT  , KC_EQL , KC_PLUS, KC_ASTR, KC_PERC, KC_MINS,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        KC_LPRN, KC_HASH, KC_DLR , KC_DQT , KC_QUOT, KC_TILD,  _______, _______,    KC_LEFT, KC_DOWN,  KC_UP , KC_RGHT, KC_GRV , KC_RPRN,
        KC_LPRN, KC_HASH, KC_DLR , KC_DQT , KC_QUOT, KC_TILD,                       KC_LEFT, KC_DOWN,  KC_UP , KC_RGHT, KC_GRV , KC_RPRN,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        _______, _______, _______, _______, KC_LCBR, KC_LBRC,  _______, _______,    KC_RBRC, KC_RCBR, _______, _______, _______, _______,
        _______, _______, _______, _______, KC_LCBR, KC_LBRC,                       KC_RBRC, KC_RCBR, _______, _______, _______, _______,
    //`--------+--------+--------+--------+--------+--------/                     \--------+--------+--------+--------+--------+--------'
                                  _______, _______, _______,                        _______, _______, QK_BOOT
    //                          `+--------+--------+--------'                      `--------+-------+--------+'


@@ 59,9 59,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    //,--------+--------+--------+--------+--------+--------.                     ,--------+--------+--------+--------+--------+--------.
        KC_F1  , KC_F2  , KC_F3  , KC_F4  , KC_F5  , KC_F6  ,                       _______, KC_EQL , KC_PLUS, KC_ASTR, KC_PERC, KC_MINS,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        _______, KC_1   , KC_2   , KC_3   , KC_4   , KC_5   ,  _______, _______,    KC_6   , KC_7   , KC_8   , KC_9   , KC_0   , _______,
        _______, KC_1   , KC_2   , KC_3   , KC_4   , KC_5   ,                       KC_6   , KC_7   , KC_8   , KC_9   , KC_0   , _______,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        KC_F7  , KC_F8  , KC_F9  , KC_F10 , KC_F11 , KC_F12 ,  _______, _______,    _______, _______, KC_COMM, KC_DOT , KC_SLSH, _______,
        KC_F7  , KC_F8  , KC_F9  , KC_F10 , KC_F11 , KC_F12 ,                       _______, _______, KC_COMM, KC_DOT , KC_SLSH, _______,
    //`--------+--------+--------+--------+--------+--------/                     \--------+--------+--------+--------+--------+--------'
                                  QK_BOOT  , _______, _______,                        _______, _______, _______
    //                          `+--------+--------+--------'                     `--------+--------+--------+'


@@ 71,156 71,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    //,--------+--------+--------+--------+--------+--------.                     ,--------+--------+--------+--------+--------+--------.
        _______, _______, _______, _______, _______, _______,                       _______, _______, _______, _______, _______, _______,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        _______, _______, _______, _______, _______, _______,  _______, _______,    _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______,                       _______, _______, _______, _______, _______, _______,
    //|--------+--------+--------+--------+--------+--------|                     |--------+--------+--------+--------+--------+--------|
        _______, _______, _______, _______, _______, _______,  _______, _______,    _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______,                       _______, _______, _______, _______, _______, _______,
    //`--------+--------+--------+--------+--------+--------/                     \--------+--------+--------+--------+--------+--------'
                                  _______, _______, _______,                        _______, _______, _______
    //                          `+--------+--------+--------'                     `--------+--------+--------+'
    ),
};

keyevent_t encoder1_ccw = {
    .key = (keypos_t){.row = 4, .col = 0},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder1_cw = {
    .key = (keypos_t){.row = 4, .col = 1},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder2_ccw = {
    .key = (keypos_t){.row = 4, .col = 2},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder2_cw = {
    .key = (keypos_t){.row = 4, .col = 3},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder3_ccw = {
    .key = (keypos_t){.row = 9, .col = 1},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder3_cw = {
    .key = (keypos_t){.row = 9, .col = 0},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder4_ccw = {
    .key = (keypos_t){.row = 9, .col = 3},
    .pressed = false,
    .type = KEY_EVENT
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =   { ENCODER_CCW_CW(KC_BSPC, KC_DEL),  ENCODER_CCW_CW(KC_BSPC, KC_DEL)   },
    [1] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [2] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [3] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  }
};

keyevent_t encoder4_cw = {
    .key = (keypos_t){.row = 9, .col = 2},
    .pressed = false,
    .type = KEY_EVENT
};


void matrix_scan_user(void) {
    if (encoder1_ccw.pressed) {
        encoder1_ccw.pressed = false;
        encoder1_ccw.time = timer_read();
        action_exec(encoder1_ccw);
    }

    if (encoder1_cw.pressed) {
        encoder1_cw.pressed = false;
        encoder1_cw.time = timer_read();
        action_exec(encoder1_cw);
    }

    if (encoder2_ccw.pressed) {
        encoder2_ccw.pressed = false;
        encoder2_ccw.time = timer_read();
        action_exec(encoder2_ccw);
    }

    if (encoder2_cw.pressed) {
        encoder2_cw.pressed = false;
        encoder2_cw.time = timer_read();
        action_exec(encoder2_cw);
    }

    if (encoder3_ccw.pressed) {
        encoder3_ccw.pressed = false;
        encoder3_ccw.time = timer_read();
        action_exec(encoder3_ccw);
    }

    if (encoder3_cw.pressed) {
        encoder3_cw.pressed = false;
        encoder3_cw.time = timer_read();
        action_exec(encoder3_cw);
    }

    if (encoder4_ccw.pressed) {
        encoder4_ccw.pressed = false;
        encoder4_ccw.time = timer_read();
        action_exec(encoder4_ccw);
    }

    if (encoder4_cw.pressed) {
        encoder4_cw.pressed = false;
        encoder4_cw.time = timer_read();
        action_exec(encoder4_cw);
    }
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) {
        if (clockwise) {
            encoder1_cw.pressed = true;
            encoder1_cw.time = timer_read();
            action_exec(encoder1_cw);
        } else {
            encoder1_ccw.pressed = true;
            encoder1_ccw.time = timer_read();
            action_exec(encoder1_ccw);
        }
    } else if (index == 1) {
        if (clockwise) {
            encoder2_cw.pressed = true;
            encoder2_cw.time = timer_read();
            action_exec(encoder2_cw);
        } else {
            encoder2_ccw.pressed = true;
            encoder2_ccw.time = timer_read();
            action_exec(encoder2_ccw);
        }
    } else if (index == 2) {
        if (clockwise) {
            encoder3_cw.pressed = true;
            encoder3_cw.time = timer_read();
            action_exec(encoder3_cw);
        } else {
            encoder3_ccw.pressed = true;
            encoder3_ccw.time = timer_read();
            action_exec(encoder3_ccw);
        }
    } else if (index == 3) {
        if (clockwise) {
            encoder4_cw.pressed = true;
            encoder4_cw.time = timer_read();
            action_exec(encoder4_cw);
        } else {
            encoder4_ccw.pressed = true;
            encoder4_ccw.time = timer_read();
            action_exec(encoder4_ccw);
        }
    }

    return true;
}
#endif

M keyboards/dailycraft/wings42/rev2/keymaps/via/rules.mk => keyboards/dailycraft/wings42/rev2/keymaps/via/rules.mk +1 -1
@@ 1,2 1,2 @@
ENCODER_ENABLE = yes
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/gl516/n51gl/info.json => keyboards/gl516/n51gl/info.json +0 -58
@@ 86,64 86,6 @@
                {"matrix": [7, 5], "x": 14.75, "y": 3},
                {"matrix": [7, 6], "x": 15.75, "y": 3}
            ]
        },
        "LAYOUT_rotary_layer": {
            "layout": [
                {"matrix": [0, 0], "x": 0, "y": 0},
                {"matrix": [0, 1], "x": 1, "y": 0},
                {"matrix": [0, 2], "x": 2, "y": 0},
                {"matrix": [0, 3], "x": 3, "y": 0},
                {"matrix": [0, 4], "x": 4, "y": 0},
                {"matrix": [0, 5], "x": 5, "y": 0},
                {"matrix": [0, 6], "x": 6, "y": 0},
                {"matrix": [4, 0], "x": 7, "y": 0},
                {"matrix": [4, 1], "x": 8, "y": 0},
                {"matrix": [4, 2], "x": 9, "y": 0},
                {"matrix": [4, 3], "x": 10, "y": 0},
                {"matrix": [4, 4], "x": 11, "y": 0},
                {"matrix": [4, 5], "x": 12, "y": 0},
                {"matrix": [4, 6], "x": 13, "y": 0},
                {"matrix": [1, 1], "x": 14, "y": 0},
                {"matrix": [1, 2], "x": 15, "y": 0},
                {"matrix": [1, 3], "x": 16, "y": 0},
                {"matrix": [1, 4], "x": 17, "y": 0},
                {"matrix": [1, 5], "x": 18, "y": 0},
                {"matrix": [1, 6], "x": 19, "y": 0},
                {"matrix": [1, 0], "x": 20, "y": 0},
                {"matrix": [5, 0], "x": 21, "y": 0},
                {"matrix": [5, 1], "x": 22, "y": 0},
                {"matrix": [5, 2], "x": 23, "y": 0},
                {"matrix": [5, 3], "x": 24, "y": 0},
                {"matrix": [5, 4], "x": 25, "y": 0},
                {"matrix": [5, 5], "x": 26, "y": 0},
                {"matrix": [5, 6], "x": 27, "y": 0},
                {"matrix": [2, 1], "x": 28, "y": 0},
                {"matrix": [2, 2], "x": 29, "y": 0},
                {"matrix": [2, 3], "x": 30, "y": 0},
                {"matrix": [2, 4], "x": 31, "y": 0},
                {"matrix": [2, 5], "x": 32, "y": 0},
                {"matrix": [2, 6], "x": 33, "y": 0},
                {"matrix": [2, 0], "x": 34, "y": 0},
                {"matrix": [6, 0], "x": 35, "y": 0},
                {"matrix": [6, 1], "x": 36, "y": 0},
                {"matrix": [6, 2], "x": 37, "y": 0},
                {"matrix": [6, 3], "x": 38, "y": 0},
                {"matrix": [6, 4], "x": 39, "y": 0},
                {"matrix": [6, 5], "x": 40, "y": 0},
                {"matrix": [6, 6], "x": 41, "y": 0},
                {"matrix": [3, 1], "x": 42, "y": 0},
                {"matrix": [3, 2], "x": 43, "y": 0},
                {"matrix": [3, 4], "x": 44, "y": 0},
                {"matrix": [3, 5], "x": 45, "y": 0},
                {"matrix": [3, 6], "x": 46, "y": 0},
                {"matrix": [3, 0], "x": 47, "y": 0},
                {"matrix": [7, 0], "x": 48, "y": 0},
                {"matrix": [7, 1], "x": 49, "y": 0},
                {"matrix": [7, 2], "x": 50, "y": 0},
                {"matrix": [7, 4], "x": 51, "y": 0},
                {"matrix": [7, 5], "x": 52, "y": 0},
                {"matrix": [7, 6], "x": 53, "y": 0}
            ]
        }
    }
}

D keyboards/gl516/n51gl/keymaps/salicylic/config.h => keyboards/gl516/n51gl/keymaps/salicylic/config.h +0 -22
@@ 1,22 0,0 @@
/* Copyright 2021 Salicylic_acid3
 *
 * 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

/* Select hand configuration */

#define QUICK_TAP_TERM 0
#define TAPPING_TERM 180

D keyboards/gl516/n51gl/keymaps/salicylic/keymap.c => keyboards/gl516/n51gl/keymaps/salicylic/keymap.c +0 -117
@@ 1,117 0,0 @@
/*
Copyright 2021 Salicylic_Acid

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_japanese.h"


// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
enum layer_number {
  _QWERTY = 0,
  _LOWER,
  _RAISE,
  _ADJUST,
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  [_QWERTY] = LAYOUT_rotary_layer(
  //,--------------------------------------------------------------|        |--------------------------------------------------------------.
       KC_ESC,  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_BSPC,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
              KC_LCTL,    KC_A,    KC_S,    KC_D,    KC_F,    KC_G, KC_VOLU,    KC_H,    KC_J,    KC_K,    KC_L, JP_MINS, JP_BSLS,  KC_ENT,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               KC_LSFT,    KC_Z,    KC_X,    KC_C,    KC_V,    KC_B, KC_MUTE,    KC_N,    KC_M, KC_COMM,  KC_DOT, JP_SLSH,   KC_UP, KC_RSFT,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
         JP_ZKHK, KC_LALT,LGUI_T(JP_MHEN),LT(_LOWER,KC_ENT),KC_BSPC, KC_VOLD, KC_DEL,LT(_RAISE,KC_SPC),ALT_T(JP_HENK),KC_LEFT, KC_DOWN, KC_RGHT
  //|--------------------------------------------------------------|        |--------------------------------------------------------------'
  ),
  [_LOWER] = LAYOUT_rotary_layer(
  //,--------------------------------------------------------------|        |--------------------------------------------------------------.
      _______, _______, JP_EXLM, JP_QUES, JP_LBRC, JP_RBRC, JP_TILD,             KC_6,    KC_7,    KC_8,    KC_9, JP_ASTR, JP_SLSH, KC_BSPC,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               JP_QUOT, JP_HASH,  JP_DQT, JP_LPRN, JP_RPRN,   JP_AT, KC_WH_U, XXXXXXX,    KC_4,    KC_5,    KC_6, JP_MINS,  JP_EQL, _______,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               JP_CIRC, JP_PERC, JP_AMPR, JP_SCLN, JP_COLN, JP_PIPE, KC_BTN3,    KC_0,    KC_1,    KC_2,    KC_3, JP_PLUS, _______, _______,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               _______, _______,       JP_MHEN, MO(_LOWER), _______, KC_WH_D, _______, MO(_RAISE), JP_DOT,        _______, _______, _______
  //|--------------------------------------------------------------|        |--------------------------------------------------------------'
  ),

  [_RAISE] = LAYOUT_rotary_layer(
  //,--------------------------------------------------------------|        |--------------------------------------------------------------.
      _______, _______,    KC_1,    KC_2,    KC_3,    KC_4,    KC_5,             KC_6, XXXXXXX,   KC_UP, XXXXXXX, KC_PGUP,LALT(KC_PSCR),KC_PSCR,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
        LCTL_T(KC_F11),   KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5, KC_WH_L, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, _______,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               KC_LSFT,   KC_F6,   KC_F7,   KC_F8,   KC_F9,  KC_F10, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDN, _______, _______,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               _______, _______,          _______, _______, _______, KC_WH_R, _______, _______, JP_HENK,          _______, _______, _______
  //|--------------------------------------------------------------|        |--------------------------------------------------------------'
  ),

  [_ADJUST] = LAYOUT_rotary_layer(
  //,--------------------------------------------------------------|        |--------------------------------------------------------------.
        QK_BOOT,  KC_TAB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,LALT(KC_PSCR),KC_PSCR,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
              KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_TOG, RGB_MOD, RGB_SAD, RGB_SAI, XXXXXXX, XXXXXXX, _______,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
         SFT_T(KC_F12), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI, XXXXXXX, _______, _______,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               _______, _______,          _______, _______, _______,RGB_RMOD, _______, _______, _______,          _______, _______, _______
  //|--------------------------------------------------------------|        |--------------------------------------------------------------'
  )
};

//A description for expressing the layer position in LED mode.
layer_state_t layer_state_set_user(layer_state_t state) {
  state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
#ifdef RGBLIGHT_ENABLE
    switch (get_highest_layer(state)) {
    case _LOWER:
      rgblight_sethsv_at(HSV_BLUE, 0);
      break;
    case _RAISE:
      rgblight_sethsv_at(HSV_RED, 0);
      break;
    case _ADJUST:
      rgblight_sethsv_at(HSV_PURPLE, 0);
      break;
    default: //  for any other layers, or the default layer
      rgblight_sethsv_at( 0, 0, 0, 0);
      break;
    }
    rgblight_set_effect_range( 1, 14);
#endif
return state;
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    keypos_t key;
    if (clockwise) {
        key.row = 3;
        key.col = 0;
    } else {
        key.row = 1;
        key.col = 0;
    }
    action_exec(MAKE_KEYEVENT(key.row, key.col, true));
    action_exec(MAKE_KEYEVENT(key.row, key.col, false));
    return true;
}

M keyboards/gl516/n51gl/keymaps/via/keymap.c => keyboards/gl516/n51gl/keymaps/via/keymap.c +20 -25
@@ 18,48 18,48 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  [0] = LAYOUT_rotary_layer(
  [0] = LAYOUT(
  //,--------------------------------------------------------------|        |--------------------------------------------------------------.
       KC_ESC,  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_BSPC,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
         LT(1,KC_CAPS),    KC_A,    KC_S,    KC_D,    KC_F,    KC_G, KC_VOLU,    KC_H,    KC_J,    KC_K,    KC_L, KC_SCLN, KC_QUOT,  KC_ENT,
         LT(1,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_LSFT,    KC_Z,    KC_X,    KC_C,    KC_V,    KC_B, KC_MUTE,    KC_N,    KC_M, KC_COMM,  KC_DOT, KC_SLSH,   KC_UP, KC_RSFT,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
              KC_LCTL, KC_LGUI,          KC_LALT,  KC_SPC,  KC_SPC, KC_VOLD,  KC_SPC,  KC_SPC, KC_LALT,          KC_LEFT, KC_DOWN, KC_RGHT
              KC_LCTL, KC_LGUI,          KC_LALT,  KC_SPC,  KC_SPC,              KC_SPC,  KC_SPC, KC_LALT,          KC_LEFT, KC_DOWN, KC_RGHT
  //|--------------------------------------------------------------|        |--------------------------------------------------------------'
  ),
  [1] = LAYOUT_rotary_layer(
  [1] = LAYOUT(
  //,--------------------------------------------------------------|        |--------------------------------------------------------------.
      _______,   QK_BOOT,   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_1,    KC_2,    KC_3,    KC_4,    KC_5, _______,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0, _______, _______, 
               _______,    KC_1,    KC_2,    KC_3,    KC_4,    KC_5,              KC_6,    KC_7,    KC_8,    KC_9,    KC_0, _______, _______,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               _______, _______,          _______, _______, _______, _______, _______, _______, _______,          _______, _______, _______
               _______, _______,          _______, _______, _______,              _______, _______, _______,          _______, _______, _______
  //|--------------------------------------------------------------|        |--------------------------------------------------------------'
  ),
  [2] = LAYOUT_rotary_layer(
  [2] = LAYOUT(
  //,--------------------------------------------------------------|        |--------------------------------------------------------------.
      XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
               XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX
               XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX
  //|--------------------------------------------------------------|        |--------------------------------------------------------------'
  ),
  [3] = LAYOUT_rotary_layer(
  [3] = LAYOUT(
  //,--------------------------------------------------------------|        |--------------------------------------------------------------.
      XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
               XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  //|--------+--------+--------+--------+--------+--------+--------|        |--------+--------+--------+--------+--------+--------+--------|
               XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX
               XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX,          XXXXXXX, XXXXXXX, XXXXXXX
  //|--------------------------------------------------------------|        |--------------------------------------------------------------'
  )
};


@@ 87,16 87,11 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state;
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    keypos_t key;
    if (clockwise) {
        key.row = 3;
        key.col = 0;
    } else {
        key.row = 1;
        key.col = 0;
    }
    action_exec(MAKE_KEYEVENT(key.row, key.col, true));
    action_exec(MAKE_KEYEVENT(key.row, key.col, false));
    return true;
}
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/gl516/n51gl/keymaps/via/rules.mk => keyboards/gl516/n51gl/keymaps/via/rules.mk +2 -1
@@ 1,1 1,2 @@
VIA_ENABLE = yes
\ No newline at end of file
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/jones/v1/info.json => keyboards/jones/v1/info.json +1 -7
@@ 107,13 107,7 @@
        {"label": "k93", "matrix": [9, 3], "x": 11, "y": 4, "w": 1.25},
        {"label": "k47", "matrix": [4, 7], "x": 12.25, "y": 4, "w": 1.25},
        {"label": "k91", "matrix": [9, 1], "x": 13.5, "y": 4},
        {"label": "k41", "matrix": [4, 1], "x": 14.5, "y": 4},

        {"label": "k85", "matrix": [8, 5], "x": 0, "y": 5},
        {"label": "k86", "matrix": [8, 6], "x": 1, "y": 5},

        {"label": "k95", "matrix": [9, 5], "x": 14, "y": 5},
        {"label": "k96", "matrix": [9, 6], "x": 15, "y": 5}
        {"label": "k41", "matrix": [4, 1], "x": 14.5, "y": 4}
      ]
    }
  }

M keyboards/jones/v1/keymaps/default/keymap.c => keyboards/jones/v1/keymaps/default/keymap.c +4 -8
@@ 34,31 34,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
           KC_TAB,     KC_Q,     KC_W,     KC_E,     KC_R,     KC_T,     KC_LBRC,  KC_RBRC,  KC_Y,     KC_U,     KC_I,     KC_O,     KC_P,       KC_BSPC,
           KC_LCTL,    KC_A,     KC_S,     KC_D,     KC_F,     KC_G,     KC_SCLN,  KC_QUOT,  KC_H,     KC_J,     KC_K,     KC_L,     KC_SCLN,    KC_ENT,
        KC_LSFT,  KC_LSFT,  KC_Z,     KC_X,     KC_C,     KC_V,     KC_B,     KC_LEFT,  KC_RGHT,  KC_N,     KC_M,     KC_COMM,  KC_DOT,   KC_UP,    KC_SLSH,
        KC_MUTE,  KC_LNG2, KC_LGUI,     KC_LALT,       SP_LOW,        SP_RAI,   KC_BSPC,     SP_RAI,KC_RALT,      KC_RALT,     KC_LEFT,  KC_DOWN,  KC_RGHT,
        KC_VOLD,  KC_VOLU,                                                                                                                KC_VOLD,  KC_VOLU
        KC_MUTE,  KC_LNG2, KC_LGUI,     KC_LALT,       SP_LOW,        SP_RAI,   KC_BSPC,     SP_RAI,KC_RALT,      KC_RALT,     KC_LEFT,  KC_DOWN,  KC_RGHT
    ),
    [_LOWER] = LAYOUT(
        _______,  KC_F1,    KC_F2,    KC_F3,    KC_F4,    KC_F5,    KC_F6,    _______,  KC_F6,    KC_F7,    KC_F8,    KC_F9,    KC_F10,   KC_F11,   KC_F12,
            KC_ESC,     KC_EXLM,  KC_AT,    KC_HASH,  KC_DLR,   KC_PERC,  _______,  _______,  KC_CIRC,  KC_AMPR,  KC_ASTR,  KC_LPRN,  KC_RPRN,  KC_INS,
            _______,    _______,  _______,  _______,  _______,  _______,  _______,  _______,  KC_GRV,   KC_MINS,  KC_EQL,   KC_LBRC,  KC_RBRC,  KC_BSLS,
        _______,  _______,  KC_MUTE,  KC_VOLD,  KC_VOLU,  _______,  _______,  _______,  _______,  KC_TILD,  KC_UNDS,  KC_PLUS,  KC_LCBR,  KC_RCBR,  KC_PIPE,
        _______,  _______,  _______,     _______,        _______,      _______,  _______,     SP_ADJ,_______,      _______,     _______,  _______,  _______,
        _______,  _______,                                                                                                                _______,  _______
        _______,  _______,  _______,     _______,        _______,      _______,  _______,     SP_ADJ,_______,      _______,     _______,  _______,  _______
    ),
    [_RAISE] = LAYOUT(
        KC_GRV,   KC_F1,    KC_F2,    KC_F3,    KC_F4,    KC_F5,    KC_F6,    _______,  KC_F6,    KC_F7,    KC_F8,    KC_F9,    KC_F10,   KC_F11,   KC_F12,
            KC_ESC,     KC_1,     KC_2,     KC_3,     KC_4,     KC_5,     _______,  _______,  KC_6,     KC_7,     KC_8,     KC_9,     KC_0,     KC_DEL,
            _______,    KC_F1,    KC_F2,    KC_F3,    KC_F4,    KC_F5,    _______,  _______,  KC_LEFT,  KC_DOWN,  KC_UP,    KC_RGHT,  KC_SCLN,  KC_QUOT,
        _______,  _______,  KC_F6,    KC_F7,    KC_F8,    KC_F9,    KC_F10,   _______,  _______,  KC_HOME,  KC_PGDN,  KC_PGUP,  KC_END,   KC_F11,   KC_F12,
        _______,  _______,  _______,     _______,        SP_ADJ,       _______,  _______,      _______,_______,     _______,    _______,  KC_DOWN,  KC_UP,
        _______,  _______,                                                                                                                _______,  _______
        _______,  _______,  _______,     _______,        SP_ADJ,       _______,  _______,      _______,_______,     _______,    _______,  KC_DOWN,  KC_UP
    ),
    [_ADJUST] = LAYOUT(
        _______,   RGB_HUI,  RGB_SAI,  RGB_VAI,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  KC_PSCR,  KC_SCRL,  KC_PAUS,
            _______,    _______,  _______,  _______,  _______,  _______,  _______,  _______,  RGB_HUI,  RGB_SAI,  RGB_VAI,  _______,  RGB_RMOD,  _______,
            _______,    AU_TOGG,  CK_TOGG,  MU_TOGG,  MU_NEXT,  _______,  _______,  _______,  RGB_HUD,  RGB_SAD,  RGB_VAD,  RGB_TOG,  RGB_MOD,   _______,
        KC_CAPS,  KC_CAPS,  CK_RST,   CK_DOWN,  CK_UP,    AU_PREV,  AU_NEXT,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,
        _______,  _______,  _______,     _______,        _______,      _______,  _______,      _______,_______,     _______,    _______,  _______,  _______,
        _______,  _______,                                                                                                                _______,  _______
        _______,  _______,  _______,     _______,        _______,      _______,  _______,      _______,_______,     _______,    _______,  _______,  _______
    )
};

D keyboards/jones/v1/keymaps/via/config.h => keyboards/jones/v1/keymaps/via/config.h +0 -31
@@ 1,31 0,0 @@
/*
Copyright 2021 Takeshi Nishio

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

//------------------------------------------------------------------------------
// Rotary Encoder
//------------------------------------------------------------------------------
// Encoder triggers specific key matrix position,
// when turn knob clockwise or counterclockwise.
// This is handy to assign key codes by VIA.

// Mappings of encoder rotation to key position in key matrix.
// First encoder,  Left side  : k85, k86
// Second encoder, Right side : k95, k96
#define ENCODERS_CW_KEY  { { 6, 8 }, { 6, 9 } }
#define ENCODERS_CCW_KEY { { 5, 8 }, { 5, 9 } }

M keyboards/jones/v1/keymaps/via/keymap.c => keyboards/jones/v1/keymaps/via/keymap.c +15 -55
@@ 37,48 37,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
           KC_TAB,     JP_Q,     JP_W,     JP_E,     JP_R,     JP_T,     JP_AT,    JP_LBRC,  JP_Y,     JP_U,     JP_I,     JP_O,     JP_P,       KC_BSPC,
           KC_LCTL,    JP_A,     JP_S,     JP_D,     JP_F,     JP_G,     JP_COLN,  JP_RBRC,  JP_H,     JP_J,     JP_K,     JP_L,     JP_SCLN,    KC_ENT,
        KC_LSFT,  KC_LSFT,  JP_Z,     JP_X,     JP_C,     JP_V,     JP_B,     JP_SLSH,  JP_BSLS,  JP_N,     JP_M,     JP_COMM,  JP_DOT,   KC_DOWN,  KC_UP,
        KC_MUTE,  KC_LGUI,  KC_LALT,     JP_MHEN,       SP_LOW,        SP_RAI,   KC_BSPC,     SP_RAI,SP_RAI,       JP_HENK,     JP_KANA,  KC_LEFT,  KC_RGHT,
        KC_VOLD,  KC_VOLU,                                                                                                                KC_VOLD,  KC_VOLU
        KC_MUTE,  KC_LGUI,  KC_LALT,     JP_MHEN,       SP_LOW,        SP_RAI,   KC_BSPC,     SP_RAI,SP_RAI,       JP_HENK,     JP_KANA,  KC_LEFT,  KC_RGHT
    ),
    [_BASE2] = LAYOUT(
        _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  KC_PSLS,  KC_PAST,  KC_PMNS,  _______,  _______,
           _______,     _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  KC_P7,    KC_P8,    KC_P9,    KC_PPLS,   _______,
           _______,     _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  KC_P4,    KC_P5,    KC_P6,    KC_PPLS,   _______,
        _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  KC_P1,    KC_P2,    KC_P3,    _______,  _______,
        _______,  _______,  _______,     _______,        _______,      _______,  _______,      _______,_______,    KC_P0,       KC_PDOT,  _______,  _______,
        _______,  _______,                                                                                                                _______,  _______
        _______,  _______,  _______,     _______,        _______,      _______,  _______,      _______,_______,    KC_P0,       KC_PDOT,  _______,  _______
    ),
    [_BASE3] = LAYOUT(
        _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,
           _______,     _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,   _______,
           _______,     _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,   _______,
        _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,
        _______,  _______,  _______,     _______,        _______,      _______,  _______,      _______,_______,     _______,    _______,  _______,  _______,
        _______,  _______,                                                                                                                _______,  _______
        _______,  _______,  _______,     _______,        _______,      _______,  _______,      _______,_______,     _______,    _______,  _______,  _______
    ),
    [_LOWER] = LAYOUT(
        _______,  KC_F1,    KC_F2,    KC_F3,    KC_F4,    KC_F5,    _______,  _______,  KC_F6,    KC_F7,    KC_F8,    KC_F9,    KC_F10,   KC_F11,   KC_F12,
            _______,    JP_EXLM,  JP_DQUO,  JP_HASH,  JP_DLR,   JP_PERC,  JP_TILD,  JP_PIPE,  JP_AMPR,  JP_QUOT,  JP_LPRN,  JP_RPRN,  JP_EQL,   KC_INS,
            _______,    _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,
        _______,  _______,  KC_MUTE,  KC_VOLD,  KC_VOLU,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,
        _______,  _______,  _______,     _______,        _______,      SP_ADJ,   _______,     SP_ADJ,SP_ADJ,       _______,     _______,  _______,  _______,
        _______,  _______,                                                                                                                _______,  _______
        _______,  _______,  _______,     _______,        _______,      SP_ADJ,   _______,     SP_ADJ,SP_ADJ,       _______,     _______,  _______,  _______
    ),
    [_RAISE] = 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,
            KC_ESC,     JP_1,     JP_2,     JP_3,     JP_4,     JP_5,     JP_CIRC,  JP_YEN,   JP_6,     JP_7,     JP_8,     JP_9,     JP_0,     KC_DEL,
            _______,    KC_F1,    KC_F2,    KC_F3,    KC_F4,    KC_F5,    _______,  _______,  KC_LEFT,  KC_DOWN,  KC_UP,    KC_RGHT,  _______,  _______,
        _______,  _______,  KC_F6,    KC_F7,    KC_F8,    KC_F9,    KC_F10,   KC_F11,   KC_F12,   KC_HOME,  KC_PGDN,  KC_PGUP,  KC_END,   _______,  _______,
        _______,  _______,  _______,     _______,        SP_ADJ,       _______,  _______,      _______,_______,     _______,    _______,  KC_DOWN,  KC_UP,
        _______,  _______,                                                                                                                _______,  _______
        _______,  _______,  _______,     _______,        SP_ADJ,       _______,  _______,      _______,_______,     _______,    _______,  KC_DOWN,  KC_UP
    ),
    [_ADJUST] = LAYOUT(
        _______,   _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  KC_PSCR,  KC_SCRL,  KC_PAUS,
            _______,    DF(_BASE1),DF(_BASE2),DF(_BASE3),_______,  _______,  _______,  _______,  RGB_HUI,  RGB_SAI,  RGB_VAI,  _______,  RGB_RMOD,  _______,
            _______,    AU_TOGG,   CK_TOGG,  MU_TOGG,   MU_NEXT,   _______,  _______,  _______,  RGB_HUD,  RGB_SAD,  RGB_VAD,  RGB_TOG,  RGB_MOD,   _______,
        KC_CAPS,  KC_CAPS,  CK_RST,   CK_DOWN,  CK_UP,    _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,  _______,
        _______,  _______,  _______,     _______,        _______,      _______,  _______,      _______,_______,     _______,    _______,  _______,  _______,
        _______,  _______,                                                                                                                _______,  _______
        _______,  _______,  _______,     _______,        _______,      _______,  _______,      _______,_______,     _______,    _______,  _______,  _______
    ),
};



@@ 164,50 158,16 @@ bool led_update_user(led_t led_state) {
}
#endif


//------------------------------------------------------------------------------
// Rotary Encoder
//------------------------------------------------------------------------------
static uint8_t  encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS]    = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS]   = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
    return true;
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
    [4] = { ENCODER_CCW_CW(_______, _______) },
    [5] = { ENCODER_CCW_CW(_______, _______) },
};

#endif

//------------------------------------------------------------------------------
// Keyboard Initialization

M keyboards/jones/v1/keymaps/via/rules.mk => keyboards/jones/v1/keymaps/via/rules.mk +1 -1
@@ 1,2 1,2 @@
# Use VIA
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/kabedon/kabedon98e/config.h => keyboards/kabedon/kabedon98e/config.h +0 -3
@@ 36,7 36,4 @@
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE

#define ENCODERS_CW_KEY  { { 0, 0 },{ 2, 0 } }
#define ENCODERS_CCW_KEY { { 6, 0 },{ 8, 0 } }

#define DYNAMIC_KEYMAP_LAYER_COUNT 3

M keyboards/kabedon/kabedon98e/info.json => keyboards/kabedon/kabedon98e/info.json +0 -4
@@ 53,13 53,9 @@
                {"matrix": [1, 7], "x": 14, "y": 0.5},

                {"matrix": [5, 7], "x": 15.5, "y": 0.5},
                {"matrix": [0, 0], "x": 16.9, "y": 0, "w": 0.6, "h": 0.5},
                {"matrix": [4, 8], "x": 17, "y": 0.5},
                {"matrix": [2, 0], "x": 17.5, "y": 0, "w": 0.6, "h": 0.5},
                {"matrix": [6, 0], "x": 18.4, "y": 0, "w": 0.6, "h": 0.5},

                {"matrix": [4, 0], "x": 18.5, "y": 0.5},
                {"matrix": [8, 0], "x": 19, "y": 0, "w": 0.6, "h": 0.5},

                {"matrix": [3, 0], "x": 0, "y": 1.75},
                {"matrix": [2, 1], "x": 1, "y": 1.75},

D keyboards/kabedon/kabedon98e/kabedon98e.c => keyboards/kabedon/kabedon98e/kabedon98e.c +0 -57
@@ 1,57 0,0 @@
/* Copyright 2021 KDon<370490639@qq.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 "quantum.h"

static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) { return false; }
    encoder_action_register(index, clockwise);
    return true;
};

M keyboards/kabedon/kabedon98e/keymaps/default/keymap.c => keyboards/kabedon/kabedon98e/keymaps/default/keymap.c +9 -11
@@ 45,7 45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
                                                     └──┘└──┘└──┘
 */
[_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_DEL,  KC_HOME, KC_INS,  KC_END,  KC_PGUP, KC_MUTE, KC_PGDN,
    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_DEL,  KC_INS,  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_NUM,  KC_PSLS, KC_PAST, KC_PMNS,
    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_P7,   KC_P8,   KC_P9,
    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_P4,   KC_P5,   KC_P6,   KC_PPLS,


@@ 53,19 53,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KC_LCTL, KC_LGUI, KC_LALT, MO(1),                     KC_SPC,                             KC_RALT, KC_RCTL,     KC_LEFT, KC_DOWN, KC_RGHT,      KC_P0,   KC_PDOT, KC_PENT),

[_FN] = LAYOUT(
    KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS,     RGB_VAI,      KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                            RGB_TOG, RGB_MOD,     RGB_HUI, RGB_VAD, RGB_HUD,      KC_TRNS, KC_TRNS, KC_TRNS),

[_FN1] = LAYOUT(
    KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS,     KC_TRNS,      KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                            KC_TRNS, KC_TRNS,     KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS, KC_TRNS, KC_TRNS)
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                            RGB_TOG, RGB_MOD,     RGB_HUI, RGB_VAD, RGB_HUD,      KC_TRNS, KC_TRNS, KC_TRNS)
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =   { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU)  },
    [1] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
};
#endif

A keyboards/kabedon/kabedon98e/keymaps/default/rules.mk => keyboards/kabedon/kabedon98e/keymaps/default/rules.mk +1 -0
@@ 0,0 1,1 @@
ENCODER_MAP_ENABLE = yes

M keyboards/kabedon/kabedon98e/keymaps/via/keymap.c => keyboards/kabedon/kabedon98e/keymaps/via/keymap.c +11 -3
@@ 45,7 45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
                                                     └──┘└──┘└──┘
 */
[_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_DEL,  KC_HOME, KC_INS,  KC_END,  KC_PGUP, KC_MUTE, KC_PGDN,
    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_DEL,  KC_INS,  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_NUM,  KC_PSLS, KC_PAST, KC_PMNS,
    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_P7,   KC_P8,   KC_P9,
    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_P4,   KC_P5,   KC_P6,   KC_PPLS,


@@ 53,7 53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KC_LCTL, KC_LGUI, KC_LALT, MO(1),                     KC_SPC,                             KC_RALT, KC_RCTL,     KC_LEFT, KC_DOWN, KC_RGHT,      KC_P0,   KC_PDOT, KC_PENT),

[_FN] = LAYOUT(
    KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,


@@ 61,7 61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                            RGB_TOG, RGB_MOD,     RGB_HUI, RGB_VAD, RGB_HUD,      KC_TRNS, KC_TRNS, KC_TRNS),

[_FN1] = LAYOUT(
    KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,


@@ 69,3 69,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                            KC_TRNS, KC_TRNS,     KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS, KC_TRNS, KC_TRNS)

};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =   { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU)  },
    [1] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [2] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
};
#endif

M keyboards/kabedon/kabedon98e/keymaps/via/rules.mk => keyboards/kabedon/kabedon98e/keymaps/via/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/keebio/bamfk1/config.h => keyboards/keebio/bamfk1/config.h +1 -3
@@ 8,9 8,7 @@
#    define STARTUP_SONG SONG(STARTUP_SOUND)
#endif

#define ENCODERS_CW_KEY  { { 1, 1 }, { 3, 1 } }
#define ENCODERS_CCW_KEY { { 0, 1 }, { 2, 1 } }

#    define RGBLED_NUM 16
#    define RGBLIGHT_HUE_STEP 8
#    define RGBLIGHT_SAT_STEP 8
#    define RGBLIGHT_VAL_STEP 8

M keyboards/keebio/bamfk1/info.json => keyboards/keebio/bamfk1/info.json +2 -8
@@ 25,8 25,7 @@
    "bootloader": "atmel-dfu",
    "matrix_pins": {
        "direct": [
            ["E6", "B6", "D6", null],
            [null, null, null, null]
            ["E6", "B6", "D6"]
        ]
    },
    "layouts": {


@@ 34,12 33,7 @@
            "layout": [
                {"x": 1.5, "y": 0, "h": 2, "w": 2, "matrix": [0, 0]},
                {"x": 0.5, "y": 2.25, "matrix": [0, 1]},
                {"x": 3.5, "y": 2.25, "matrix": [0, 2]},

                {"x": 0, "y": 3.5, "matrix": [1, 0]},
                {"x": 1, "y": 3.5, "matrix": [1, 1]},
                {"x": 3, "y": 3.5, "matrix": [1, 2]},
                {"x": 4, "y": 3.5, "matrix": [1, 3]}
                {"x": 3.5, "y": 2.25, "matrix": [0, 2]}
            ]
        }
    }

M keyboards/keebio/bamfk1/keymaps/default/keymap.c => keyboards/keebio/bamfk1/keymaps/default/keymap.c +14 -13
@@ 13,27 13,28 @@ enum layer_names {

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [_MAIN] = LAYOUT(
        KC_A,               // Big Switch
        MO(1),   KC_MUTE,   // Encoder presses
        KC_DOWN, KC_UP,     // Left encoder turns
        KC_VOLD, KC_VOLU     // Right encoder turns
        RGB_MOD,            // Big Switch
        TL_LOWR, KC_MUTE    // Encoder presses
    ),
    [_FN1] = LAYOUT(
        KC_B,               // Big Switch
        _______, KC_C,      // Encoder presses
        KC_PGDN, KC_PGUP,   // Left encoder turns
        KC_VOLU, KC_VOLD    // Right encoder turns
        _______, KC_C       // Encoder presses
    ),
    [_FN2] = LAYOUT(
        _______,            // Big Switch
        _______, _______,   // Encoder presses
        _______, _______,   // Left encoder turns
        _______, _______    // Right encoder turns
        _______, _______    // Encoder presses
    ),
    [_FN3] = LAYOUT(
        _______,            // Big Switch
        _______, _______,   // Encoder presses
        _______, _______,   // Left encoder turns
        _______, _______    // Right encoder turns
        _______, _______    // Encoder presses
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =   { ENCODER_CCW_CW(KC_DOWN, KC_UP), ENCODER_CCW_CW(KC_VOLD, KC_VOLU)  },
    [1] =   { ENCODER_CCW_CW(KC_PGDN, KC_PGUP), ENCODER_CCW_CW(_______, _______)  },
    [2] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [3] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  }
};
#endif

A keyboards/keebio/bamfk1/keymaps/default/rules.mk => keyboards/keebio/bamfk1/keymaps/default/rules.mk +1 -0
@@ 0,0 1,1 @@
ENCODER_MAP_ENABLE = yes

M keyboards/keebio/bamfk1/keymaps/via/keymap.c => keyboards/keebio/bamfk1/keymaps/via/keymap.c +13 -12
@@ 14,26 14,27 @@ enum layer_names {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [_MAIN] = LAYOUT(
        RGB_MOD,            // Big Switch
        TL_LOWR, KC_MUTE,   // Encoder presses
        KC_DOWN, KC_UP,     // Left encoder turns
        KC_VOLD, KC_VOLU    // Right encoder turns
        TL_LOWR, KC_MUTE    // Encoder presses
    ),
    [_FN1] = LAYOUT(
        KC_B,               // Big Switch
        _______, KC_C,      // Encoder presses
        KC_PGDN, KC_PGUP,   // Left encoder turns
        KC_VOLU, KC_VOLD    // Right encoder turns
        _______, KC_C       // Encoder presses
    ),
    [_FN2] = LAYOUT(
        _______,            // Big Switch
        _______, _______,   // Encoder presses
        _______, _______,   // Left encoder turns
        _______, _______    // Right encoder turns
        _______, _______    // Encoder presses
    ),
    [_FN3] = LAYOUT(
        _______,            // Big Switch
        _______, _______,   // Encoder presses
        _______, _______,   // Left encoder turns
        _______, _______    // Right encoder turns
        _______, _______    // Encoder presses
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =   { ENCODER_CCW_CW(KC_DOWN, KC_UP), ENCODER_CCW_CW(KC_VOLD, KC_VOLU)  },
    [1] =   { ENCODER_CCW_CW(KC_PGDN, KC_PGUP), ENCODER_CCW_CW(_______, _______)  },
    [2] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [3] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  }
};
#endif

M keyboards/keebio/bamfk1/keymaps/via/rules.mk => keyboards/keebio/bamfk1/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/keebio/bamfk1/rules.mk => keyboards/keebio/bamfk1/rules.mk +0 -2
@@ 12,5 12,3 @@ RGBLIGHT_ENABLE = yes       # Enable keyboard RGB underglow
AUDIO_ENABLE = yes          # Audio output
ENCODER_ENABLE = yes
LTO_ENABLE = yes

SRC += encoder_actions.c

D keyboards/keebio/encoder_actions.c => keyboards/keebio/encoder_actions.c +0 -63
@@ 1,63 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 * Copyright 2021 drashna jael're (@drashna)
 *
 * 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 3 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 "encoder_actions.h"

#if defined(ENCODER_ENABLE)
static uint8_t  encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS]    = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS]   = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
    // don't return user actions, because they are in the keymap
    // encoder_update_user(index, clockwise);
    return true;
};

#endif

D keyboards/keebio/encoder_actions.h => keyboards/keebio/encoder_actions.h +0 -23
@@ 1,23 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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

#include "quantum.h"

void encoder_action_unregister(void);

void encoder_action_register(uint8_t index, bool clockwise);

M keyboards/meletrix/zoom65/info.json => keyboards/meletrix/zoom65/info.json +0 -2
@@ 43,9 43,7 @@
                {"matrix": [0, 12], "x": 12, "y": 0},
                {"matrix": [0, 13], "x": 13, "y": 0},
                {"matrix": [2, 13], "x": 14, "y": 0},
                {"matrix": [4, 3], "x": 15, "y": 0, "w": 0.5},
                {"matrix": [0, 14], "x": 15.5, "y": 0},
                {"matrix": [4, 5], "x": 16.5, "y": 0, "w": 0.5},

                {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
                {"matrix": [1, 1], "x": 1.5, "y": 1},

M keyboards/meletrix/zoom65/keymaps/default/keymap.c => keyboards/meletrix/zoom65/keymaps/default/keymap.c +2 -2
@@ 18,14 18,14 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        KC_ESC,  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_BSPC,   KC_VOLD, KC_MUTE, KC_VOLU,
        KC_ESC,  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_BSPC, KC_MUTE,
        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_DEL,
        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_PGUP,
        KC_LSFT, 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_SPC,  KC_SPC,           KC_RALT, MO(1),            KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_all(
        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,  _______, _______,   KC_MPRV, KC_MPLY, KC_MNXT,
        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,  _______, _______, KC_MPLY,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT,

M keyboards/meletrix/zoom65/keymaps/via/keymap.c => keyboards/meletrix/zoom65/keymaps/via/keymap.c +13 -4
@@ 18,31 18,40 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        KC_ESC,  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_BSPC,   KC_VOLD, KC_MUTE, KC_VOLU,
        KC_ESC,  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_BSPC, KC_MUTE,
        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_DEL,
        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_PGUP,
        KC_LSFT, 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_SPC,  KC_SPC,           KC_RALT, MO(1),            KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_all(
        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,  _______, _______,   KC_MPRV, KC_MPLY, KC_MNXT,
        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,  _______, _______, KC_MPLY,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT,
        _______, _______, _______,                   _______, _______, _______,          _______, _______,          _______, _______, _______
    ),
    [2] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,   _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,                   _______, _______, _______,          _______, _______,          _______, _______, _______
    ),
    [3] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,   _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,                   _______, _______, _______,          _______, _______,          _______, _______, _______
    ),
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(KC_MPRV, KC_MNXT) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/meletrix/zoom65/keymaps/via/rules.mk => keyboards/meletrix/zoom65/keymaps/via/rules.mk +2 -1
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

D keyboards/meletrix/zoom65/zoom65.c => keyboards/meletrix/zoom65/zoom65.c +0 -64
@@ 1,64 0,0 @@
/* Copyright 2021 meletrix
 *
 * 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 "quantum.h"

#ifdef VIA_ENABLE
static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;

void encoder_action_unregister(void)
{
    for (int index = 0; index < NUM_ENCODERS; ++index)
    {
        if (encoder_state[index])
        {
            keyevent_t encoder_event = (keyevent_t){
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}
void encoder_action_register(uint8_t index, bool clockwise)
{
    keyevent_t encoder_event = (keyevent_t){
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_kb(void)
{
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise)
{
    encoder_action_register(index, clockwise);
    return true;
};
#endif

D keyboards/meletrix/zoom65_lite/config.h => keyboards/meletrix/zoom65_lite/config.h +0 -21
@@ 1,21 0,0 @@
/* Copyright 2021 meletrix
 *
 * 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

// Note:  array is { col, row )
#define ENCODERS_CW_KEY  { { 5, 4 } }
#define ENCODERS_CCW_KEY { { 3, 4 } }

M keyboards/meletrix/zoom65_lite/info.json => keyboards/meletrix/zoom65_lite/info.json +0 -2
@@ 43,9 43,7 @@
                {"matrix": [0, 12], "x": 12, "y": 0},
                {"matrix": [0, 13], "x": 13, "y": 0},
                {"matrix": [2, 13], "x": 14, "y": 0},
                {"matrix": [4, 3], "x": 15, "y": 0, "w": 0.5},
                {"matrix": [0, 14], "x": 15.5, "y": 0},
                {"matrix": [4, 5], "x": 16.5, "y": 0, "w": 0.5},

                {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
                {"matrix": [1, 1], "x": 1.5, "y": 1},

M keyboards/meletrix/zoom65_lite/keymaps/default/keymap.c => keyboards/meletrix/zoom65_lite/keymaps/default/keymap.c +2 -2
@@ 18,14 18,14 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        KC_ESC,  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_BSPC,   KC_VOLU, KC_MUTE, KC_VOLD,
        KC_ESC,  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_BSPC, KC_MUTE,
        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_DEL,
        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_PGUP,
        KC_LSFT, 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_SPC,  KC_SPC,           KC_RALT, MO(1),            KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_all(
        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,  _______, _______,   KC_MNXT, KC_MPLY, KC_MPRV,
        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,  _______, _______, KC_MPLY,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT,

M keyboards/meletrix/zoom65_lite/keymaps/via/keymap.c => keyboards/meletrix/zoom65_lite/keymaps/via/keymap.c +13 -49
@@ 16,78 16,42 @@

#include QMK_KEYBOARD_H

static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;

void encoder_action_unregister(void)
{
    for (int index = 0; index < NUM_ENCODERS; ++index)
    {
        if (encoder_state[index])
        {
            keyevent_t encoder_event = (keyevent_t){
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}
void encoder_action_register(uint8_t index, bool clockwise)
{
    keyevent_t encoder_event = (keyevent_t){
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_kb(void)
{
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise)
{
    encoder_action_register(index, clockwise);
    return true;
}

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        KC_ESC,  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_BSPC,   KC_VOLU, KC_MUTE, KC_VOLD,
        KC_ESC,  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_BSPC, KC_MUTE,
        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_DEL,
        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_PGUP,
        KC_LSFT, 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_SPC,  KC_SPC,           KC_RALT, MO(1),            KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_all(
        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,  _______, _______,   KC_MNXT, KC_MPLY, KC_MPRV,
        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,  _______, _______, KC_MPLY,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT,
        _______, _______, _______,                   _______, _______, _______,          _______, _______,          _______, _______, _______
    ),
    [2] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,   _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,                   _______, _______, _______,          _______, _______,          _______, _______, _______
    ),
    [3] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,   _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,                   _______, _______, _______,          _______, _______,          _______, _______, _______
    ),
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(KC_MPRV, KC_MNXT) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/meletrix/zoom65_lite/keymaps/via/rules.mk => keyboards/meletrix/zoom65_lite/keymaps/via/rules.mk +2 -1
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/ml/gas75/info.json => keyboards/ml/gas75/info.json +0 -2
@@ 49,9 49,7 @@

                {"matrix": [0, 13], "x": 14, "y": 0},

                {"matrix": [5, 4], "x": 15, "y": 0, "w": 0.5},
                {"matrix": [0, 14], "x": 15.5, "y": 0},
                {"matrix": [5, 3], "x": 16.5, "y": 0, "w": 0.5},

                {"matrix": [1, 0], "x": 0, "y": 1.25},
                {"matrix": [1, 1], "x": 1, "y": 1.25},

M keyboards/ml/gas75/keymaps/default/keymap.c => keyboards/ml/gas75/keymaps/default/keymap.c +7 -21
@@ 83,7 83,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
    /*  Row:    0        1        2        3      4      5      6       7      8      9        10       11       12       13                14              */
    [_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_DEL,  _______, KC_MUTE, _______,
                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_DEL,  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_HOME,
                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,


@@ 110,7 110,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
    /*  Row:    0        1        2        3        4        5        6        7        8        9        10       11       12       13                14              */
    [_FN]   = LAYOUT(
                QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______,
                QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG,
                _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          RGB_HUI,
                _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          RGB_HUD,
                _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,          _______,


@@ 158,25 158,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    return true;
}

#ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) {
        if (layer_state_is(_BASE)) {
            if (clockwise) {
                tap_code(KC_VOLU);
            } else {
                tap_code(KC_VOLD);
            }
        } else if (layer_state_is(_FN)) {
            if (clockwise) {
                rgb_matrix_step();
            } else {
                rgb_matrix_step_reverse();
            }
        }
	}
    return true;
}
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) },
};
#endif

bool rgb_matrix_indicators_user(void) {

M keyboards/ml/gas75/keymaps/via/keymap.c => keyboards/ml/gas75/keymaps/via/keymap.c +7 -41
@@ 83,7 83,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
    /*  Row:    0        1        2        3      4      5      6       7      8      9        10       11       12       13                14              */
    [_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_DEL,  KC_VOLD, KC_MUTE, KC_VOLU,
                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_DEL,  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_HOME,
                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,


@@ 110,7 110,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
    /*  Row:    0        1        2        3        4        5        6        7        8        9        10       11       12       13                 14              */
    [_FN]   = LAYOUT(
                QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_TOG, RGB_MOD,
                QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG,
                _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,           RGB_HUI,
                _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,           RGB_HUD,
                _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,           _______,


@@ 158,45 158,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    return true;
}

#ifdef ENCODER_ENABLE
static uint8_t  encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS]    = {{3, 5}};
static keypos_t encoder_ccw[NUM_ENCODERS]   = {{4, 5}};

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_user(void) {
    encoder_action_unregister();
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
	return false;
}
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) },
};
#endif

bool rgb_matrix_indicators_user(void) {

M keyboards/ml/gas75/keymaps/via/rules.mk => keyboards/ml/gas75/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/monarch/info.json => keyboards/monarch/info.json +1 -4
@@ 262,10 262,7 @@

                {"matrix": [4, 13], "x": 13.25, "y": 4.25},
                {"matrix": [4, 14], "x": 14.25, "y": 4.25},
                {"matrix": [4, 15], "x": 15.25, "y": 4.25},

                {"matrix": [5, 0], "x": 0, "y": 5},
                {"matrix": [5, 1], "x": 1, "y": 5}
                {"matrix": [4, 15], "x": 15.25, "y": 4.25}
            ]
        }
    }

M keyboards/monarch/keymaps/default/keymap.c => keyboards/monarch/keymaps/default/keymap.c +0 -9
@@ 33,12 33,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      _______, _______, _______,                                     BL_TOGG,                            _______,          BL_DOWN, BL_OFF,  BL_UP
  )
};

bool encoder_update_user(uint8_t index, bool clockwise) {
    if (clockwise) {
        tap_code(KC_VOLU);
    } else {
        tap_code(KC_VOLD);
    }
    return true;
}

M keyboards/monarch/keymaps/iso/keymap.c => keyboards/monarch/keymaps/iso/keymap.c +0 -9
@@ 33,12 33,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      _______, _______, _______,                                     BL_TOGG,                            _______,          BL_DOWN, BL_OFF,  BL_UP
  )
};

bool encoder_update_user(uint8_t index, bool clockwise) {
    if (clockwise) {
        tap_code(KC_VOLU);
    } else {
        tap_code(KC_VOLD);
    }
    return true;
}

M keyboards/monarch/keymaps/via/keymap.c => keyboards/monarch/keymaps/via/keymap.c +11 -46
@@ 23,70 23,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      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_NO,   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_LCTL, KC_LGUI, KC_LALT,                                     KC_SPC,                    MO(1),                     KC_LEFT, KC_DOWN, KC_RGHT,
      KC_VOLD, KC_VOLU
      KC_LCTL, KC_LGUI, KC_LALT,                                     KC_SPC,                    MO(1),                     KC_LEFT, KC_DOWN, KC_RGHT
  ),
  [1] = LAYOUT_all(
      QK_BOOT,   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_DEL,           _______,
      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,                   _______,
      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          BL_ON,
      _______, _______, _______,                                      BL_TOGG,                   _______,                  BL_DOWN, BL_OFF,  BL_UP,
      _______, _______
      _______, _______, _______,                                      BL_TOGG,                   _______,                  BL_DOWN, BL_OFF,  BL_UP
  ),
  [2] = LAYOUT_all(
      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,                   _______,
      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
      _______, _______, _______,                                     _______,                   _______,                   _______, _______, _______,
      _______, _______
      _______, _______, _______,                                     _______,                   _______,                   _______, _______, _______
  ),
  [3] = LAYOUT_all(
      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,                   _______,
      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
      _______, _______, _______,                                     _______,                   _______,                   _______, _______, _______,
      _______, _______
      _______, _______, _______,                                     _______,                   _______,                   _______, _______, _______
  )
};

keyevent_t encoder_ccw = {
    .key = (keypos_t){.row = 5, .col = 0},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder_cw = {
    .key = (keypos_t){.row = 5, .col = 1},
    .pressed = false,
    .type = KEY_EVENT
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};

void matrix_scan_user(void) {
    if (encoder_ccw.pressed) {
        encoder_ccw.pressed = false;
        encoder_ccw.time = timer_read();
        action_exec(encoder_ccw);
    }

    if (encoder_cw.pressed) {
        encoder_cw.pressed = false;
        encoder_cw.time = timer_read();
        action_exec(encoder_cw);
    }
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    if (clockwise) {
        encoder_cw.pressed = true;
        encoder_cw.time = timer_read();
        action_exec(encoder_cw);
    } else {
        encoder_ccw.pressed = true;
        encoder_ccw.time = timer_read();
        action_exec(encoder_ccw);
    }
    return true;
}
#endif

M keyboards/monarch/keymaps/via/rules.mk => keyboards/monarch/keymaps/via/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/mwstudio/alicekk/keymaps/via/keymap.c => keyboards/mwstudio/alicekk/keymaps/via/keymap.c +6 -39
@@ 51,44 51,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    ),
};


#ifdef ENCODER_ENABLE
static uint8_t  encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = {{6, 4}};
static keypos_t encoder_ccw[NUM_ENCODERS] = {{7, 4}};

void encoder_action_unregister(void) {
    for (uint8_t index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_user(void) {
    encoder_action_unregister();
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
    return false;
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/mwstudio/alicekk/keymaps/via/rules.mk => keyboards/mwstudio/alicekk/keymaps/via/rules.mk +1 -1
@@ 1,2 1,2 @@
VIA_ENABLE = yes
LTO_ENABLE = no
ENCODER_MAP_ENABLE = yes

M keyboards/mwstudio/mw65_rgb/info.json => keyboards/mwstudio/mw65_rgb/info.json +0 -3
@@ 43,10 43,7 @@
                {"matrix": [0, 11], "x": 11, "y": 0},
                {"matrix": [0, 12], "x": 12, "y": 0},
                {"matrix": [0, 13], "x": 13, "y": 0, "w": 2},

                {"matrix": [4, 4], "x": 15, "y": 0, "w": 0.5},
                {"matrix": [0, 14], "x": 15.5, "y": 0},
                {"matrix": [4, 3], "x": 16.5, "y": 0, "w": 0.5},

                {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
                {"matrix": [1, 1], "x": 1.5, "y": 1},

M keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c => keyboards/mwstudio/mw65_rgb/keymaps/default/keymap.c +2 -2
@@ 18,7 18,7 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

	[0] = LAYOUT(
        KC_ESC,  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_VOLD, KC_DEL,  KC_VOLU,
        KC_ESC,  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,   RGB_TOG,


@@ 26,7 26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  ),

	[1] = 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_HUI, _______,
        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_HUI,
        RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, RGB_SAI,
        _______,          _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAD,

M keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap.c => keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap.c +2 -2
@@ 48,7 48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
    /*  Row:    0        1        2        3        4        5     6         7     8     9        10       11       12       13       14     */
	[_BASE] = LAYOUT(
                KC_ESC,  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_VOLD, KC_HOME, KC_VOLU,
                KC_ESC,  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_HOME,
                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_END,
                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_PGUP,
                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_PGDN,


@@ 71,7 71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
    /*  Row:    0        1        2        3        4        5        6        7        8        9        10       11       12       13        14     */
	[_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,  KC_HOME,    _______, _______, _______,
                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,  KC_HOME,  _______,
                _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUSE, KC_INS,
                _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          KC_PSCR,  KC_DEL,
                _______,          _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,  _______,

M keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap_stuff.h => keyboards/mwstudio/mw65_rgb/keymaps/horrortroll/keymap_stuff.h +0 -13
@@ 273,19 273,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    return true;
}

#ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) {
  if (index == 0) {
    if (clockwise) {
        tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 3));
    } else {
        tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 4));
    }
  }
  return true;
}
#endif

bool rgb_matrix_indicators_user(void) {
    switch (biton32(layer_state)) {
        case _FN:

M keyboards/mwstudio/mw65_rgb/keymaps/thearesia/keymap.c => keyboards/mwstudio/mw65_rgb/keymaps/thearesia/keymap.c +2 -15
@@ 79,7 79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
    /*  Row:    0        1        2        3        4        5     6         7     8     9        10       11       12       13       14     */
	[_BASE] = LAYOUT(
                KC_ESC,  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_VOLD, KC_HOME, KC_VOLU,
                KC_ESC,  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_HOME,
                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_END,
                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_PGUP,
                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_PGDN,


@@ 101,7 101,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
    /*  Row:    0        1        2        3        4        5        6        7        8        9        10       11       12        13        14     */
	[_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,   KC_HOME,    _______, _______, _______,
                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,   KC_HOME,  _______,
                QK_BOOT, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_HUI, _______, _______, _______,  KC_PAUSE, KC_INS,
                _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, _______, _______,           KC_PSCR,  KC_DEL,
                _______,          _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______,  RGB_VAI,  RGB_TOG,


@@ 168,19 168,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    return true;
}

#ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) {
  if (index == 0) {
    if (clockwise) {
        tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 3));
    } else {
        tap_code(dynamic_keymap_get_keycode(biton32(layer_state), 4, 4));
    }
  }
  return true;
}
#endif

bool rgb_matrix_indicators_user(void) {
    HSV      hsv = rgb_matrix_config.hsv;
    uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1));

M keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c => keyboards/mwstudio/mw65_rgb/keymaps/via/keymap.c +11 -15
@@ 34,7 34,7 @@ enum custom_keycodes {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

	[0] = LAYOUT(
        KC_ESC,  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_VOLD, KC_DEL,  KC_VOLU,
        KC_ESC,  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,   RGB_TOG,


@@ 42,7 42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    ),

	[1] = 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_HUI, _______,
        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_HUI,
        RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          USER00,  RGB_SAI,
        _______,          _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, USER01,  RGB_VAI, RGB_SAD,


@@ 50,7 50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    ),

	[2] = LAYOUT(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,   _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______,
        _______,          _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,


@@ 58,7 58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    ),

	[3] = LAYOUT(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,   _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______,
        _______,          _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,


@@ 96,17 96,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  }
}

#ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) {
  if (index == 0) {
    if (clockwise) {
        tap_code(dynamic_keymap_get_keycode(get_highest_layer(layer_state), 4, 3));
    } else {
        tap_code(dynamic_keymap_get_keycode(get_highest_layer(layer_state), 4, 4));
    }
  }
  return true;
}
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {

M keyboards/mwstudio/mw65_rgb/keymaps/via/rules.mk => keyboards/mwstudio/mw65_rgb/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/mwstudio/mw75r2/keymaps/via/keymap.c => keyboards/mwstudio/mw75r2/keymaps/via/keymap.c +6 -39
@@ 104,48 104,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  }
}

#ifdef ENCODER_ENABLE
static uint8_t  encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = {{3, 5}};
static keypos_t encoder_ccw[NUM_ENCODERS] = {{4, 5}};

void encoder_action_unregister(void) {
    for (uint8_t index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_user(void) {
    encoder_action_unregister();
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
    return true;
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif


bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {

    if (user_config.top_rgb_change)

M keyboards/mwstudio/mw75r2/keymaps/via/rules.mk => keyboards/mwstudio/mw75r2/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

D keyboards/nightly_boards/adellein/adellein.c => keyboards/nightly_boards/adellein/adellein.c +0 -28
@@ 1,28 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 "adellein.h"

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
//    if (!encoder_update_user(index, clockwise)) return false;
    encoder_action_register(index, clockwise);
    return true;
};

D keyboards/nightly_boards/adellein/adellein.h => keyboards/nightly_boards/adellein/adellein.h +0 -20
@@ 1,20 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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

#include "quantum.h"
#include "encoder_action.h"

M keyboards/nightly_boards/adellein/config.h => keyboards/nightly_boards/adellein/config.h +0 -4
@@ 28,10 28,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE

/* Encoders */
#define ENCODERS_CW_KEY  { { 3, 3 } }
#define ENCODERS_CCW_KEY { { 1, 3 } }

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */

D keyboards/nightly_boards/adellein/encoder_action.c => keyboards/nightly_boards/adellein/encoder_action.c +0 -47
@@ 1,47 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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 "encoder_action.h"

static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

D keyboards/nightly_boards/adellein/encoder_action.h => keyboards/nightly_boards/adellein/encoder_action.h +0 -23
@@ 1,23 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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

#include "quantum.h"

void encoder_action_unregister(void);

void encoder_action_register(uint8_t index, bool clockwise);
\ No newline at end of file

M keyboards/nightly_boards/adellein/info.json => keyboards/nightly_boards/adellein/info.json +0 -60
@@ 83,66 83,6 @@
                {"matrix": [3, 9], "x": 10.75, "y": 3, "w": 1.25},
                {"matrix": [3, 12], "x": 14.75, "y": 3, "w": 1.25}
            ]
        },
        "LAYOUT_40ergo_split_ent_encoder": {
            "layout": [
                {"matrix": [0, 0], "x": 0.5, "y": 0},
                {"matrix": [0, 1], "x": 1.5, "y": 0},
                {"matrix": [0, 2], "x": 2.5, "y": 0},
                {"matrix": [0, 3], "x": 3.5, "y": 0},
                {"matrix": [0, 4], "x": 4.5, "y": 0},
                {"matrix": [0, 5], "x": 5.5, "y": 0},

                {"matrix": [0, 6], "x": 8.25, "y": 0},
                {"matrix": [0, 7], "x": 9.25, "y": 0},
                {"matrix": [0, 8], "x": 10.25, "y": 0},
                {"matrix": [0, 9], "x": 11.25, "y": 0},
                {"matrix": [0, 10], "x": 12.25, "y": 0},
                {"matrix": [0, 11], "x": 13.25, "y": 0},
                {"matrix": [0, 12], "x": 14.25, "y": 0, "w": 1.5},

                {"matrix": [1, 0], "x": 0.25, "y": 1, "w": 1.25},
                {"matrix": [1, 1], "x": 1.5, "y": 1},
                {"matrix": [1, 2], "x": 2.5, "y": 1},
                {"matrix": [1, 3], "x": 3.5, "y": 1},
                {"matrix": [1, 4], "x": 4.5, "y": 1},
                {"matrix": [1, 5], "x": 5.5, "y": 1},

                {"matrix": [1, 6], "x": 8.75, "y": 1},
                {"matrix": [1, 7], "x": 9.75, "y": 1},
                {"matrix": [1, 8], "x": 10.75, "y": 1},
                {"matrix": [1, 9], "x": 11.75, "y": 1},
                {"matrix": [1, 10], "x": 12.75, "y": 1},
                {"matrix": [1, 11], "x": 13.75, "y": 1},
                {"matrix": [1, 12], "x": 14.75, "y": 1, "w": 1.25},

                {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
                {"matrix": [2, 1], "x": 1.75, "y": 2},
                {"matrix": [2, 2], "x": 2.75, "y": 2},
                {"matrix": [2, 3], "x": 3.75, "y": 2},
                {"matrix": [2, 4], "x": 4.75, "y": 2},
                {"matrix": [2, 5], "x": 5.75, "y": 2},

                {"matrix": [2, 6], "x": 8.5, "y": 2},
                {"matrix": [2, 7], "x": 9.5, "y": 2},
                {"matrix": [2, 8], "x": 10.5, "y": 2},
                {"matrix": [2, 9], "x": 11.5, "y": 2},
                {"matrix": [2, 10], "x": 12.5, "y": 2},
                {"matrix": [2, 11], "x": 13.5, "y": 2},
                {"matrix": [2, 12], "x": 14.5, "y": 2, "w": 1.75},

                {"matrix": [3, 0], "x": 0.25, "y": 3, "w": 1.25},
                {"matrix": [3, 2], "x": 2.75, "y": 3, "w": 1.25},
                {"matrix": [3, 4], "x": 4, "y": 3, "w": 2.25},
                {"matrix": [3, 5], "x": 6.25, "y": 3},

                {"matrix": [3, 7], "x": 8, "y": 3, "w": 2.75},
                {"matrix": [3, 9], "x": 10.75, "y": 3, "w": 1.25},
                {"matrix": [3, 12], "x": 14.75, "y": 3, "w": 1.25},

                {"matrix": [3, 1], "x": 5.75, "y": 4},
                {"matrix": [3, 3], "x": 6.75, "y": 4}
            ]
        }
    }
}

M keyboards/nightly_boards/adellein/keymaps/via/keymap.c => keyboards/nightly_boards/adellein/keymaps/via/keymap.c +17 -13
@@ 15,35 15,39 @@
 */
#include QMK_KEYBOARD_H


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_40ergo_split_ent_encoder(
    [0] = LAYOUT_40ergo_split_ent(
         KC_ESC,    KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,                    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC, KC_BSPC,
         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_ENT,
         KC_LSFT,   KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,                    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT,
         KC_LCTL,            KC_LALT, KC_SPC,           KC_SPC,                  KC_SPC,           KC_RALT,                            KC_RCTL,
		                                           KC_VOLD, KC_VOLU
         KC_LCTL,            KC_LALT, KC_SPC,           KC_SPC,                  KC_SPC,           KC_RALT,                            KC_RCTL
    ),
    [1] = LAYOUT_40ergo_split_ent_encoder(
    [1] = LAYOUT_40ergo_split_ent(
         KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
         KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
         KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
         KC_TRNS,            KC_TRNS, KC_TRNS,          KC_TRNS,                 KC_TRNS,          KC_TRNS,                            KC_TRNS,
		                                           KC_TRNS, KC_TRNS
         KC_TRNS,            KC_TRNS, KC_TRNS,          KC_TRNS,                 KC_TRNS,          KC_TRNS,                            KC_TRNS
    ),
    [2] = LAYOUT_40ergo_split_ent_encoder(
    [2] = LAYOUT_40ergo_split_ent(
         KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
         KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
         KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
         KC_TRNS,            KC_TRNS, KC_TRNS,          KC_TRNS,                 KC_TRNS,          KC_TRNS,                            KC_TRNS,
		                                           KC_TRNS, KC_TRNS
         KC_TRNS,            KC_TRNS, KC_TRNS,          KC_TRNS,                 KC_TRNS,          KC_TRNS,                            KC_TRNS
    ),
    [3] = LAYOUT_40ergo_split_ent_encoder(
    [3] = LAYOUT_40ergo_split_ent(
         KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
         KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
         KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,                 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
         KC_TRNS,            KC_TRNS, KC_TRNS,          KC_TRNS,                 KC_TRNS,          KC_TRNS,                            KC_TRNS,
		                                           KC_TRNS, KC_TRNS
         KC_TRNS,            KC_TRNS, KC_TRNS,          KC_TRNS,                 KC_TRNS,          KC_TRNS,                            KC_TRNS
    ),

};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/nightly_boards/adellein/keymaps/via/rules.mk => keyboards/nightly_boards/adellein/keymaps/via/rules.mk +2 -1
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/nightly_boards/adellein/rules.mk => keyboards/nightly_boards/adellein/rules.mk +0 -3
@@ 11,6 11,3 @@ BACKLIGHT_ENABLE = no         # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes         # Enable keyboard RGB underglow
ENCODER_ENABLE = yes          # Enable Rotary Encoders
LTO_ENABLE = yes

# Added encoder Action
SRC += encoder_action.c
\ No newline at end of file

M keyboards/nightly_boards/n40_o/config.h => keyboards/nightly_boards/n40_o/config.h +0 -4
@@ 28,10 28,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE

/* Encoders */
#define ENCODERS_CW_KEY  { { 2, 4 },{ 4, 4 },{ 6, 4 } }
#define ENCODERS_CCW_KEY { { 1, 4 },{ 3, 4 },{ 5, 4 } }

/* Audio */

#define AUDIO_PIN B7

D keyboards/nightly_boards/n40_o/encoder_action.c => keyboards/nightly_boards/n40_o/encoder_action.c +0 -47
@@ 1,47 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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 "encoder_action.h"

static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

D keyboards/nightly_boards/n40_o/encoder_action.h => keyboards/nightly_boards/n40_o/encoder_action.h +0 -23
@@ 1,23 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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

#include "quantum.h"

void encoder_action_unregister(void);

void encoder_action_register(uint8_t index, bool clockwise);
\ No newline at end of file

M keyboards/nightly_boards/n40_o/info.json => keyboards/nightly_boards/n40_o/info.json +1 -66
@@ 10,7 10,7 @@
    },
    "matrix_pins": {
        "cols": ["B5", "C7", "D6", "D4", "B3", "B2", "B1", "B0", "D5", "D3", "D2", "D1", "D0"],
        "rows": ["E6", "F0", "F1", "D7", null]
        "rows": ["E6", "F0", "F1", "D7"]
    },
    "diode_direction": "COL2ROW",
    "encoder": {


@@ 29,71 29,6 @@
    "processor": "atmega32u4",
    "bootloader": "atmel-dfu",
    "layouts": {
        "LAYOUT_ortho_4x13_encoders": {
            "layout": [
                {"matrix": [4, 1], "x": 0, "y": 0},
                {"matrix": [4, 2], "x": 1, "y": 0},
                {"matrix": [0, 0], "x": 2.25, "y": 0},
                {"matrix": [0, 1], "x": 3.5, "y": 0},
                {"matrix": [0, 2], "x": 4.5, "y": 0},
                {"matrix": [0, 3], "x": 5.5, "y": 0},
                {"matrix": [0, 4], "x": 6.5, "y": 0},
                {"matrix": [0, 5], "x": 7.5, "y": 0},
                {"matrix": [0, 6], "x": 8.5, "y": 0},
                {"matrix": [0, 7], "x": 9.5, "y": 0},
                {"matrix": [0, 8], "x": 10.5, "y": 0},
                {"matrix": [0, 9], "x": 11.5, "y": 0},
                {"matrix": [0, 10], "x": 12.5, "y": 0},
                {"matrix": [0, 11], "x": 13.5, "y": 0},
                {"matrix": [0, 12], "x": 14.5, "y": 0},

                {"matrix": [4, 3], "x": 0, "y": 1},
                {"matrix": [4, 4], "x": 1, "y": 1},
                {"matrix": [1, 0], "x": 2.25, "y": 1},
                {"matrix": [1, 1], "x": 3.5, "y": 1},
                {"matrix": [1, 2], "x": 4.5, "y": 1},
                {"matrix": [1, 3], "x": 5.5, "y": 1},
                {"matrix": [1, 4], "x": 6.5, "y": 1},
                {"matrix": [1, 5], "x": 7.5, "y": 1},
                {"matrix": [1, 6], "x": 8.5, "y": 1},
                {"matrix": [1, 7], "x": 9.5, "y": 1},
                {"matrix": [1, 8], "x": 10.5, "y": 1},
                {"matrix": [1, 9], "x": 11.5, "y": 1},
                {"matrix": [1, 10], "x": 12.5, "y": 1},
                {"matrix": [1, 11], "x": 13.5, "y": 1},
                {"matrix": [1, 12], "x": 14.5, "y": 1},

                {"matrix": [4, 5], "x": 0, "y": 2},
                {"matrix": [4, 6], "x": 1, "y": 2},
                {"matrix": [2, 0], "x": 2.25, "y": 2},
                {"matrix": [2, 1], "x": 3.5, "y": 2},
                {"matrix": [2, 2], "x": 4.5, "y": 2},
                {"matrix": [2, 3], "x": 5.5, "y": 2},
                {"matrix": [2, 4], "x": 6.5, "y": 2},
                {"matrix": [2, 5], "x": 7.5, "y": 2},
                {"matrix": [2, 6], "x": 8.5, "y": 2},
                {"matrix": [2, 7], "x": 9.5, "y": 2},
                {"matrix": [2, 8], "x": 10.5, "y": 2},
                {"matrix": [2, 9], "x": 11.5, "y": 2},
                {"matrix": [2, 10], "x": 12.5, "y": 2},
                {"matrix": [2, 11], "x": 13.5, "y": 2},
                {"matrix": [2, 12], "x": 14.5, "y": 2},

                {"matrix": [3, 0], "x": 2.25, "y": 3},
                {"matrix": [3, 1], "x": 3.5, "y": 3},
                {"matrix": [3, 2], "x": 4.5, "y": 3},
                {"matrix": [3, 3], "x": 5.5, "y": 3},
                {"matrix": [3, 4], "x": 6.5, "y": 3},
                {"matrix": [3, 5], "x": 7.5, "y": 3},
                {"matrix": [3, 6], "x": 8.5, "y": 3},
                {"matrix": [3, 7], "x": 9.5, "y": 3},
                {"matrix": [3, 8], "x": 10.5, "y": 3},
                {"matrix": [3, 9], "x": 11.5, "y": 3},
                {"matrix": [3, 10], "x": 12.5, "y": 3},
                {"matrix": [3, 11], "x": 13.5, "y": 3},
                {"matrix": [3, 12], "x": 14.5, "y": 3}
            ]
        },
        "LAYOUT_ortho_4x13": {
            "layout": [
                {"matrix": [0, 0], "x": 0, "y": 0},

M keyboards/nightly_boards/n40_o/keymaps/via/keymap.c => keyboards/nightly_boards/n40_o/keymaps/via/keymap.c +31 -25
@@ 17,32 17,38 @@


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
	[0] = LAYOUT_ortho_4x13_encoders(
	    KC_SPC, KC_SPC, KC_SPC, KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_BSPC,
		KC_SPC, KC_SPC, KC_SPC, KC_ESC,  KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT,
		KC_SPC, KC_SPC, KC_SPC, 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_SPC, KC_SPC,  KC_LCTL, KC_LALT, KC_LGUI, MO(1),   KC_SPC,  KC_SPC,  MO(2),   KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT
					 
    ),
	[1] = LAYOUT_ortho_4x13_encoders(
	    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
						  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
		
	[0] = LAYOUT_ortho_4x13(
	    KC_SPC, KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_BSPC,
		KC_SPC, KC_ESC,  KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT,
		KC_SPC, 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_SPC, KC_SPC,  KC_LCTL, KC_LALT, KC_LGUI, MO(1),   KC_SPC,  KC_SPC,  MO(2),   KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT

    ),
	[2] = LAYOUT_ortho_4x13_encoders(
	    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
						  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
		
	[1] = LAYOUT_ortho_4x13(
	    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),
	[3] = LAYOUT_ortho_4x13_encoders(
	    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
						  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
		
	[2] = LAYOUT_ortho_4x13(
	    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),
	[3] = LAYOUT_ortho_4x13(
	    KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =  { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_MPRV, KC_MNXT) },
    [1] =  { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) },
    [2] =  { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
    [3] =  { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }
};
#endif

M keyboards/nightly_boards/n40_o/keymaps/via/rules.mk => keyboards/nightly_boards/n40_o/keymaps/via/rules.mk +2 -1
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

D keyboards/nightly_boards/n40_o/n40_o.c => keyboards/nightly_boards/n40_o/n40_o.c +0 -29
@@ 1,29 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 "quantum.h"
#include "encoder_action.h"

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
//    if (!encoder_update_user(index, clockwise)) return false;
    encoder_action_register(index, clockwise);
    return true;
};

M keyboards/nightly_boards/n40_o/rules.mk => keyboards/nightly_boards/n40_o/rules.mk +0 -3
@@ 12,6 12,3 @@ RGBLIGHT_ENABLE = yes         # Enable keyboard RGB underglow
AUDIO_ENABLE = yes            # Audio output
ENCODER_ENABLE = yes          # Enable Rotary Encoders
LTO_ENABLE = yes

# Added encoder Action
SRC += encoder_action.c
\ No newline at end of file

M keyboards/nightly_boards/n60_s/config.h => keyboards/nightly_boards/n60_s/config.h +0 -4
@@ 17,10 17,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.

#pragma once

/* Encoders */
#define ENCODERS_CW_KEY  { { 1, 5 } }
#define ENCODERS_CCW_KEY { { 0, 5 } }

/* Audio */

#define B7_AUDIO

D keyboards/nightly_boards/n60_s/encoder_action.c => keyboards/nightly_boards/n60_s/encoder_action.c +0 -47
@@ 1,47 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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 "encoder_action.h"

static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

D keyboards/nightly_boards/n60_s/encoder_action.h => keyboards/nightly_boards/n60_s/encoder_action.h +0 -23
@@ 1,23 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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

#include "quantum.h"

void encoder_action_unregister(void);

void encoder_action_register(uint8_t index, bool clockwise);
\ No newline at end of file

M keyboards/nightly_boards/n60_s/info.json => keyboards/nightly_boards/n60_s/info.json +1 -148
@@ 10,7 10,7 @@
    },
    "matrix_pins": {
        "cols": ["F7", "F6", "F5", "F4", "F1", "F0", "B0", "B1", "B2", "B3", "B5", "B6", "C6", "C7"],
        "rows": ["B4", "D7", "D6", "D0", "E6", null]
        "rows": ["B4", "D7", "D6", "D0", "E6"]
    },
    "diode_direction": "COL2ROW",
    "encoder": {


@@ 99,80 99,6 @@
                {"matrix": [4, 13], "x": 13.75, "y": 4, "w": 1.25}
            ]
        },
        "LAYOUT_60_ansi_split_bs_rshift_encoder": {
            "layout": [
                {"matrix": [0, 0], "x": 0, "y": 0},
                {"matrix": [0, 1], "x": 1, "y": 0},
                {"matrix": [0, 2], "x": 2, "y": 0},
                {"matrix": [0, 3], "x": 3, "y": 0},
                {"matrix": [0, 4], "x": 4, "y": 0},
                {"matrix": [0, 5], "x": 5, "y": 0},
                {"matrix": [0, 6], "x": 6, "y": 0},
                {"matrix": [0, 7], "x": 7, "y": 0},
                {"matrix": [0, 8], "x": 8, "y": 0},
                {"matrix": [0, 9], "x": 9, "y": 0},
                {"matrix": [0, 10], "x": 10, "y": 0},
                {"matrix": [0, 11], "x": 11, "y": 0},
                {"matrix": [0, 12], "x": 12, "y": 0},
                {"matrix": [0, 13], "x": 13, "y": 0},
                {"matrix": [1, 13], "x": 14, "y": 0},

                {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
                {"matrix": [1, 1], "x": 1.5, "y": 1},
                {"matrix": [1, 2], "x": 2.5, "y": 1},
                {"matrix": [1, 3], "x": 3.5, "y": 1},
                {"matrix": [1, 4], "x": 4.5, "y": 1},
                {"matrix": [1, 5], "x": 5.5, "y": 1},
                {"matrix": [1, 6], "x": 6.5, "y": 1},
                {"matrix": [1, 7], "x": 7.5, "y": 1},
                {"matrix": [1, 8], "x": 8.5, "y": 1},
                {"matrix": [1, 9], "x": 9.5, "y": 1},
                {"matrix": [1, 10], "x": 10.5, "y": 1},
                {"matrix": [1, 11], "x": 11.5, "y": 1},
                {"matrix": [1, 12], "x": 12.5, "y": 1},
                {"matrix": [2, 13], "x": 13.5, "y": 1, "w": 1.5},

                {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
                {"matrix": [2, 1], "x": 1.75, "y": 2},
                {"matrix": [2, 2], "x": 2.75, "y": 2},
                {"matrix": [2, 3], "x": 3.75, "y": 2},
                {"matrix": [2, 4], "x": 4.75, "y": 2},
                {"matrix": [2, 5], "x": 5.75, "y": 2},
                {"matrix": [2, 6], "x": 6.75, "y": 2},
                {"matrix": [2, 7], "x": 7.75, "y": 2},
                {"matrix": [2, 8], "x": 8.75, "y": 2},
                {"matrix": [2, 9], "x": 9.75, "y": 2},
                {"matrix": [2, 10], "x": 10.75, "y": 2},
                {"matrix": [2, 11], "x": 11.75, "y": 2},
                {"matrix": [2, 12], "x": 12.75, "y": 2, "w": 2.25},

                {"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25},
                {"matrix": [3, 2], "x": 2.25, "y": 3},
                {"matrix": [3, 3], "x": 3.25, "y": 3},
                {"matrix": [3, 4], "x": 4.25, "y": 3},
                {"matrix": [3, 5], "x": 5.25, "y": 3},
                {"matrix": [3, 6], "x": 6.25, "y": 3},
                {"matrix": [3, 7], "x": 7.25, "y": 3},
                {"matrix": [3, 8], "x": 8.25, "y": 3},
                {"matrix": [3, 9], "x": 9.25, "y": 3},
                {"matrix": [3, 10], "x": 10.25, "y": 3},
                {"matrix": [3, 11], "x": 11.25, "y": 3},
                {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75},
                {"matrix": [3, 13], "x": 14, "y": 3},

                {"matrix": [5, 0], "x": 15.25, "y": 3},
                {"matrix": [5, 1], "x": 16.25, "y": 3},

                {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25},
                {"matrix": [4, 2], "x": 1.25, "y": 4, "w": 1.25},
                {"matrix": [4, 3], "x": 2.5, "y": 4, "w": 1.25},
                {"matrix": [4, 7], "x": 3.75, "y": 4, "w": 6.25},
                {"matrix": [4, 10], "x": 10, "y": 4, "w": 1.25},
                {"matrix": [4, 11], "x": 11.25, "y": 4, "w": 1.25},
                {"matrix": [4, 12], "x": 12.5, "y": 4, "w": 1.25},
                {"matrix": [4, 13], "x": 13.75, "y": 4, "w": 1.25}
            ]
        },
        "LAYOUT_60_ansi_split_bs_rshift_tsangan": {
            "layout": [
                {"matrix": [0, 0], "x": 0, "y": 0},


@@ 242,79 168,6 @@
                {"matrix": [4, 12], "x": 12.5, "y": 4},
                {"matrix": [4, 13], "x": 13.5, "y": 4, "w": 1.5}
            ]
        },
        "LAYOUT_60_ansi_split_bs_rshift_tsangan_encoder": {
            "layout": [
                {"matrix": [0, 0], "x": 0, "y": 0},
                {"matrix": [0, 1], "x": 1, "y": 0},
                {"matrix": [0, 2], "x": 2, "y": 0},
                {"matrix": [0, 3], "x": 3, "y": 0},
                {"matrix": [0, 4], "x": 4, "y": 0},
                {"matrix": [0, 5], "x": 5, "y": 0},
                {"matrix": [0, 6], "x": 6, "y": 0},
                {"matrix": [0, 7], "x": 7, "y": 0},
                {"matrix": [0, 8], "x": 8, "y": 0},
                {"matrix": [0, 9], "x": 9, "y": 0},
                {"matrix": [0, 10], "x": 10, "y": 0},
                {"matrix": [0, 11], "x": 11, "y": 0},
                {"matrix": [0, 12], "x": 12, "y": 0},
                {"matrix": [0, 13], "x": 13, "y": 0},
                {"matrix": [1, 13], "x": 14, "y": 0},

                {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
                {"matrix": [1, 1], "x": 1.5, "y": 1},
                {"matrix": [1, 2], "x": 2.5, "y": 1},
                {"matrix": [1, 3], "x": 3.5, "y": 1},
                {"matrix": [1, 4], "x": 4.5, "y": 1},
                {"matrix": [1, 5], "x": 5.5, "y": 1},
                {"matrix": [1, 6], "x": 6.5, "y": 1},
                {"matrix": [1, 7], "x": 7.5, "y": 1},
                {"matrix": [1, 8], "x": 8.5, "y": 1},
                {"matrix": [1, 9], "x": 9.5, "y": 1},
                {"matrix": [1, 10], "x": 10.5, "y": 1},
                {"matrix": [1, 11], "x": 11.5, "y": 1},
                {"matrix": [1, 12], "x": 12.5, "y": 1},
                {"matrix": [2, 13], "x": 13.5, "y": 1, "w": 1.5},

                {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
                {"matrix": [2, 1], "x": 1.75, "y": 2},
                {"matrix": [2, 2], "x": 2.75, "y": 2},
                {"matrix": [2, 3], "x": 3.75, "y": 2},
                {"matrix": [2, 4], "x": 4.75, "y": 2},
                {"matrix": [2, 5], "x": 5.75, "y": 2},
                {"matrix": [2, 6], "x": 6.75, "y": 2},
                {"matrix": [2, 7], "x": 7.75, "y": 2},
                {"matrix": [2, 8], "x": 8.75, "y": 2},
                {"matrix": [2, 9], "x": 9.75, "y": 2},
                {"matrix": [2, 10], "x": 10.75, "y": 2},
                {"matrix": [2, 11], "x": 11.75, "y": 2},
                {"matrix": [2, 12], "x": 12.75, "y": 2, "w": 2.25},

                {"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25},
                {"matrix": [3, 2], "x": 2.25, "y": 3},
                {"matrix": [3, 3], "x": 3.25, "y": 3},
                {"matrix": [3, 4], "x": 4.25, "y": 3},
                {"matrix": [3, 5], "x": 5.25, "y": 3},
                {"matrix": [3, 6], "x": 6.25, "y": 3},
                {"matrix": [3, 7], "x": 7.25, "y": 3},
                {"matrix": [3, 8], "x": 8.25, "y": 3},
                {"matrix": [3, 9], "x": 9.25, "y": 3},
                {"matrix": [3, 10], "x": 10.25, "y": 3},
                {"matrix": [3, 11], "x": 11.25, "y": 3},
                {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75},
                {"matrix": [3, 13], "x": 14, "y": 3},

                {"matrix": [5, 0], "x": 15.25, "y": 3},
                {"matrix": [5, 1], "x": 16.25, "y": 3},

                {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.5},
                {"matrix": [4, 2], "x": 1.5, "y": 4},
                {"matrix": [4, 3], "x": 2.5, "y": 4, "w": 1.5},
                {"matrix": [4, 7], "x": 4, "y": 4, "w": 7},
                {"matrix": [4, 11], "x": 11, "y": 4, "w": 1.5},
                {"matrix": [4, 12], "x": 12.5, "y": 4},
                {"matrix": [4, 13], "x": 13.5, "y": 4, "w": 1.5}
            ]
        }
    }
}

D keyboards/nightly_boards/n60_s/keymaps/ansi_encoder/keymap.c => keyboards/nightly_boards/n60_s/keymaps/ansi_encoder/keymap.c +0 -34
@@ 1,34 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Base */
    [0] = LAYOUT_60_ansi_split_bs_rshift_encoder(
        KC_ESC,  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_BSPC,
        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_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_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH,          KC_RSFT, KC_RSFT, KC_VOLD, KC_VOLU,
        KC_LCTL, MO(1),   KC_LALT,                   KC_SPC,                                      KC_RALT, KC_APP,  KC_RGUI, KC_RCTL
    ),
    [1] = LAYOUT_60_ansi_split_bs_rshift_encoder(
        QK_BOOT, 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_DEL,  KC_DEL,
        KC_TRNS, KC_TRNS, KC_UP,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP,          KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END,  KC_PGDN,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                                      KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS
	)
};

D keyboards/nightly_boards/n60_s/keymaps/tsangan_encoder/keymap.c => keyboards/nightly_boards/n60_s/keymaps/tsangan_encoder/keymap.c +0 -34
@@ 1,34 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Base */
    [0] = LAYOUT_60_ansi_split_bs_rshift_tsangan_encoder(
        KC_ESC,  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_BSPC,
        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_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_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH,          KC_RSFT, KC_RSFT, KC_VOLD, KC_VOLU,
        KC_LCTL, MO(1),   KC_LALT,                   KC_SPC,                                               KC_RALT,  KC_RGUI, KC_RCTL
    ),
    [1] = LAYOUT_60_ansi_split_bs_rshift_tsangan_encoder(
        QK_BOOT, 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_DEL,  KC_DEL,
        KC_TRNS, KC_TRNS, KC_UP,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP,          KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END,  KC_PGDN,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                                              KC_TRNS, KC_TRNS, KC_TRNS
	)
};

M keyboards/nightly_boards/n60_s/keymaps/via/keymap.c => keyboards/nightly_boards/n60_s/keymaps/via/keymap.c +18 -9
@@ 17,32 17,41 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Base */
    [0] = LAYOUT_60_ansi_split_bs_rshift_encoder(
    [0] = LAYOUT_60_ansi_split_bs_rshift(
        KC_ESC,  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_BSPC,
        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_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_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH,          KC_LSFT, KC_LSFT, KC_VOLD, KC_VOLU,
        KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH,          KC_LSFT, KC_LSFT,
        KC_LCTL, MO(1),   KC_LALT,                   KC_SPC,                                      KC_LALT, KC_APP,  KC_RGUI, KC_LCTL
    ),
    [1] = LAYOUT_60_ansi_split_bs_rshift_encoder(
    [1] = LAYOUT_60_ansi_split_bs_rshift(
        QK_BOOT,   KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F12,  KC_F12,  KC_DEL,  KC_DEL,
        KC_TRNS, KC_TRNS, KC_UP,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP,          KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END,  KC_PGDN,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END,  KC_PGDN,          KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                                      KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS
	), 
    [2] = LAYOUT_60_ansi_split_bs_rshift_encoder(
	),
    [2] = LAYOUT_60_ansi_split_bs_rshift(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                                      KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS
	),
    [3] = LAYOUT_60_ansi_split_bs_rshift_encoder(
    [3] = LAYOUT_60_ansi_split_bs_rshift(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                                      KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS
	)
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/nightly_boards/n60_s/keymaps/via/rules.mk => keyboards/nightly_boards/n60_s/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

D keyboards/nightly_boards/n60_s/n60_s.c => keyboards/nightly_boards/n60_s/n60_s.c +0 -28
@@ 1,28 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 "n60_s.h"

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
//    if (!encoder_update_user(index, clockwise)) return false;
    encoder_action_register(index, clockwise);
    return true;
};

D keyboards/nightly_boards/n60_s/n60_s.h => keyboards/nightly_boards/n60_s/n60_s.h +0 -20
@@ 1,20 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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

#include "quantum.h"
#include "encoder_action.h"

M keyboards/nightly_boards/n60_s/rules.mk => keyboards/nightly_boards/n60_s/rules.mk +0 -3
@@ 12,6 12,3 @@ RGBLIGHT_ENABLE = yes         # Enable keyboard RGB underglow
AUDIO_ENABLE = yes            # Audio output
ENCODER_ENABLE = yes          # Enable Rotary Encoders
LTO_ENABLE = yes

# Added encoder Action
SRC += encoder_action.c
\ No newline at end of file

M keyboards/nightly_boards/octopad/config.h => keyboards/nightly_boards/octopad/config.h +0 -4
@@ 28,10 28,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE

/* Encoders */
#define ENCODERS_CW_KEY  { { 3, 2 },{ 1, 2 } }
#define ENCODERS_CCW_KEY { { 2, 2 },{ 0, 2 } }

/* Audio */

#define AUDIO_PIN B5

D keyboards/nightly_boards/octopad/encoder_action.c => keyboards/nightly_boards/octopad/encoder_action.c +0 -47
@@ 1,47 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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 "encoder_action.h"

static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

D keyboards/nightly_boards/octopad/encoder_action.h => keyboards/nightly_boards/octopad/encoder_action.h +0 -23
@@ 1,23 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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

#include "quantum.h"

void encoder_action_unregister(void);

void encoder_action_register(uint8_t index, bool clockwise);
\ No newline at end of file

M keyboards/nightly_boards/octopad/info.json => keyboards/nightly_boards/octopad/info.json +1 -5
@@ 10,7 10,7 @@
    },
    "matrix_pins": {
        "cols": ["F1", "F0", "D0", "D1", "B1"],
        "rows": ["B2", "B3", null]
        "rows": ["B2", "B3"]
    },
    "diode_direction": "COL2ROW",
    "encoder": {


@@ 30,13 30,9 @@
    "layouts": {
        "LAYOUT": {
            "layout": [
                {"matrix": [2, 0], "x": 0, "y": 0},
                {"matrix": [0, 4], "x": 1, "y": 0},
                {"matrix": [2, 1], "x": 2, "y": 0},

                {"matrix": [2, 2], "x": 3.5, "y": 0},
                {"matrix": [1, 4], "x": 4.5, "y": 0},
                {"matrix": [2, 3], "x": 5.5, "y": 0},

                {"matrix": [0, 0], "x": 1.25, "y": 1.25},
                {"matrix": [0, 1], "x": 2.25, "y": 1.25},

M keyboards/nightly_boards/octopad/keymaps/default/keymap.c => keyboards/nightly_boards/octopad/keymaps/default/keymap.c +7 -8
@@ 17,16 17,15 @@


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Base */
    /* ENC1_CCW, ENC1_P,  ENC1_CW,   ENC2_CCW, ENC2_P, ENC2_CW,
		         MACRO1,  MACRO2,    MACRO3,   MACRO4,
			     MACRO5,  MACRO6,    MACRO7,   MACRO8
	*/
	[0] = LAYOUT(
		KC_VOLD, KC_ESC,   KC_VOLU,  KC_BRID, QK_BOOT,  KC_BRIU,
                           KC_ESC, QK_BOOT,
		         KC_Q,     KC_W,     KC_E,     KC_R,
			     KC_A,     KC_S,     KC_D,     KC_F
		
    ),
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =   { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_BRID, KC_BRIU)  }
};
#endif

A keyboards/nightly_boards/octopad/keymaps/default/rules.mk => keyboards/nightly_boards/octopad/keymaps/default/rules.mk +1 -0
@@ 0,0 1,1 @@
ENCODER_MAP_ENABLE = yes

M keyboards/nightly_boards/octopad/keymaps/via/keymap.c => keyboards/nightly_boards/octopad/keymaps/via/keymap.c +13 -49
@@ 17,57 17,21 @@


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Base */
    /* ENC1_CCW, ENC1_P,  ENC1_CW,   ENC2_CCW, ENC2_P, ENC2_CW,
		         MACRO1,  MACRO2,    MACRO3,   MACRO4,
			     MACRO5,  MACRO6,    MACRO7,   MACRO8
	*/
	[0] = LAYOUT(
		KC_VOLD, KC_ESC,   KC_VOLU,  KC_BRID, QK_BOOT,  KC_BRIU,
                           KC_ESC, QK_BOOT,
		         KC_Q,     KC_W,     KC_E,     KC_R,
			     KC_A,     KC_S,     KC_D,     KC_F
		
    ),
	[1] = LAYOUT(
		KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,  KC_TRNS,
		         KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,
			     KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS
		
    ),
	[2] = LAYOUT(
		KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,  KC_TRNS,
		         KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,
			     KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS
		
    ),
	[3] = LAYOUT(
		KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,  KC_TRNS,
		         KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,
			     KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS
		
    ),
	[4] = LAYOUT(
		KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,  KC_TRNS,
		         KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,
			     KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS
		
    ),
	[5] = LAYOUT(
		KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,  KC_TRNS,
		         KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,
			     KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS
		
    ),
	[6] = LAYOUT(
		KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,  KC_TRNS,
		         KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,
			     KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS
		
    ),
	[7] = LAYOUT(
		KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,  KC_TRNS,
		         KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS,
			     KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS
		
    ),
	[1 ... 7] = LAYOUT(
		                   _______,  _______,
		         _______,  _______,  _______, _______,
			     _______,  _______,  _______, _______
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =         { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_BRID, KC_BRIU)  },
    [1 ... 7] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  }
};
#endif

M keyboards/nightly_boards/octopad/keymaps/via/rules.mk => keyboards/nightly_boards/octopad/keymaps/via/rules.mk +2 -1
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

D keyboards/nightly_boards/octopad/octopad.c => keyboards/nightly_boards/octopad/octopad.c +0 -28
@@ 1,28 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 "octopad.h"

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
//    if (!encoder_update_user(index, clockwise)) return false;
    encoder_action_register(index, clockwise);
    return true;
};

D keyboards/nightly_boards/octopad/octopad.h => keyboards/nightly_boards/octopad/octopad.h +0 -20
@@ 1,20 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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

#include "quantum.h"
#include "encoder_action.h"

M keyboards/nightly_boards/octopad/rules.mk => keyboards/nightly_boards/octopad/rules.mk +0 -3
@@ 12,6 12,3 @@ BACKLIGHT_ENABLE = no         # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes         # Enable keyboard RGB underglow
AUDIO_ENABLE = yes             # Audio output
ENCODER_ENABLE = yes          # Enable Rotary Encoders

# Added encoder Action
SRC +=  encoder_action.c

M keyboards/nullbitsco/tidbit/info.json => keyboards/nullbitsco/tidbit/info.json +0 -12
@@ 35,33 35,21 @@
                {"matrix": [0, 4], "x": 4.25, "y": 0},
                {"matrix": [0, 5], "x": 5.25, "y": 0},

                {"matrix": [1, 0], "x": 0, "y": 1},
                {"matrix": [1, 1], "x": 1, "y": 1},

                {"matrix": [1, 2], "x": 2.25, "y": 1},
                {"matrix": [1, 3], "x": 3.25, "y": 1},
                {"matrix": [1, 4], "x": 4.25, "y": 1},
                {"matrix": [1, 5], "x": 5.25, "y": 1},

                {"matrix": [2, 0], "x": 0, "y": 2},
                {"matrix": [2, 1], "x": 1, "y": 2},

                {"matrix": [2, 2], "x": 2.25, "y": 2},
                {"matrix": [2, 3], "x": 3.25, "y": 2},
                {"matrix": [2, 4], "x": 4.25, "y": 2},
                {"matrix": [2, 5], "x": 5.25, "y": 2},

                {"matrix": [3, 0], "x": 0, "y": 3},
                {"matrix": [3, 1], "x": 1, "y": 3},

                {"matrix": [3, 2], "x": 2.25, "y": 3},
                {"matrix": [3, 3], "x": 3.25, "y": 3},
                {"matrix": [3, 4], "x": 4.25, "y": 3},
                {"matrix": [3, 5], "x": 5.25, "y": 3},

                {"matrix": [4, 0], "x": 0, "y": 4},
                {"matrix": [4, 1], "x": 1, "y": 4},

                {"matrix": [4, 2], "x": 2.25, "y": 4},
                {"matrix": [4, 3], "x": 3.25, "y": 4},
                {"matrix": [4, 4], "x": 4.25, "y": 4},

M keyboards/nullbitsco/tidbit/keymaps/default/keymap.c => keyboards/nullbitsco/tidbit/keymaps/default/keymap.c +20 -13
@@ 22,19 22,26 @@ enum layers {
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [_BASE] = LAYOUT(
                            KC_PSLS, KC_PAST, KC_PMNS, 
    KC_VOLD, KC_VOLU, KC_P7, KC_P8,   KC_P9,   KC_PPLS, 
    KC_MPRV, KC_MNXT, KC_P4, KC_P5,   KC_P6,   KC_PPLS, 
    KC_LEFT, KC_RGHT, KC_P1, KC_P2,   KC_P3,   KC_PENT, 
    KC_TRNS, KC_TRNS, KC_P0, KC_P0,   KC_PDOT, KC_PENT  
    ),
  [_BASE] = LAYOUT(
  KC_PSLS, KC_PAST, KC_PMNS,
  KC_P7, KC_P8,   KC_P9,   KC_PPLS,
  KC_P4, KC_P5,   KC_P6,   KC_PPLS,
  KC_P1, KC_P2,   KC_P3,   KC_PENT,
  KC_P0, KC_P0,   KC_PDOT, KC_PENT
  ),

    [_FUNC] = LAYOUT(
                      _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______  
    ),
    _______, _______, _______,
    _______, _______, _______, _______,
    _______, _______, _______, _______,
    _______, _______, _______, _______,
    _______, _______, _______, _______
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
    [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
};
#endif

A keyboards/nullbitsco/tidbit/keymaps/default/rules.mk => keyboards/nullbitsco/tidbit/keymaps/default/rules.mk +1 -0
@@ 0,0 1,1 @@
ENCODER_MAP_ENABLE = yes

M keyboards/nullbitsco/tidbit/keymaps/oled/keymap.c => keyboards/nullbitsco/tidbit/keymaps/oled/keymap.c +30 -24
@@ 25,34 25,40 @@ enum layers {

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [_BASE] = LAYOUT(
                            KC_PSLS, KC_PAST, KC_PMNS, 
    KC_VOLD, KC_VOLU, KC_P7, KC_P8,   KC_P9,   KC_PPLS, 
    KC_TRNS, KC_TRNS, KC_P4, KC_P5,   KC_P6,   KC_PPLS, 
    KC_TRNS, KC_TRNS, KC_P1, KC_P2,   KC_P3,   KC_PENT, 
    KC_TRNS, KC_TRNS, KC_P0, KC_P0,   KC_PDOT, KC_PENT  
        KC_PSLS, KC_PAST, KC_PMNS,
        KC_P7, KC_P8,   KC_P9,   KC_PPLS,
        KC_P4, KC_P5,   KC_P6,   KC_PPLS,
        KC_P1, KC_P2,   KC_P3,   KC_PENT,
        KC_P0, KC_P0,   KC_PDOT, KC_PENT
    ),

    [_VIA1] = LAYOUT(
                      _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______  
        _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______
    ),

    [_VIA2] = LAYOUT(
                      _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______
        _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______
    ),

    [_VIA3] = LAYOUT(
                      _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______
    ),
        _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
    [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
    [2] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
    [3] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
};
#endif

M keyboards/nullbitsco/tidbit/keymaps/oled/rules.mk => keyboards/nullbitsco/tidbit/keymaps/oled/rules.mk +1 -0
@@ 1,3 1,4 @@
VIA_ENABLE = yes
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
ENCODER_MAP_ENABLE = yes

M keyboards/nullbitsco/tidbit/keymaps/snailmap_lite/keymap.c => keyboards/nullbitsco/tidbit/keymaps/snailmap_lite/keymap.c +42 -36
@@ 25,38 25,44 @@ enum layer_names {

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [_LAY0] = LAYOUT(
                            KC_PSLS, KC_PAST, KC_PMNS, 
    KC_VOLD, KC_VOLU, KC_P7, KC_P8,   KC_P9,   KC_PPLS, 
    KC_TRNS, KC_TRNS, KC_P4, KC_P5,   KC_P6,   KC_PPLS, 
    KC_TRNS, KC_TRNS, KC_P1, KC_P2,   KC_P3,   KC_PENT, 
    KC_TRNS, KC_TRNS, KC_P0, KC_P0,   KC_PDOT, KC_PENT  
        KC_PSLS, KC_PAST, KC_PMNS,
        KC_P7, KC_P8,   KC_P9,   KC_PPLS,
        KC_P4, KC_P5,   KC_P6,   KC_PPLS,
        KC_P1, KC_P2,   KC_P3,   KC_PENT,
        KC_P0, KC_P0,   KC_PDOT, KC_PENT
    ),

    [_LAY1] = LAYOUT(
                      _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______  
        _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______
    ),

    [_LAY2] = LAYOUT(
                      _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______
        _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______
    ),

    [_LAY3] = LAYOUT(
                      _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______, 
    _______, _______, _______, _______, _______, _______
    ),
        _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
    [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
    [2] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
    [3] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
};
#endif

#ifdef OLED_ENABLE
/*===========================================    OLED CONFIGURATION    ===========================================*/
#define OLED_ROTATE      true         // OLED rotation (flip 180* from default orientation)


@@ 112,18 118,18 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
// Draw static background image to OLED (keyboard with no bottom row)
static void render_background(void) {
    static const char PROGMEM nullbits_n_oled[] = {
        0x00, 0xe0, 0xf0, 0xf0, 0xf8, 0xf8, 0xf0, 0xf0, 0xe0, 0x80, 0x20, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 
        0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 
        0x1f, 0x1f, 0x1f, 0x1f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf0, 0x00, 0x00, 
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 
        0x00, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x03, 0x00, 
        0x00, 0xe0, 0xf0, 0xf0, 0xf8, 0xf8, 0xf0, 0xf0, 0xe0, 0x80, 0x20, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
        0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f,
        0x1f, 0x1f, 0x1f, 0x1f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf0, 0x00, 0x00,
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00,
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
        0x00, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x03, 0x00,
    };
    oled_write_raw_P(nullbits_n_oled, sizeof(nullbits_n_oled));
}

M keyboards/nullbitsco/tidbit/keymaps/snailmap_lite/rules.mk => keyboards/nullbitsco/tidbit/keymaps/snailmap_lite/rules.mk +1 -0
@@ 4,3 4,4 @@ VIA_ENABLE = yes
SPACE_CADET_ENABLE = no
GRAVE_ESC_ENABLE = no
MAGIC_ENABLE = no
ENCODER_MAP_ENABLE = yes

M keyboards/nullbitsco/tidbit/keymaps/via/keymap.c => keyboards/nullbitsco/tidbit/keymaps/via/keymap.c +36 -31
@@ 24,36 24,41 @@ enum layers {
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  [_BASE] = LAYOUT(
                            KC_PSLS, KC_PAST, KC_PMNS, 
  KC_VOLD, KC_VOLU, KC_P7, KC_P8,   KC_P9,   KC_PPLS, 
  KC_TRNS, KC_TRNS, KC_P4, KC_P5,   KC_P6,   KC_PPLS, 
  KC_TRNS, KC_TRNS, KC_P1, KC_P2,   KC_P3,   KC_PENT, 
  KC_TRNS, KC_TRNS, KC_P0, KC_P0,   KC_PDOT, KC_PENT  
  ),

  [_VIA1] = LAYOUT(
                    _______, _______, _______, 
  _______, _______, _______, _______, _______, _______, 
  _______, _______, _______, _______, _______, _______, 
  _______, _______, _______, _______, _______, _______, 
  _______, _______, _______, _______, _______, _______  
  ),

  [_VIA2] = LAYOUT(
                    _______, _______, _______, 
  _______, _______, _______, _______, _______, _______, 
  _______, _______, _______, _______, _______, _______, 
  _______, _______, _______, _______, _______, _______, 
  _______, _______, _______, _______, _______, _______
  ),

  [_VIA3] = LAYOUT(
                    _______, _______, _______, 
  _______, _______, _______, _______, _______, _______, 
  _______, _______, _______, _______, _______, _______, 
  _______, _______, _______, _______, _______, _______, 
  _______, _______, _______, _______, _______, _______
  ),
    [_BASE] = LAYOUT(
        KC_PSLS, KC_PAST, KC_PMNS,
        KC_P7, KC_P8,   KC_P9,   KC_PPLS,
        KC_P4, KC_P5,   KC_P6,   KC_PPLS,
        KC_P1, KC_P2,   KC_P3,   KC_PENT,
        KC_P0, KC_P0,   KC_PDOT, KC_PENT
    ),
    [_VIA1] = LAYOUT(
        _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______
    ),
    [_VIA2] = LAYOUT(
        _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______
    ),
    [_VIA3] = LAYOUT(
        _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
    [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
    [2] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
    [3] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), },
};
#endif

M keyboards/nullbitsco/tidbit/keymaps/via/rules.mk => keyboards/nullbitsco/tidbit/keymaps/via/rules.mk +2 -1
@@ 1,1 1,2 @@
VIA_ENABLE = yes
\ No newline at end of file
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/nullbitsco/tidbit/tidbit.c => keyboards/nullbitsco/tidbit/tidbit.c +32 -60
@@ 18,20 18,6 @@
#include "common/remote_kb.h"
#include "common/bitc_led.h"

typedef struct PACKED {
    uint8_t r;
    uint8_t c;
} encodermap_t;

// Map encoders to their respective virtual matrix entry
// Allows for encoder control using VIA
const encodermap_t encoder_map[4][2] = {
    {{1, 0}, {1, 1}},  // Encoder 1 matrix location
    {{2, 0}, {2, 1}},  // Encoder 2 matrix location
    {{3, 0}, {3, 1}},  // Encoder 3 matrix location
    {{4, 0}, {4, 1}},  // Encoder 4 matrix location
};

bool numlock_set = false;

#ifdef OLED_ENABLE


@@ 41,40 27,40 @@ oled_rotation_t oled_init_kb(oled_rotation_t rotation) {

static void render_logo(void) {
    static const char PROGMEM tidbit_oled[] = {
        0x00, 0x0e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
        0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0x1f, 0x1f, 0x1f, 
        0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x3e, 0x3e, 0x7e, 0xfc, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 
        0x1f, 0x1f, 0x3f, 0x7e, 0xfe, 0xfe, 0xfc, 0xf8, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0xfe, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x0e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 
        0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1e, 0x00, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
        0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xc0, 
        0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 
        0xe0, 0xf0, 0xf0, 0xf8, 0xff, 0xff, 0xbf, 0x1f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
        0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x03, 
        0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
        0x03, 0x03, 0x03, 0x07, 0x07, 0xbf, 0xff, 0xff, 0xff, 0xfe, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x7f, 0xff, 0xff, 0x7f, 0x3f, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 
        0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x7f, 0x7f, 0x7f, 0xff, 0xff, 0xf8, 0xf8, 0xf8, 
        0xf8, 0xf8, 0xf8, 0x7c, 0x7c, 0x7c, 0x7e, 0x3e, 0x3f, 0x3f, 0x1f, 0x0f, 0x07, 0x01, 0x00, 0x00, 
        0x00, 0x00, 0x00, 0x00, 0x1f, 0x7f, 0x7f, 0x7f, 0xff, 0xff, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 
        0xf8, 0x7c, 0x7c, 0x7c, 0x7e, 0x3f, 0x3f, 0x1f, 0x1f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x7f, 0xff, 0xff, 0x7f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x00, 0x0e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
        0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff,
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0x1f, 0x1f, 0x1f,
        0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x3e, 0x3e, 0x7e, 0xfc, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f,
        0x1f, 0x1f, 0x3f, 0x7e, 0xfe, 0xfe, 0xfc, 0xf8, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0xfe, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x0e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f,
        0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1e, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
        0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xc0,
        0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0,
        0xe0, 0xf0, 0xf0, 0xf8, 0xff, 0xff, 0xbf, 0x1f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
        0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x03,
        0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
        0x03, 0x03, 0x03, 0x07, 0x07, 0xbf, 0xff, 0xff, 0xff, 0xfe, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
        0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x7f, 0xff, 0xff, 0x7f, 0x3f,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff,
        0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x7f, 0x7f, 0x7f, 0xff, 0xff, 0xf8, 0xf8, 0xf8,
        0xf8, 0xf8, 0xf8, 0x7c, 0x7c, 0x7c, 0x7e, 0x3e, 0x3f, 0x3f, 0x1f, 0x0f, 0x07, 0x01, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x1f, 0x7f, 0x7f, 0x7f, 0xff, 0xff, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8,
        0xf8, 0x7c, 0x7c, 0x7c, 0x7e, 0x3f, 0x3f, 0x1f, 0x1f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x7f, 0xff, 0xff, 0x7f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x3f, 0x7f, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    

    oled_write_raw_P(tidbit_oled, sizeof(tidbit_oled));
};



@@ 86,20 72,6 @@ bool oled_task_kb(void) {

#endif

static void process_encoder_matrix(encodermap_t pos) {
    action_exec(MAKE_KEYEVENT(pos.r, pos.c, true));
#if TAP_CODE_DELAY > 0
    wait_ms(TAP_CODE_DELAY);
#endif
    action_exec(MAKE_KEYEVENT(pos.r, pos.c, false));
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) return false;
    process_encoder_matrix(encoder_map[index][clockwise ? 0 : 1]);
    return false;
}

// Use Bit-C LED to show NUM LOCK status
void led_update_ports(led_t led_state) {
    set_bitc_LED(led_state.num_lock ? LED_DIM : LED_OFF);

M keyboards/owlab/voice65/hotswap/hotswap.c => keyboards/owlab/voice65/hotswap/hotswap.c +1 -327
@@ 14,7 14,7 @@
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "hotswap.h"
#include "quantum.h"

#ifdef RGB_MATRIX_ENABLE
const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = {


@@ 122,329 122,3 @@ bool rgb_matrix_indicators_kb(void) {
    }
    return true;
}

enum encoder_modes{
    ENCODER_MODE_ONE,
    ENCODER_MODE_TWO,
    ENCODER_MODE_THREE
};

keyboard_config_t keyboard_config;
rgblight_config_t rgblight_config;

uint8_t pre_hue, pre_sat, pre_val;
uint8_t previous_rgb_mode = 0;
uint8_t dir_hue, dir_sat;

bool encoder_in = false;
uint32_t encoder_timer;

bool encoder_ani_start= false;
uint32_t encoder_ani_timer = 0;

bool encoder_direction_start = false;
uint32_t encoder_direction_timer = 0;


bool lizm_restart_snake = false;
void rgblight_snake_restart(uint8_t hue, uint8_t sat, uint8_t val){
    lizm_restart_snake = true;  // restart signal to local each effect
    rgblight_config.hue = hue;
    rgblight_config.sat = sat;
    rgblight_config.val = val;
}


void keyboard_post_init_kb(void){
    keyboard_config.raw = eeconfig_read_kb();
    if( keyboard_config.encoder_mode_index > ENCODER_MODE_THREE ){
        keyboard_config.encoder_mode_index = ENCODER_MODE_ONE;
        eeconfig_update_kb(keyboard_config.raw);
    }
}

void switch_encoder_mode(uint8_t mode){
       switch(mode){
            case ENCODER_MODE_ONE:
            dir_hue = 88;
            dir_sat = 255;
            break;

            case ENCODER_MODE_TWO:
            dir_hue = 0;
            dir_sat = 240;
            break;

            case ENCODER_MODE_THREE:
            dir_hue = 176;
            dir_sat = 255;
            break;
        }
        rgblight_sethsv_noeeprom(dir_hue,dir_sat,pre_val);
}


void init_encoder_mode(uint8_t mode){
    previous_rgb_mode = rgblight_get_mode();
    pre_hue = rgblight_get_hue();
    pre_sat = rgblight_get_sat();
    pre_val = rgblight_get_val();
    encoder_in = true;

    rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);

    switch_encoder_mode(mode);
}


void set_encoder_mode(uint8_t mode){
    if(encoder_in == false){
       init_encoder_mode(mode);
    }else{
        switch_encoder_mode(mode);
    }
    eeconfig_update_kb(keyboard_config.raw);
    encoder_timer = timer_read32();
}

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
  if (record->event.pressed) {
    switch(keycode) {
        case RGB_MOD:
        case RGB_RMOD:
        case RGB_HUI:
        case RGB_HUD:
        case RGB_SAI:
        case RGB_SAD:
        case RGB_VAI:
        case RGB_VAD:

        if(encoder_in){
                return false;
            }
        break;

        case KC_F13:
        rgb_matrix_toggle();
        break;

        case KC_F14:
        rgb_matrix_step();
        break;

        case KC_F15:
        rgb_matrix_step_reverse();
        break;

        case KC_F16:
        rgb_matrix_increase_hue();  //Increase the hue for effect range LEDs
        break;

        case KC_F17:
        rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs
        break;

        case KC_F18:
        rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs
        break;

        case KC_F19:
        rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs
        break;

        case KC_F20:
        rgb_matrix_increase_val(); //Increase the value for effect range LEDs
        break;

        case KC_F21:
        rgb_matrix_decrease_val();//Decrease the value for effect range LEDs
        break;

        case KC_F22:  //change encoder mode upward
        if(!encoder_direction_start){
            if(keyboard_config.encoder_mode_index < ENCODER_MODE_THREE){
                keyboard_config.encoder_mode_index++;
            }
            else{
                keyboard_config.encoder_mode_index = ENCODER_MODE_ONE;
            }
            set_encoder_mode(keyboard_config.encoder_mode_index);
        }
        return false;
        case KC_F23:
        if(!encoder_direction_start){
            if(keyboard_config.encoder_mode_index > ENCODER_MODE_ONE){
                keyboard_config.encoder_mode_index--;
            }
            else{
                keyboard_config.encoder_mode_index = ENCODER_MODE_THREE;
            }
            set_encoder_mode(keyboard_config.encoder_mode_index);
        }
        return false;

        default:
        break;
    }
  }
  return process_record_user(keycode, record);
}


void matrix_scan_kb(void) {
    if(encoder_in){
        if(timer_elapsed32(encoder_timer) > 5000){
            rgblight_mode(previous_rgb_mode);
            rgblight_sethsv(pre_hue, pre_sat, pre_val);
            encoder_in = false;
        }
    }

    if(encoder_ani_start){
        if(timer_elapsed32(encoder_ani_timer) > VOLUME_ANIMATION_TIMER){
            encoder_ani_start = false;
            rgblight_sethsv_noeeprom(0,0,0);
        }
    }

    if(encoder_direction_start){
        if(timer_elapsed32(encoder_direction_timer) > (VOLUME_ANIMATION_TIMER+1500)){
            rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
            rgblight_sethsv_noeeprom(dir_hue, dir_sat, pre_val);
            encoder_direction_start = false;
        }
    }
    matrix_scan_user();
}


void set_volume_animation(bool increase){
    if(!encoder_ani_start){
        rgblight_snake_restart(dir_hue, dir_sat, pre_val);
    }

    if(increase){
        rgblight_mode_noeeprom(17);
    } else {
        rgblight_mode_noeeprom(18);
    }

    encoder_ani_timer = timer_read32();
    encoder_direction_timer = encoder_ani_timer;
    encoder_ani_start = true;
    encoder_direction_start = true;
}


bool encoder_update_kb(uint8_t index, bool clockwise) {
    uint8_t layer_now = keyboard_config.encoder_mode_index +1;
    uint16_t encoder_cw_keycode = keymap_key_to_keycode(layer_now, (keypos_t){.row=2, .col=1 });
    uint16_t encoder_ccw_keycode = keymap_key_to_keycode(layer_now, (keypos_t){.row=2, .col=2 });
    if (index == 0) { /* First encoder */
        if(encoder_in == false){
            init_encoder_mode(keyboard_config.encoder_mode_index);
        }

        if (!clockwise) {
             switch(encoder_cw_keycode) {

                case KC_F13:
                rgb_matrix_toggle();
                break;

                case KC_F14:
                rgb_matrix_step();
                break;

                case KC_F15:
                rgb_matrix_step_reverse();
                break;

                case KC_F16:
                rgb_matrix_increase_hue();  //Increase the hue for effect range LEDs
                break;

                case KC_F17:
                rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs
                break;

                case KC_F18:
                rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs
                break;

                case KC_F19:
                rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs
                break;

                case KC_F20:
                rgb_matrix_increase_val(); //Increase the value for effect range LEDs
                break;

                case KC_F21:
                rgb_matrix_decrease_val();//Decrease the value for effect range LEDs
                break;

                case KC_VOLU:
                case KC_VOLD:
                tap_code(encoder_cw_keycode);
                break;

                default:
                tap_code(encoder_cw_keycode);
                break;
            }
            set_volume_animation(true);
        } else {
             switch(encoder_ccw_keycode) {

                case KC_F13:
                rgb_matrix_toggle();
                break;

                case KC_F14:
                rgb_matrix_step();
                break;

                case KC_F15:
                rgb_matrix_step_reverse();
                break;

                case KC_F16:
                rgb_matrix_increase_hue();  //Increase the hue for effect range LEDs
                break;

                case KC_F17:
                rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs
                break;

                case KC_F18:
                rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs
                break;

                case KC_F19:
                rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs
                break;

                case KC_F20:
                rgb_matrix_increase_val(); //Increase the value for effect range LEDs
                break;

                case KC_F21:
                rgb_matrix_decrease_val();//Decrease the value for effect range LEDs
                break;

                case KC_VOLU:
                case KC_VOLD:
                tap_code(encoder_ccw_keycode);
                break;

                default:
                tap_code(encoder_ccw_keycode);
                break;
            }
            set_volume_animation(false);
        }
        encoder_timer = timer_read32();
    }
    return true;
}

D keyboards/owlab/voice65/hotswap/hotswap.h => keyboards/owlab/voice65/hotswap/hotswap.h +0 -30
@@ 1,30 0,0 @@
/* Copyright 2021 kb-elmo<mail@elmo.space>
 *
 * 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

#include "quantum.h"

typedef union {
    uint32_t raw;
    struct {
        uint8_t encoder_mode_index :8;
    };
} keyboard_config_t;

extern keyboard_config_t keyboard_config;

#define VOLUME_ANIMATION_TIMER 580

M keyboards/owlab/voice65/hotswap/keymaps/default/keymap.c => keyboards/owlab/voice65/hotswap/keymaps/default/keymap.c +18 -9
@@ 16,35 16,44 @@
#include QMK_KEYBOARD_H

// How long (in ms) to wait between animation steps for the snake mode
const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20}; 
const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_65_ansi_blocker(
        KC_ESC,  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_ESC,  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,   MO(1),
        KC_LCTL, KC_LGUI, KC_LALT,                           KC_SPC,                             KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_65_ansi_blocker(
        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,  KC_TRNS, QK_BOOT,
        KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_HOME,
        KC_TRNS, KC_VOLU, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS,      KC_END, 
        KC_TRNS,          KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_F17,  KC_F18,  KC_F19,  KC_F20,  KC_F21,  KC_TRNS, KC_TRNS, KC_F22,  KC_TRNS, 
        KC_TRNS, KC_VOLU, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS,      KC_END,
        KC_TRNS,          KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_F17,  KC_F18,  KC_F19,  KC_F20,  KC_F21,  KC_TRNS, KC_TRNS, KC_F22,  KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_F23,  KC_TRNS
    ),
    [2] = LAYOUT_65_ansi_blocker(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_PGUP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS,     KC_TRNS,
        KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),
    [3] = LAYOUT_65_ansi_blocker(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_WH_U, KC_WH_D, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS,     KC_TRNS,
        KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    )
};
\ No newline at end of file
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
    [2] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

A keyboards/owlab/voice65/hotswap/keymaps/default/rules.mk => keyboards/owlab/voice65/hotswap/keymaps/default/rules.mk +1 -0
@@ 0,0 1,1 @@
ENCODER_MAP_ENABLE = yes

M keyboards/owlab/voice65/hotswap/keymaps/via/keymap.c => keyboards/owlab/voice65/hotswap/keymaps/via/keymap.c +16 -8
@@ 16,36 16,44 @@
#include QMK_KEYBOARD_H

// How long (in ms) to wait between animation steps for the snake mode
const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20}; 
const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_65_ansi_blocker(
        KC_ESC,  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_ESC,  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,   MO(1),
        KC_LCTL, KC_LGUI, KC_LALT,                           KC_SPC,                             KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_65_ansi_blocker(
        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,  KC_TRNS, QK_BOOT,
        KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_HOME,
        KC_TRNS, KC_VOLU, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS,      KC_END, 
        KC_TRNS,          KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_F17,  KC_F18,  KC_F19,  KC_F20,  KC_F21,  KC_TRNS, KC_TRNS, KC_F22,  KC_TRNS, 
        KC_TRNS, KC_VOLU, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS,      KC_END,
        KC_TRNS,          KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_F17,  KC_F18,  KC_F19,  KC_F20,  KC_F21,  KC_TRNS, KC_TRNS, KC_F22,  KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_F23,  KC_TRNS
    ),
    [2] = LAYOUT_65_ansi_blocker(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_PGUP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS,     KC_TRNS,
        KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),
    [3] = LAYOUT_65_ansi_blocker(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_WH_U, KC_WH_D, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS,     KC_TRNS,
        KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
    [2] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/owlab/voice65/hotswap/keymaps/via/rules.mk => keyboards/owlab/voice65/hotswap/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/owlab/voice65/soldered/keymaps/default/keymap.c => keyboards/owlab/voice65/soldered/keymaps/default/keymap.c +18 -9
@@ 16,35 16,44 @@
#include QMK_KEYBOARD_H

// How long (in ms) to wait between animation steps for the snake mode
const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20}; 
const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_65_ansi_blocker(
        KC_ESC,  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_ESC,  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,   MO(1),
        KC_LCTL, KC_LGUI, KC_LALT,                           KC_SPC,                             KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_65_ansi_blocker(
        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,  KC_TRNS, QK_BOOT,
        KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_HOME,
        KC_TRNS, KC_VOLU, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS,      KC_END, 
        KC_TRNS,          KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_F17,  KC_F18,  KC_F19,  KC_F20,  KC_F21,  KC_TRNS, KC_TRNS, KC_F22,  KC_TRNS, 
        KC_TRNS, KC_VOLU, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS,      KC_END,
        KC_TRNS,          KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_F17,  KC_F18,  KC_F19,  KC_F20,  KC_F21,  KC_TRNS, KC_TRNS, KC_F22,  KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_F23,  KC_TRNS
    ),
    [2] = LAYOUT_65_ansi_blocker(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_PGUP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS,     KC_TRNS,
        KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),
    [3] = LAYOUT_65_ansi_blocker(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_WH_U, KC_WH_D, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS,     KC_TRNS,
        KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    )
};
\ No newline at end of file
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
    [2] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

A keyboards/owlab/voice65/soldered/keymaps/default/rules.mk => keyboards/owlab/voice65/soldered/keymaps/default/rules.mk +1 -0
@@ 0,0 1,1 @@
ENCODER_MAP_ENABLE = yes

M keyboards/owlab/voice65/soldered/keymaps/via/keymap.c => keyboards/owlab/voice65/soldered/keymaps/via/keymap.c +18 -9
@@ 16,35 16,44 @@
#include QMK_KEYBOARD_H

// How long (in ms) to wait between animation steps for the snake mode
const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20}; 
const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 35, 20};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_65_ansi_blocker(
        KC_ESC,  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_ESC,  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,   MO(1),
        KC_LCTL, KC_LGUI, KC_LALT,                           KC_SPC,                             KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_65_ansi_blocker(
        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,  KC_TRNS, QK_BOOT,
        KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_HOME,
        KC_TRNS, KC_VOLU, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS,      KC_END, 
        KC_TRNS,          KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_F17,  KC_F18,  KC_F19,  KC_F20,  KC_F21,  KC_TRNS, KC_TRNS, KC_F22,  KC_TRNS, 
        KC_TRNS, KC_VOLU, KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS,      KC_END,
        KC_TRNS,          KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_F17,  KC_F18,  KC_F19,  KC_F20,  KC_F21,  KC_TRNS, KC_TRNS, KC_F22,  KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_F23,  KC_TRNS
    ),
    [2] = LAYOUT_65_ansi_blocker(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_PGUP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS,     KC_TRNS,
        KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),
    [3] = LAYOUT_65_ansi_blocker(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_WH_U, KC_WH_D, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,      KC_TRNS,     KC_TRNS,
        KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                            KC_TRNS,                            KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    )
};
\ No newline at end of file
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
    [2] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/owlab/voice65/soldered/keymaps/via/rules.mk => keyboards/owlab/voice65/soldered/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/owlab/voice65/soldered/soldered.c => keyboards/owlab/voice65/soldered/soldered.c +1 -328
@@ 14,7 14,7 @@
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "soldered.h"
#include "quantum.h"

#ifdef RGB_MATRIX_ENABLE
const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = {


@@ 126,330 126,3 @@ bool rgb_matrix_indicators_kb(void) {
    }
    return true;
}

enum encoder_modes{
    ENCODER_MODE_ONE,
    ENCODER_MODE_TWO,
    ENCODER_MODE_THREE
};

keyboard_config_t keyboard_config;
rgblight_config_t rgblight_config;

uint8_t pre_hue, pre_sat, pre_val;
uint8_t previous_rgb_mode = 0;
uint8_t dir_hue, dir_sat;

bool encoder_in = false;
uint32_t encoder_timer;

bool encoder_ani_start= false;
uint32_t encoder_ani_timer = 0;

bool encoder_direction_start = false;
uint32_t encoder_direction_timer = 0;


bool lizm_restart_snake = false;
void rgblight_snake_restart(uint8_t hue, uint8_t sat, uint8_t val){
    lizm_restart_snake = true;  // restart signal to local each effect
    rgblight_config.hue = hue;
    rgblight_config.sat = sat;
    rgblight_config.val = val;
}


void keyboard_post_init_kb(void){
    keyboard_config.raw = eeconfig_read_kb();
    if( keyboard_config.encoder_mode_index > ENCODER_MODE_THREE ){
        keyboard_config.encoder_mode_index = ENCODER_MODE_ONE;
        eeconfig_update_kb(keyboard_config.raw);
    }
}

void switch_encoder_mode(uint8_t mode){
       switch(mode){
            case ENCODER_MODE_ONE:
            dir_hue = 88;
            dir_sat = 255;
            break;

            case ENCODER_MODE_TWO:
            dir_hue = 0;
            dir_sat = 240;
            break;

            case ENCODER_MODE_THREE:
            dir_hue = 176;
            dir_sat = 255;
            break;
        }
        rgblight_sethsv_noeeprom(dir_hue,dir_sat,pre_val);
}


void init_encoder_mode(uint8_t mode){
    previous_rgb_mode = rgblight_get_mode();
    pre_hue = rgblight_get_hue();
    pre_sat = rgblight_get_sat();
    pre_val = rgblight_get_val();
    encoder_in = true;

    rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);

    switch_encoder_mode(mode);
}


void set_encoder_mode(uint8_t mode){
    if(encoder_in == false){
       init_encoder_mode(mode);
    }else{
        switch_encoder_mode(mode);
    }
    eeconfig_update_kb(keyboard_config.raw);
    encoder_timer = timer_read32();
}

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
  if (record->event.pressed) {
    switch(keycode) {
        case RGB_MOD:
        case RGB_RMOD:
        case RGB_HUI:
        case RGB_HUD:
        case RGB_SAI:
        case RGB_SAD:
        case RGB_VAI:
        case RGB_VAD:

        if(encoder_in){
                return false;
            }
        break;

        case KC_F13:
        rgb_matrix_toggle();
        break;

        case KC_F14:
        rgb_matrix_step();
        break;

        case KC_F15:
        rgb_matrix_step_reverse();
        break;

        case KC_F16:
        rgb_matrix_increase_hue();  //Increase the hue for effect range LEDs
        break;

        case KC_F17:
        rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs
        break;

        case KC_F18:
        rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs
        break;

        case KC_F19:
        rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs
        break;

        case KC_F20:
        rgb_matrix_increase_val(); //Increase the value for effect range LEDs
        break;

        case KC_F21:
        rgb_matrix_decrease_val();//Decrease the value for effect range LEDs
        break;

        case KC_F22:  //change encoder mode upward
        if(!encoder_direction_start){
            if(keyboard_config.encoder_mode_index < ENCODER_MODE_THREE){
                keyboard_config.encoder_mode_index++;
            }
            else{
                keyboard_config.encoder_mode_index = ENCODER_MODE_ONE;
            }
            set_encoder_mode(keyboard_config.encoder_mode_index);
        }
        return false;

        case KC_F23:
        if(!encoder_direction_start){
            if(keyboard_config.encoder_mode_index > ENCODER_MODE_ONE){
                keyboard_config.encoder_mode_index--;
            }
            else{
                keyboard_config.encoder_mode_index = ENCODER_MODE_THREE;
            }
            set_encoder_mode(keyboard_config.encoder_mode_index);
        }
        return false;

        default:
        break;
    }
  }
  return process_record_user(keycode, record);
}


void matrix_scan_kb(void) {
    if(encoder_in){
        if(timer_elapsed32(encoder_timer) > 5000){
            rgblight_mode(previous_rgb_mode);
            rgblight_sethsv(pre_hue, pre_sat, pre_val);
            encoder_in = false;
        }
    }

    if(encoder_ani_start){
        if(timer_elapsed32(encoder_ani_timer) > VOLUME_ANIMATION_TIMER){
            encoder_ani_start = false;
            rgblight_sethsv_noeeprom(0,0,0);
        }
    }

    if(encoder_direction_start){
        if(timer_elapsed32(encoder_direction_timer) > (VOLUME_ANIMATION_TIMER+1500)){
            rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
            rgblight_sethsv_noeeprom(dir_hue, dir_sat, pre_val);
            encoder_direction_start = false;
        }
    }
    matrix_scan_user();
}


void set_volume_animation(bool increase){
    if(!encoder_ani_start){
        rgblight_snake_restart(dir_hue, dir_sat, pre_val);
    }

    if(increase){
        rgblight_mode_noeeprom(17);
    } else {
        rgblight_mode_noeeprom(18);
    }

    encoder_ani_timer = timer_read32();
    encoder_direction_timer = encoder_ani_timer;
    encoder_ani_start = true;
    encoder_direction_start = true;
}


bool encoder_update_kb(uint8_t index, bool clockwise) {
    uint8_t layer_now = keyboard_config.encoder_mode_index +1;
    uint16_t encoder_cw_keycode = keymap_key_to_keycode(layer_now, (keypos_t){.row=2, .col=1 });
    uint16_t encoder_ccw_keycode = keymap_key_to_keycode(layer_now, (keypos_t){.row=2, .col=2 });
    if (index == 0) { /* First encoder */
        if(encoder_in == false){
            init_encoder_mode(keyboard_config.encoder_mode_index);
        }

        if (!clockwise) {
             switch(encoder_cw_keycode) {

                case KC_F13:
                rgb_matrix_toggle();
                break;

                case KC_F14:
                rgb_matrix_step();
                break;

                case KC_F15:
                rgb_matrix_step_reverse();
                break;

                case KC_F16:
                rgb_matrix_increase_hue();  //Increase the hue for effect range LEDs
                break;

                case KC_F17:
                rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs
                break;

                case KC_F18:
                rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs
                break;

                case KC_F19:
                rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs
                break;

                case KC_F20:
                rgb_matrix_increase_val(); //Increase the value for effect range LEDs
                break;

                case KC_F21:
                rgb_matrix_decrease_val();//Decrease the value for effect range LEDs
                break;

                case KC_VOLU:
                case KC_VOLD:
                tap_code(encoder_cw_keycode);
                break;

                default:
                tap_code(encoder_cw_keycode);
                break;
            }
            set_volume_animation(true);
        } else {
             switch(encoder_ccw_keycode) {

                case KC_F13:
                rgb_matrix_toggle();
                break;

                case KC_F14:
                rgb_matrix_step();
                break;

                case KC_F15:
                rgb_matrix_step_reverse();
                break;

                case KC_F16:
                rgb_matrix_increase_hue();  //Increase the hue for effect range LEDs
                break;

                case KC_F17:
                rgb_matrix_decrease_hue(); //Decrease the hue for effect range LEDs
                break;

                case KC_F18:
                rgb_matrix_increase_sat(); //Increase the saturation for effect range LEDs
                break;

                case KC_F19:
                rgb_matrix_decrease_sat(); //Decrease the saturation for effect range LEDs
                break;

                case KC_F20:
                rgb_matrix_increase_val(); //Increase the value for effect range LEDs
                break;

                case KC_F21:
                rgb_matrix_decrease_val();//Decrease the value for effect range LEDs
                break;

                case KC_VOLU:
                case KC_VOLD:
                tap_code(encoder_ccw_keycode);
                break;

                default:
                tap_code(encoder_ccw_keycode);
                break;
            }
            set_volume_animation(false);
        }
        encoder_timer = timer_read32();
    }
    return true;
}

D keyboards/owlab/voice65/soldered/soldered.h => keyboards/owlab/voice65/soldered/soldered.h +0 -30
@@ 1,30 0,0 @@
/* Copyright 2021 kb-elmo<mail@elmo.space>
 *
 * 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

#include "quantum.h"

typedef union {
  uint32_t raw;
  struct {
    uint8_t encoder_mode_index :8;
  };
} keyboard_config_t;

extern keyboard_config_t keyboard_config;

#define VOLUME_ANIMATION_TIMER 580

M keyboards/rate/pistachio_mp/keymaps/default/keymap.c => keyboards/rate/pistachio_mp/keymaps/default/keymap.c +0 -13
@@ 41,16 41,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KC_NO,            KC_NO,    KC_NO
    )
};
#ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) {
        // Volume control
        if (clockwise) {
            tap_code(KC_VOLU);
        } else {
            tap_code(KC_VOLD);
        }
    }
    return true;
}
#endif

M keyboards/rate/pistachio_mp/keymaps/via/keymap.c => keyboards/rate/pistachio_mp/keymaps/via/keymap.c +14 -65
@@ 23,29 23,10 @@ enum layer_names {
    _RESERVE_1
};

static uint8_t encoder_state = 0;
static const keypos_t ENC_CW = {.row = 3, .col = 3};
static const keypos_t ENC_CCW = {.row = 4, .col = 1};

#define LAYOUT_via( \
         ECW,ECCW, K07, \
    K00, K01, K02, K03, \
    K04, K05, K06,      \
    K08, K09, K10, K11, \
    K12, K13, K14,      \
    K15,      K16, K17 ) { \
    { K00,   K01,   K02,   K03 }, \
    { K04,   K05,   K06,   K07 }, \
    { K08,   K09,   K10,   K11 }, \
    { K12,   K13,   K14,   ECCW }, \
    { K15,   ECW,   K16,   K17 }, \
}


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Base */
    [_BASE] = LAYOUT_via(
                           KC_VOLU,KC_VOLD,KC_MPLY,
    [_BASE] = LAYOUT(
                                           KC_MPLY,
    LT(_FN, KC_NUM),   KC_PSLS,  KC_PAST,  KC_PMNS,
    KC_P7,             KC_P8,    KC_P9,
    KC_P4,             KC_P5,    KC_P6,    KC_PPLS,


@@ 53,8 34,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KC_P0,                       KC_PDOT,  KC_PENT
    ),
    /* Fn */
    [_FN] = LAYOUT_via(
                KC_VOLU,KC_VOLD,KC_NO,
    [_FN] = LAYOUT(
                                KC_NO,
    KC_NO,   KC_NO,   KC_NO,    KC_NO,
    RGB_HUI, RGB_SAI, RGB_VAI,
    RGB_HUD, RGB_SAD, RGB_VAD,  RGB_TOG,


@@ 62,8 43,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KC_NO,            KC_NO,    KC_NO
    ),
    /* Reserve */
    [_RESERVE_0] = LAYOUT_via(
                KC_VOLU,KC_VOLD,KC_TRNS,
    [_RESERVE_0] = LAYOUT(
                                KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS,


@@ 71,8 52,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KC_TRNS,          KC_TRNS,  KC_TRNS
    ),
    /* Reserve */
    [_RESERVE_1] = LAYOUT_via(
                KC_VOLU,KC_VOLD,KC_TRNS,
    [_RESERVE_1] = LAYOUT(
                                KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS,
    KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS,


@@ 81,43 62,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    ),
};

#ifdef ENCODER_ENABLE
void encoder_action_unregister(void) {
    if (encoder_state) {
        keyevent_t encoder_event = (keyevent_t) {
            .key = encoder_state >> 1 ? ENC_CW : ENC_CCW,
            .pressed = false,
            .time = timer_read(),
            .type = KEY_EVENT
        };
        encoder_state = 0;
        action_exec(encoder_event);
    }
    return;
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? ENC_CW : ENC_CCW,
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
    return;
}

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
    return;
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
    // don't return user actions, because they are in the keymap
    // encoder_update_user(index, clockwise);
    return true;
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/rate/pistachio_mp/keymaps/via/rules.mk => keyboards/rate/pistachio_mp/keymaps/via/rules.mk +2 -1
@@ 1,1 1,2 @@
VIA_ENABLE = yes
\ No newline at end of file
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/rate/pistachio_pro/keymaps/default/keymap.c => keyboards/rate/pistachio_pro/keymaps/default/keymap.c +0 -14
@@ 91,20 91,6 @@ bool oled_task_user(void) {
    return false;
}

/* Encoder */
bool encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) {
        // Volume control
        if (clockwise) {
            tap_code(KC_VOLU);
        } else {
            tap_code(KC_VOLD);
        }
    }

    return true;
}

/* Keyboard */
void keyboard_post_init_user(void) {
    bme280_init();

M keyboards/rate/pistachio_pro/keymaps/via/keymap.c => keyboards/rate/pistachio_pro/keymaps/via/keymap.c +13 -58
@@ 26,30 26,10 @@ enum layer_names {
    _RESERVE_1
};

static uint8_t encoder_state = 0;
static const keypos_t ENC_CW = {.row = 0, .col = 14 };
static const keypos_t ENC_CCW = {.row = 0, .col = 15 };

#define LAYOUT_via( \
    k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, ENC_CW, ENC_CCW, k013, \
    k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k114, k115, k116, k117, \
    k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k214, k215, \
    k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, \
    k400, k401, k402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k412, k413, \
    k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510, k511, k512, k513 ) { \
    { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, ENC_CW, ENC_CCW, KC_NO, KC_NO }, \
    { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k114,  k115,  k116,  k117  }, \
    { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k214,  k215,  KC_NO, KC_NO }, \
    { k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, KC_NO, KC_NO, KC_NO, KC_NO }, \
    { k400, k401, k402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k412, k413, KC_NO, KC_NO, KC_NO, KC_NO }, \
    { k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510, k511, k512, k513, KC_NO, KC_NO, KC_NO, KC_NO }  \
}


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Base */
    [_BASE] = LAYOUT_via(
      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_VOLU,KC_VOLD,KC_MPLY,
      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_MPLY,
      JP_ZKHK,   KC_1,    KC_2,   KC_3,   KC_4,   KC_5,    KC_6,    KC_7,   KC_8,    KC_9,    KC_0,    JP_MINS,  JP_CIRC,  JP_YEN,  KC_BSPC,     KC_INS,  KC_HOME, KC_PGUP,
      KC_TAB,      KC_Q,    KC_W,   KC_E,   KC_R,   KC_T,    KC_Y,    KC_U,   KC_I,    KC_O,    KC_P,    JP_AT,    JP_LBRC,                      KC_DEL,  KC_END,  KC_PGDN,
      JP_EISU,       KC_A,    KC_S,   KC_D,   KC_F,   KC_G,    KC_H,    KC_J,   KC_K,    KC_L,    JP_SCLN, JP_COLN,  JP_RBRC,       KC_ENT,


@@ 57,7 37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      KC_LCTL,  KC_LGUI,  KC_LALT,   JP_MHEN,    KC_SPC,      KC_SPC,      LT(_FN, JP_HENK),    JP_KANA,   KC_RALT,     KC_APP,    KC_RCTL,     KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [_FN] = LAYOUT_via(
      KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,      KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,     KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,       KC_VOLU,KC_VOLD,KC_MPLY,
      KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,      KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,     KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,       KC_MPLY,
      KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS, KC_TRNS, KC_TRNS,
      KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7,    KC_8,    KC_9,                        KC_TRNS, KC_TRNS, KC_TRNS,
      KC_TRNS,     KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4,    KC_5,    KC_6,         KC_TRNS,


@@ 65,7 45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      KC_TRNS, KC_TRNS,   KC_TRNS,   KC_TRNS,      KC_TRNS,          KC_TRNS,          KC_TRNS,    KC_0,    JP_DOT,    JP_DOT,      KC_TRNS,     KC_TRNS, KC_TRNS, KC_TRNS
    ),
    [_RESERVE_0] = LAYOUT_via(
      KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,      KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,     KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,       KC_VOLU,KC_VOLD,KC_MPLY,
      KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,      KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,     KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,       KC_MPLY,
      KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS, KC_TRNS, KC_TRNS,
      KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,                   KC_TRNS, KC_TRNS, KC_TRNS,
      KC_TRNS,     KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,    KC_TRNS,


@@ 73,7 53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      KC_TRNS, KC_TRNS,   KC_TRNS,   KC_TRNS,      KC_TRNS,          KC_TRNS,          KC_TRNS,    KC_TRNS,  KC_TRNS,  KC_TRNS,     KC_TRNS,     KC_TRNS, KC_TRNS, KC_TRNS
    ),
    [_RESERVE_1] = LAYOUT_via(
      KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,      KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,     KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,       KC_VOLU,KC_VOLD,KC_MPLY,
      KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,      KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,     KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,       KC_MPLY,
      KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS, KC_TRNS, KC_TRNS,
      KC_TRNS,   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,                   KC_TRNS, KC_TRNS, KC_TRNS,
      KC_TRNS,     KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS,  KC_TRNS,    KC_TRNS,


@@ 129,40 109,6 @@ bool oled_task_user(void) {
    return false;
}

/* Encoder */
void encoder_action_unregister(void) {
    if (encoder_state) {
        keyevent_t encoder_event = (keyevent_t) {
            .key = encoder_state >> 1 ? ENC_CW : ENC_CCW,
            .pressed = false,
            .time = timer_read(),
            .type = KEY_EVENT
        };
        encoder_state = 0;
        action_exec(encoder_event);
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? ENC_CW : ENC_CCW,
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_user(void) {
    encoder_action_unregister();
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
    return false;
}

/* Keyboard */
void keyboard_post_init_user(void) {
    bme280_init();


@@ 179,3 125,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {

    return true;
}

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/rate/pistachio_pro/keymaps/via/rules.mk => keyboards/rate/pistachio_pro/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/rgbkb/mun/keymaps/default/keymap.c => keyboards/rgbkb/mun/keymaps/default/keymap.c +7 -11
@@ 66,9 66,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     * |--------+--------+--------+--------+--------+--------+--------|  |--------+--------+--------+--------+--------+--------+--------|
     * | Ctrl   | Win    | Alt    | RGBTOG | Adjust | Space  | Bksp   |  | Enter  | Space  | Left   | Down   | Up     | Right  | Ctrl   |
     * '--------+--------+--------+--------+--------+--------+--------'  '--------+--------+--------+--------+--------+--------+--------'
     *      Encoder 1         Encoder 2                                                                  Encoder 3         Encoder 4
     * .-----------------------------------.                                                        .-----------------------------------.
     * | VolUp  | VolDn  | VolUp  | VolDn  |                                                        | PgUp   | PgDn   | PgUp   | PgDn   |
     * |--------+--------+--------+--------+--------.                                      .--------+--------+--------+--------+--------|
     * | VolDn  | VolUp  | Next   | Play   | Prev   | Touch Encoder          Touch Encoder | RgbHuI | RgbHuD | RgbMdD | RgbTog | RgbMdI |
     * '--------+--------+--------+--------+--------'                                      '--------+--------+--------+--------+--------'


@@ 80,7 77,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_LCBR,   KC_RCBR,   KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, SC_SENT,
        KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJUST,  KC_SPC,  KC_DEL,    KC_ENT,    KC_SPC,  KC_LEFT, KC_DOWN, KC_UP,   KC_RIGHT,KC_RCTL,

        KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD,                                                          KC_PGDN, KC_PGUP, KC_PGDN, KC_PGUP,
        KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV,                                        RGB_HUI, RGB_HUD, RGB_RMOD,RGB_TOG, RGB_MOD
    ),



@@ 91,7 87,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    _______, _______, KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 102,7 97,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_F4,   KC_F8,   KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, _______,
        _______, KC_NO,   _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 113,7 107,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, TCH_TOG, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 124,7 117,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, RGB_SPD, _______, RGB_SPI, _______, _______, _______, _______, _______, KC_P1,   KC_P2,   KC_P3,   _______, GAME,
        _______, RGB_RMOD,_______, RGB_MOD, _______, _______, _______, _______, _______, KC_P0,   KC_PDOT, KC_NUM,  QWERTY, COLEMAK,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 135,7 127,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 146,7 137,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 157,7 147,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),
};


@@ 251,3 240,10 @@ bool oled_task_user(void) {
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
    return OLED_ROTATION_270;
}

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =       { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
    [1 ... 7] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }
};
#endif

A keyboards/rgbkb/mun/keymaps/default/rules.mk => keyboards/rgbkb/mun/keymaps/default/rules.mk +1 -0
@@ 0,0 1,1 @@
ENCODER_MAP_ENABLE = yes

M keyboards/rgbkb/mun/keymaps/peott-fr/keymap.c => keyboards/rgbkb/mun/keymaps/peott-fr/keymap.c +31 -22
@@ 42,40 42,49 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     * '--------+--------+--------+--------+--------'                                      '--------+--------+--------+--------+--------'
     */
    [_BASE] = LAYOUT(
			KC_ESC,  KC_1,    KC_2,    KC_3,  KC_4, 	KC_5,     KC_GRV, 		KC_EQL,   KC_6,     KC_7,    KC_8,    KC_9,   KC_0,    KC_MINS, 
			KC_TAB,  KC_Q,    KC_W,    KC_E,  KC_R, 	KC_T,     KC_LBRC,  	KC_RBRC,  KC_Y,     KC_U,    KC_I,    KC_O,   KC_P,    KC_BSLS, 
			KC_ESC,  KC_1,    KC_2,    KC_3,  KC_4, 	KC_5,     KC_GRV, 		KC_EQL,   KC_6,     KC_7,    KC_8,    KC_9,   KC_0,    KC_MINS,
			KC_TAB,  KC_Q,    KC_W,    KC_E,  KC_R, 	KC_T,     KC_LBRC,  	KC_RBRC,  KC_Y,     KC_U,    KC_I,    KC_O,   KC_P,    KC_BSLS,
			KC_LCTL, KC_A,    KC_S,    KC_D,  KC_F, 	KC_G,     KC_HOME,  	KC_END,   KC_H,     KC_J,    KC_K,    KC_L,   KC_SCLN, KC_QUOT,
			SC_LSPO, KC_Z,    KC_X,    KC_C,  KC_V,     KC_B,     KC_MPLY,  	KC_MUTE,  KC_N,     KC_M,    KC_COMM, KC_DOT, KC_SLSH, SC_RSPC, 
			KC_LCTL, KC_LGUI, KC_LALT, MO(3), DEL_FUNC, SPC_LHND, SPC_LHND, 	BSP_FUNC, BSP_FUNC, KC_LEFT, KC_DOWN, KC_UP,  KC_RGHT, KC_RCTL, 
			SC_LSPO, KC_Z,    KC_X,    KC_C,  KC_V,     KC_B,     KC_MPLY,  	KC_MUTE,  KC_N,     KC_M,    KC_COMM, KC_DOT, KC_SLSH, SC_RSPC,
			KC_LCTL, KC_LGUI, KC_LALT, MO(3), DEL_FUNC, SPC_LHND, SPC_LHND, 	BSP_FUNC, BSP_FUNC, KC_LEFT, KC_DOWN, KC_UP,  KC_RGHT, KC_RCTL,
			// Here we have the encoder setup. Encoder 0 clockwise, Encoder 0 counter-clockwise, Encoder 1 clockwise, Encoder 1 counter-clockwise , then right side
			KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_PGDN, KC_PGUP, KC_PGDN, KC_PGUP, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV, RGB_HUI, RGB_HUD, RGB_RMOD, RGB_TOG, RGB_MOD
			KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV, RGB_HUI, RGB_HUD, RGB_RMOD, RGB_TOG, RGB_MOD
			),
    [_LHAND] = LAYOUT(
			QK_BOOT,  KC_F1,  KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F11,		KC_F12,  KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_UP,   KC_TRNS, KC_TRNS, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SCRL, KC_PAUS, KC_TRNS, 
			QK_BOOT,  KC_F1,  KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F11,		KC_F12,  KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_UP,   KC_TRNS, KC_TRNS, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SCRL, KC_PAUS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_PGUP, 		KC_PGDN, KC_TRNS, KC_TRNS, KC_INS,  KC_HOME, KC_PGUP, KC_TRNS,
			KC_LSFT, KC_CALC, KC_MYCM, KC_TRNS, KC_ENT,  KC_BSPC, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL,  KC_END,  KC_PGDN, KC_RSFT, 
			KC_LSFT, KC_CALC, KC_MYCM, KC_TRNS, KC_ENT,  KC_BSPC, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL,  KC_END,  KC_PGDN, KC_RSFT,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END,  KC_TRNS,
			// Encoders.
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
			),
    [_FUNC] = LAYOUT(
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 		RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, QK_BOOT, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 		RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, QK_BOOT,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 		KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
			// Encoders.
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
			KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
			),
	// Placeholder layer!
	[3] = LAYOUT(
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 		KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 		KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 		KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 		KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 		KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 		KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 		KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 		KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 		KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 		KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
			// Encoders.
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
			KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
			)
};
\ No newline at end of file
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
    [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }
};
#endif

A keyboards/rgbkb/mun/keymaps/peott-fr/rules.mk => keyboards/rgbkb/mun/keymaps/peott-fr/rules.mk +1 -0
@@ 0,0 1,1 @@
ENCODER_MAP_ENABLE = yes

M keyboards/rgbkb/mun/keymaps/via/keymap.c => keyboards/rgbkb/mun/keymaps/via/keymap.c +7 -11
@@ 66,9 66,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     * |--------+--------+--------+--------+--------+--------+--------|  |--------+--------+--------+--------+--------+--------+--------|
     * | Ctrl   | Win    | Alt    | RGBTOG | Adjust | Space  | Bksp   |  | Enter  | Space  | Left   | Down   | Up     | Right  | Ctrl   |
     * '--------+--------+--------+--------+--------+--------+--------'  '--------+--------+--------+--------+--------+--------+--------'
     *      Encoder 1         Encoder 2                                                                  Encoder 3         Encoder 4
     * .-----------------------------------.                                                        .-----------------------------------.
     * | VolUp  | VolDn  | VolUp  | VolDn  |                                                        | PgUp   | PgDn   | PgUp   | PgDn   |
     * |--------+--------+--------+--------+--------.                                      .--------+--------+--------+--------+--------|
     * | VolDn  | VolUp  | Next   | Play   | Prev   | Touch Encoder          Touch Encoder | RgbHuI | RgbHuD | RgbMdD | RgbTog | RgbMdI |
     * '--------+--------+--------+--------+--------'                                      '--------+--------+--------+--------+--------'


@@ 80,7 77,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_LCBR,   KC_RCBR,   KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, SC_SENT,
        KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJUST,  KC_SPC,  KC_DEL,    KC_ENT,    KC_SPC,  KC_LEFT, KC_DOWN, KC_UP,   KC_RIGHT,KC_RCTL,

        KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD,                                                          KC_PGDN, KC_PGUP, KC_PGDN, KC_PGUP,
        KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV,                                        RGB_HUI, RGB_HUD, RGB_RMOD,RGB_TOG, RGB_MOD
    ),



@@ 91,7 87,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    _______, _______, KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 102,7 97,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_F4,   KC_F8,   KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, _______,
        _______, KC_NO,   _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 113,7 107,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, TCH_TOG, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 124,7 117,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, RGB_SPD, _______, RGB_SPI, _______, _______, _______, _______, _______, KC_P1,   KC_P2,   KC_P3,   _______, GAME,
        _______, RGB_RMOD,_______, RGB_MOD, _______, _______, _______, _______, _______, KC_P0,   KC_PDOT, KC_NUM,  QWERTY, COLEMAK,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 135,7 127,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 146,7 137,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),



@@ 157,7 147,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______,                                                       _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______
    ),
};


@@ 251,3 240,10 @@ bool oled_task_user(void) {
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
    return OLED_ROTATION_270;
}

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =       { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
    [1 ... 7] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }
};
#endif

M keyboards/rgbkb/mun/keymaps/via/rules.mk => keyboards/rgbkb/mun/keymaps/via/rules.mk +2 -1
@@ 1,1 1,2 @@
VIA_ENABLE=yes
\ No newline at end of file
VIA_ENABLE=yes
ENCODER_MAP_ENABLE = yes

M keyboards/rgbkb/mun/keymaps/xulkal2/keymap.c => keyboards/rgbkb/mun/keymaps/xulkal2/keymap.c +8 -9
@@ 46,9 46,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     * |--------+--------+--------+--------+--------+--------+--------|  |--------+--------+--------+--------+--------+--------+--------|
     * | Ctrl-  | Win    | Alt    | Del    | Space  |        | ADJ    |  | FN     |        | Space  | '"     | Alt    | App    | Ctrl=  |
     * '--------+--------+--------+--------|--------+--------+--------'  '--------+--------+--------+--------+--------+--------+--------'
     *      Encoder 1         Encoder 2                                                                  Encoder 3         Encoder 4
     * .-----------------------------------.                                                        .-----------------------------------.
     * | VolUp  | VolDn  | VolUp  | VolDn  |                                                        | PgUp   | PgDn   | PgUp   | PgDn   |
     * |--------+--------+--------+--------+--------.                                      .--------+--------+--------+--------+--------|
     * | VolDn  | VolUp  | Next   | Play   | Prev   | Touch Encoder          Touch Encoder | RgbHuI | RgbHuD | RgbMdD | RgbTog | RgbMdI |
     * '--------+--------+--------+--------+--------'                                      '--------+--------+--------+--------+--------'


@@ 60,7 57,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        SC_LSPO, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_LCBR,    KC_RCBR, KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, SC_RSPC,
        SC_LCPO, KC_LGUI, KC_LALT, KC_DEL,  KC_SPC,  KC_NO,   ADJ,        FN,      KC_NO,   KC_SPC,  KC_QUOTE,KC_RALT, KC_APP,  SC_RCPC,

        KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD,                                                          MENU_DN, MENU_UP, MENU_DN, MENU_UP,
        KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV,                                        RGB_HUI, RGB_HUD, RGB_RMOD,RGB_TOG, RGB_MOD
    ),



@@ 76,9 72,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     * |--------+--------+--------+--------+--------+--------+--------|  |--------+--------+--------+--------+--------+--------+--------|
     * |        |        |        |        |        |        |        |  |        |        | Play   | Prev   | Next   | VolUp  | VolDn  |
     * '--------+--------+--------+--------+--------+--------+--------'  '--------+--------+--------+--------+--------+--------+--------'
     *      Encoder 1         Encoder 2                                                                  Encoder 3         Encoder 4
     * .-----------------------------------.                                                        .-----------------------------------.
     * |        |        |        |        |                                                        |        |        |        |        |
     * |--------+--------+--------+--------+--------.                                      .--------+--------+--------+--------+--------|
     * |        |        |        |        |        | Touch Encoder          Touch Encoder |        |        |        |        |        |
     * '--------+--------+--------+--------+--------'                                      '--------+--------+--------+--------+--------'


@@ 90,7 83,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, RGB_RST, _______, _______, _______, RGB_TOG, _______,    _______, _______, _______, KC_DEL,  KC_END,  KC_PGDN, _______,
        _______, _______, _______, _______, _______, _______, _______,    _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, KC_VOLU, KC_VOLD,

        _______, _______, _______, _______,                                                          _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                        _______, _______, _______, _______, _______
    ),



@@ 120,7 112,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, EE_CLR,  _______,    _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______,
        _______, _______, _______, _______, _______, _______, _______,    _______, _______, _______, KC_KP_0, KC_PDOT, KC_PENT, _______,

        _______, _______, _______, _______,                                                          _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                        _______, _______, _______, _______, _______
    )
};


@@ 247,3 238,11 @@ bool oled_task_user(void) {
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
    return OLED_ROTATION_270;
}

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(MENU_DN, MENU_UP), ENCODER_CCW_CW(MENU_DN, MENU_UP) },
    [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }
};
#endif

M keyboards/rgbkb/mun/keymaps/xulkal2/rules.mk => keyboards/rgbkb/mun/keymaps/xulkal2/rules.mk +3 -1
@@ 1,3 1,5 @@
MOUSEKEY_ENABLE = yes	# using for mouse wheel up and down, more granular than page up/down

OPT_DEFS += -DRGB_UNLIMITED_POWER
\ No newline at end of file
OPT_DEFS += -DRGB_UNLIMITED_POWER

ENCODER_MAP_ENABLE = yes

M keyboards/rgbkb/mun/rev1/info.json => keyboards/rgbkb/mun/rev1/info.json +0 -10
@@ 118,16 118,6 @@
                {"matrix": [11, 1], "x": 12.5, "y": 4},
                {"matrix": [11, 0], "x": 13.5, "y": 4},

                {"matrix": [5, 0], "x": 0, "y": 5.5},
                {"matrix": [5, 1], "x": 1, "y": 5.5},
                {"matrix": [5, 2], "x": 2, "y": 5.5},
                {"matrix": [5, 3], "x": 3, "y": 5.5},

                {"matrix": [12, 0], "x": 10.5, "y": 5.5},
                {"matrix": [12, 1], "x": 11.5, "y": 5.5},
                {"matrix": [12, 2], "x": 12.5, "y": 5.5},
                {"matrix": [12, 3], "x": 13.5, "y": 5.5},

                {"matrix": [6, 0], "x": 0, "y": 6.5},
                {"matrix": [6, 1], "x": 1, "y": 6.5},
                {"matrix": [6, 2], "x": 2, "y": 6.5},

M keyboards/rgbkb/mun/rev1/rev1.c => keyboards/rgbkb/mun/rev1/rev1.c +1 -32
@@ 12,25 12,12 @@
#define NUMBER_OF_TOUCH_ENCODERS 2
#define TOUCH_ENCODER_OPTIONS TOUCH_SEGMENTS + 2

#define NUMBER_OF_ENCODERS 4
#define ENCODER_OPTIONS 2

typedef struct PACKED {
    uint8_t r;
    uint8_t c;
} encodermap_t;

// this maps encoders and then touch encoders to their respective electrical matrix entry
// mapping is row (y) then column (x) when looking at the electrical layout
const encodermap_t encoder_map[NUMBER_OF_ENCODERS][ENCODER_OPTIONS] = 
{
    { {  5, 0 }, {  5, 1 } }, // Encoder 1 matrix entries
    { {  5, 2 }, {  5, 3 } }, // Encoder 2 matrix entries
    { { 12, 0 }, { 12, 1 } }, // Encoder 3 matrix entries
    { { 12, 2 }, { 12, 3 } }, // Encoder 4 matrix entries
}; 

const encodermap_t touch_encoder_map[NUMBER_OF_TOUCH_ENCODERS][TOUCH_ENCODER_OPTIONS] = 
const encodermap_t touch_encoder_map[NUMBER_OF_TOUCH_ENCODERS][TOUCH_ENCODER_OPTIONS] =
{
    { {  6, 0 }, {  6, 1 }, {  6, 2 }, {  6, 3 }, {  6, 4 } }, // Touch Encoder 1 matrix entries
    { { 13, 0 }, { 13, 1 }, { 13, 2 }, { 13, 3 }, { 13, 4 } }  // Touch Encoder 2 matrix entries


@@ 44,24 31,6 @@ static void process_encoder_matrix(encodermap_t pos) {
    action_exec(MAKE_KEYEVENT(pos.r, pos.c, false));
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise))
        return false;

    // Mapping clockwise (typically increase) to zero, and counter clockwise (decrease) to 1
    process_encoder_matrix(encoder_map[index][clockwise ? 0 : 1]);
    return false;
}

bool touch_encoder_update_kb(uint8_t index, bool clockwise) {
    if (!touch_encoder_update_user(index, clockwise))
        return false;

    // Mapping clockwise (typically increase) to zero, and counter clockwise (decrease) to 1
    process_encoder_matrix(touch_encoder_map[index][clockwise ? 0 : 1]);
    return false;
}

bool touch_encoder_tapped_kb(uint8_t index, uint8_t section) {
    if (!touch_encoder_tapped_user(index, section))
        return false;

M keyboards/rgbkb/sol3/keymaps/default/keymap.c => keyboards/rgbkb/sol3/keymaps/default/keymap.c +9 -8
@@ 23,9 23,6 @@
 * └──────┴──────┴──────┴──────┴──────┤ Space├──────┤  ├──────┤ Space├──────┴──────┴──────┴──────┴──────┘
 *                                    │      │ DEL  │  │ Enter│      │
 *                                    └──────┴──────┘  └──────┴──────┘
 * ┌──────┬──────┬──────┬──────┬──────┬──────┐                ┌──────┬──────┬──────┬──────┬──────┬──────┐
 * │Vol Dn│Vol Up│Vol Dn│Vol Up│Vol Dn│Vol Up│                │Vol Dn│Vol Up│Vol Dn│Vol Up│Vol Dn│Vol Up│
 * └──────┴──────┴──────┴──────┴──────┴──────┘                └──────┴──────┴──────┴──────┴──────┴──────┘
 * ┌──────┬──────┬──────┬──────┬──────┐                              ┌──────┬──────┬──────┬──────┬──────┐
 * │Vol Dn│Vol Up│ Prev │ Play │ Next │                              │Vol Dn│Vol Up│ Prev │ Play │ Next │
 * └──────┴──────┴──────┴──────┴──────┘                              └──────┴──────┴──────┴──────┴──────┘


@@ 65,7 62,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_LSFT,  KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_LCBR,                  KC_RCBR, KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, SC_SENT,
        KC_LCTL,  KC_LGUI, KC_LALT, RGB_TOG, ADJUST,  KC_SPC,  KC_PGDN, KC_DEL, KC_ENT,  KC_PGUP, KC_SPC,  KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT, KC_RCTL,

        KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU,                                     KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU,
        KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV,                                                       KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV
    ),



@@ 76,7 72,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    _______,                   _______, KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                                       _______, _______, _______, _______, _______
    ),



@@ 87,7 82,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_F4,                     KC_F8,   KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, _______,
        _______, KC_NO,   _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                                       _______, _______, _______, _______, _______
    ),



@@ 98,7 92,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, AU_TOGG, MU_TOGG, MU_NEXT, _______, _______, _______,                   _______, _______, _______, _______, _______, _______, _______,
        _______, CK_TOGG,   CK_UP, CK_DOWN, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU,

        _______, _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                                       _______, _______, _______, _______, _______
    ),



@@ 109,7 102,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, RGB_SPD, _______, RGB_SPI, _______, _______, DM_RSTP,                   _______, _______, KC_P1,   KC_P2,   KC_P3,   _______, GAME,
        _______, RGB_RMOD,RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, KC_P0,   KC_PDOT, KC_NUM,  QWERTY,  COLEMAK,

        _______, _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                                       _______, _______, _______, _______, _______
    ),



@@ 171,3 163,12 @@ void render_layer_status(void) {
            oled_write_ln_P(PSTR("Undef"), false);
    }
}

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0]       = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU),
                  ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
    [1 ... 4] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______),
                  ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }
};
#endif

A keyboards/rgbkb/sol3/keymaps/default/rules.mk => keyboards/rgbkb/sol3/keymaps/default/rules.mk +1 -0
@@ 0,0 1,1 @@
ENCODER_MAP_ENABLE = yes

M keyboards/rgbkb/sol3/keymaps/kageurufu/keymap.c => keyboards/rgbkb/sol3/keymaps/kageurufu/keymap.c +9 -1
@@ 28,7 28,6 @@ extern keymap_config_t keymap_config;
  *                                    `-------------'  `--------=----'
  */
#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__, \
      KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU,                                     KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, \
      KC_MNXT, KC_MPLY, KC_MPRV, KC_VOLD, KC_VOLU,                                                       KC_MNXT, KC_MPLY, KC_MPRV, KC_VOLD, KC_VOLU )

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {


@@ 59,3 58,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      )

};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0]       = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU),
                  ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1 ... 4] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______),
                  ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }
};
#endif

M keyboards/rgbkb/sol3/keymaps/kageurufu/rules.mk => keyboards/rgbkb/sol3/keymaps/kageurufu/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/rgbkb/sol3/keymaps/via/keymap.c => keyboards/rgbkb/sol3/keymaps/via/keymap.c +9 -11
@@ 23,9 23,6 @@
 * └──────┴──────┴──────┴──────┴──────┤ Space├──────┤  ├──────┤ Space├──────┴──────┴──────┴──────┴──────┘
 *                                    │      │ DEL  │  │ Enter│      │
 *                                    └──────┴──────┘  └──────┴──────┘
 * ┌──────┬──────┬──────┬──────┬──────┬──────┐                ┌──────┬──────┬──────┬──────┬──────┬──────┐
 * │Vol Dn│Vol Up│Vol Dn│Vol Up│Vol Dn│Vol Up│                │Vol Dn│Vol Up│Vol Dn│Vol Up│Vol Dn│Vol Up│
 * └──────┴──────┴──────┴──────┴──────┴──────┘                └──────┴──────┴──────┴──────┴──────┴──────┘
 * ┌──────┬──────┬──────┬──────┬──────┐                              ┌──────┬──────┬──────┬──────┬──────┐
 * │Vol Dn│Vol Up│ Prev │ Play │ Next │                              │Vol Dn│Vol Up│ Prev │ Play │ Next │
 * └──────┴──────┴──────┴──────┴──────┘                              └──────┴──────┴──────┴──────┴──────┘


@@ 68,7 65,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_LSFT,  KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_LCBR,                  KC_RCBR, KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, SC_SENT,
        KC_LCTL,  KC_LGUI, KC_LALT, RGB_TOG, ADJUST,  KC_SPC,  KC_PGDN, KC_DEL, KC_ENT,  KC_PGUP, KC_SPC,  KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT, KC_RCTL,

        KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU,                                     KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU, KC_VOLD, KC_VOLU,
        KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV,                                                       KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, KC_MPRV
    ),



@@ 79,7 75,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    _______,                   _______, KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                                       _______, _______, _______, _______, _______
    ),



@@ 90,7 85,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_F4,                     KC_F8,   KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, _______,
        _______, KC_NO,   _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                                       _______, _______, _______, _______, _______
    ),



@@ 101,7 95,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, AU_TOGG, MU_TOGG, MU_NEXT, _______, _______, _______,                   _______, _______, _______, _______, _______, _______, _______,
        _______, CK_TOGG,   CK_UP, CK_DOWN, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU,

        _______, _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                                       _______, _______, _______, _______, _______
    ),



@@ 112,7 105,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, RGB_SPD, _______, RGB_SPI, _______, _______, DM_RSTP,                   _______, _______, KC_P1,   KC_P2,   KC_P3,   _______, GAME,
        _______, RGB_RMOD,RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, KC_P0,   KC_PDOT, KC_NUM,  QWERTY,  COLEMAK,

        _______, _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                                       _______, _______, _______, _______, _______
    ),



@@ 123,7 115,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______,                   _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                                       _______, _______, _______, _______, _______
    ),



@@ 134,7 125,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______,                   _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                                       _______, _______, _______, _______, _______
    ),



@@ 145,7 135,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______,                   _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,

        _______, _______, _______, _______, _______, _______,                                     _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______,                                                       _______, _______, _______, _______, _______
    )



@@ 216,3 205,12 @@ void render_layer_status(void) {
            oled_write_ln_P(PSTR("Undef"), false);
    }
}

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0]       = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU),
                  ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
    [1 ... 7] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______),
                  ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }
};
#endif

M keyboards/rgbkb/sol3/keymaps/via/rules.mk => keyboards/rgbkb/sol3/keymaps/via/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/rgbkb/sol3/rev1/info.json => keyboards/rgbkb/sol3/rev1/info.json +0 -14
@@ 136,20 136,6 @@
                {"matrix": [10, 1], "x": 14.5, "y": 4},
                {"matrix": [10, 0], "x": 15.5, "y": 4, "w": 1.5},

                {"matrix": [5, 0], "x": 0, "y": 7, "w": 0.8, "h": 0.8},
                {"matrix": [5, 1], "x": 0.8, "y": 7, "w": 0.8, "h": 0.8},
                {"matrix": [5, 2], "x": 1.6, "y": 7, "w": 0.8, "h": 0.8},
                {"matrix": [5, 3], "x": 2.4, "y": 7, "w": 0.8, "h": 0.8},
                {"matrix": [5, 4], "x": 3.2, "y": 7, "w": 0.8, "h": 0.8},
                {"matrix": [5, 5], "x": 4, "y": 7, "w": 0.8, "h": 0.8},

                {"matrix": [11, 0], "x": 12.2, "y": 7, "w": 0.8, "h": 0.8},
                {"matrix": [11, 1], "x": 13, "y": 7, "w": 0.8, "h": 0.8},
                {"matrix": [11, 2], "x": 13.8, "y": 7, "w": 0.8, "h": 0.8},
                {"matrix": [11, 3], "x": 14.6, "y": 7, "w": 0.8, "h": 0.8},
                {"matrix": [11, 4], "x": 15.4, "y": 7, "w": 0.8, "h": 0.8},
                {"matrix": [11, 5], "x": 16.2, "y": 7, "w": 0.8, "h": 0.8},

                {"matrix": [0, 7], "x": 0, "y": 7.8, "w": 0.8, "h": 0.8},
                {"matrix": [1, 7], "x": 0.8, "y": 7.8, "w": 0.8, "h": 0.8},
                {"matrix": [2, 7], "x": 1.6, "y": 7.8, "w": 0.8, "h": 0.8},

M keyboards/rgbkb/sol3/rev1/rev1.c => keyboards/rgbkb/sol3/rev1/rev1.c +4 -28
@@ 13,27 13,12 @@
#define NUMBER_OF_TOUCH_ENCODERS 2
#define TOUCH_ENCODER_OPTIONS TOUCH_SEGMENTS + 2

#define NUMBER_OF_ENCODERS 6
#define ENCODER_OPTIONS 2

typedef struct PACKED {
    uint8_t r;
    uint8_t c;
} encodermap_t;

// this maps encoders and then touch encoders to their respective electrical matrix entry
// mapping is row (y) then column (x) when looking at the electrical layout
const encodermap_t encoder_map[NUMBER_OF_ENCODERS][ENCODER_OPTIONS] = 
{
    { {  5, 0 }, {  5, 1 } }, // Encoder 0 matrix entries
    { {  5, 2 }, {  5, 3 } }, // Encoder 1 matrix entries
    { {  5, 4 }, {  5, 5 } }, // Encoder 2 matrix entries
    { { 11, 0 }, { 11, 1 } }, // Encoder 3 matrix entries
    { { 11, 2 }, { 11, 3 } }, // Encoder 4 matrix entries
    { { 11, 4 }, { 11, 5 } }  // Encoder 5 matrix entries
};

const encodermap_t touch_encoder_map[NUMBER_OF_TOUCH_ENCODERS][TOUCH_ENCODER_OPTIONS] = 
const encodermap_t touch_encoder_map[NUMBER_OF_TOUCH_ENCODERS][TOUCH_ENCODER_OPTIONS] =
{
    { { 1, 7 }, { 0, 7 }, { 2, 7 }, {  5, 6 }, {  5, 7 }, }, // Touch Encoder 0 matrix entries
    { { 7, 7 }, { 6, 7 }, { 8, 7 }, { 11, 6 }, { 11, 7 }, }  // Touch Encoder 1 matrix entries


@@ 43,7 28,7 @@ static bool limit_lightning = true;

RGB rgb_matrix_hsv_to_rgb(HSV hsv) {
    if (limit_lightning) hsv.v /= 2;
    return hsv_to_rgb(hsv); 
    return hsv_to_rgb(hsv);
}

bool dip_switch_update_kb(uint8_t index, bool active) {


@@ 72,15 57,6 @@ static void process_encoder_matrix(encodermap_t pos) {
    action_exec(MAKE_KEYEVENT(pos.r, pos.c, false));
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise))
        return false;

    // Mapping clockwise (typically increase) to zero, and counter clockwise (decrease) to 1
    process_encoder_matrix(encoder_map[index][clockwise ? 0 : 1]);
    return false;
}

bool touch_encoder_update_kb(uint8_t index, bool clockwise) {
    if (!touch_encoder_update_user(index, clockwise))
        return false;


@@ 189,7 165,7 @@ void rgb_matrix_increase_flags(void)
#endif


__attribute__((weak)) 
__attribute__((weak))
void render_layer_status(void) {
    // Keymap specific, expected to be overridden
    // Host Keyboard Layer Status


@@ 245,7 221,7 @@ oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
bool oled_task_kb(void) {
    if (!oled_task_user())
        return false;
    

    if (is_keyboard_left()) {
        render_icon();
        oled_write_P(PSTR("     "), false);

M keyboards/rmi_kb/chevron/info.json => keyboards/rmi_kb/chevron/info.json +1 -61
@@ 10,7 10,7 @@
    },
    "matrix_pins": {
        "cols": ["A5", "A6", "A7", "C7", "C6", "C5", "C4", "C3", "C2", "C1", "A4", "A3", "A2", "B4"],
        "rows": ["D5", "D6", "C0", "D7", null]
        "rows": ["D5", "D6", "C0", "D7"]
    },
    "diode_direction": "COL2ROW",
    "encoder": {


@@ 136,66 136,6 @@
                {"matrix": [3, 12], "x": 12, "y": 4, "w": 1.25},
                {"matrix": [3, 13], "x": 13.25, "y": 4, "w": 1.25}
            ]
        },
        "LAYOUT_all": {
            "layout": [
                {"matrix": [4, 0], "x": 11.5, "y": 0},
                {"matrix": [1, 13], "x": 12.5, "y": 0},
                {"matrix": [4, 1], "x": 13.5, "y": 0},

                {"matrix": [0, 0], "x": 0, "y": 1},
                {"matrix": [0, 1], "x": 1, "y": 1},
                {"matrix": [0, 2], "x": 2, "y": 1},
                {"matrix": [0, 3], "x": 3, "y": 1},
                {"matrix": [0, 4], "x": 4, "y": 1},
                {"matrix": [0, 5], "x": 5, "y": 1},
                {"matrix": [0, 6], "x": 6, "y": 1},
                {"matrix": [0, 7], "x": 7, "y": 1},
                {"matrix": [0, 8], "x": 8, "y": 1},
                {"matrix": [0, 9], "x": 9, "y": 1},
                {"matrix": [0, 10], "x": 10, "y": 1},
                {"matrix": [0, 11], "x": 11, "y": 1},
                {"matrix": [0, 12], "x": 12, "y": 1},
                {"matrix": [0, 13], "x": 13, "y": 1, "w": 1.5},

                {"matrix": [1, 0], "x": 0, "y": 2, "w": 1.25},
                {"matrix": [1, 1], "x": 1.25, "y": 2},
                {"matrix": [1, 2], "x": 2.25, "y": 2},
                {"matrix": [1, 3], "x": 3.25, "y": 2},
                {"matrix": [1, 4], "x": 4.25, "y": 2},
                {"matrix": [1, 5], "x": 5.25, "y": 2},
                {"matrix": [1, 6], "x": 6.25, "y": 2},
                {"matrix": [1, 7], "x": 7.25, "y": 2},
                {"matrix": [1, 8], "x": 8.25, "y": 2},
                {"matrix": [1, 9], "x": 9.25, "y": 2},
                {"matrix": [1, 10], "x": 10.25, "y": 2},
                {"matrix": [1, 11], "x": 11.25, "y": 2},
                {"matrix": [1, 12], "x": 12.25, "y": 2, "w": 2.25},

                {"matrix": [2, 0], "x": 0, "y": 3, "w": 1.75},
                {"matrix": [2, 1], "x": 1.75, "y": 3},
                {"matrix": [2, 2], "x": 2.75, "y": 3},
                {"matrix": [2, 3], "x": 3.75, "y": 3},
                {"matrix": [2, 4], "x": 4.75, "y": 3},
                {"matrix": [2, 5], "x": 5.75, "y": 3},
                {"matrix": [2, 6], "x": 6.75, "y": 3},
                {"matrix": [2, 7], "x": 7.75, "y": 3},
                {"matrix": [2, 8], "x": 8.75, "y": 3},
                {"matrix": [2, 9], "x": 9.75, "y": 3},
                {"matrix": [2, 10], "x": 10.75, "y": 3},
                {"matrix": [2, 12], "x": 11.75, "y": 3, "w": 1.75},
                {"matrix": [2, 13], "x": 13.5, "y": 3},

                {"matrix": [3, 0], "x": 0, "y": 4, "w": 1.25},
                {"matrix": [3, 1], "x": 1.25, "y": 4, "w": 1.25},
                {"matrix": [3, 2], "x": 2.5, "y": 4, "w": 1.25},
                {"matrix": [3, 4], "x": 3.75, "y": 4, "w": 3},
                {"matrix": [3, 6], "x": 6.75, "y": 4},
                {"matrix": [3, 8], "x": 7.75, "y": 4, "w": 3},
                {"matrix": [3, 11], "x": 10.75, "y": 4, "w": 1.25},
                {"matrix": [3, 12], "x": 12, "y": 4, "w": 1.25},
                {"matrix": [3, 13], "x": 13.25, "y": 4, "w": 1.25}
            ]
        }
    }
}

M keyboards/rmi_kb/chevron/keymaps/via/keymap.c => keyboards/rmi_kb/chevron/keymaps/via/keymap.c +15 -47
@@ 16,29 16,29 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
                                                                                                           KC_VOLD, KC_MUTE, KC_VOLU,
    [0] = LAYOUT_ansi(
                                                                                                                    KC_MUTE,
        KC_ESC,  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_TAB,  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_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT,          MO(1),
        KC_LCTL, KC_LGUI, KC_LALT,          KC_SPC,           MO(1),            KC_BSPC,                   KC_RALT, KC_RGUI, KC_RCTL
    ),
    [1] = LAYOUT_all(
                                                                                                           _______, _______, _______,
    [1] = LAYOUT_ansi(
                                                                                                                    _______,
        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_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  _______,          _______,
        _______, KC_F11,  KC_F12,  _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______,          _______,          _______,          _______,                   _______, _______, _______
    ),
    [2] = LAYOUT_all(
                                                                                                           _______, _______, _______,
    [2] = LAYOUT_ansi(
                                                                                                                    _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,  _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______,          _______,          _______,          _______,                   _______, _______, _______
    ),
    [3] = LAYOUT_all(
                                                                                                           _______, _______, _______,
    [3] = LAYOUT_ansi(
                                                                                                                    _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,  _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,


@@ 46,43 46,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    ),
};

keyevent_t encoder_ccw = {
    .key = (keypos_t){.row = 4, .col = 0},
    .pressed = false,
    .type = KEY_EVENT
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};

keyevent_t encoder_cw = {
    .key = (keypos_t){.row = 4, .col = 1},
    .pressed = false,
    .type = KEY_EVENT
};

void matrix_scan_user(void) {
    if (encoder_ccw.pressed) {
        encoder_ccw.pressed = false;
        encoder_ccw.time = timer_read();
        action_exec(encoder_ccw);
    }

    if (encoder_cw.pressed) {
        encoder_cw.pressed = false;
        encoder_cw.time = timer_read();
        action_exec(encoder_cw);
    }
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    if (clockwise) {
        encoder_cw.pressed = true;
        encoder_cw.time = timer_read();
        action_exec(encoder_cw);
        wait_ms(20);
    } else {
        encoder_ccw.pressed = true;
        encoder_ccw.time = timer_read();
        action_exec(encoder_ccw);
        wait_ms(20);
    }
    return true;
}
#endif

M keyboards/rmi_kb/chevron/keymaps/via/rules.mk => keyboards/rmi_kb/chevron/keymaps/via/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/rmi_kb/herringbone/pro/info.json => keyboards/rmi_kb/herringbone/pro/info.json +1 -3
@@ 329,9 329,7 @@
                {"matrix": [5, 9], "x": 10, "y": 5.25, "w": 1.5},
                {"matrix": [5, 10], "x": 11.5, "y": 5.25, "w": 1.5},

                {"matrix": [5, 12], "x": 13.25, "y": 5.5},
                {"matrix": [5, 13], "x": 14.25, "y": 5.5},
                {"matrix": [5, 14], "x": 15.25, "y": 5.5}
                {"matrix": [5, 13], "x": 14.25, "y": 5.5}
            ]
        }
    }

M keyboards/rmi_kb/herringbone/pro/keymaps/via/keymap.c => keyboards/rmi_kb/herringbone/pro/keymaps/via/keymap.c +11 -47
@@ 19,7 19,7 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        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_VOLD, KC_MUTE, KC_VOLU,
        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_BSPC, KC_HOME,
        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,


@@ 27,7 27,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_LCTL, KC_LGUI, KC_LALT,          KC_NO,   KC_SPC,           KC_NO,   KC_RALT, KC_RCTL,                   KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_all(
        QK_BOOT,   _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        QK_BOOT,   _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,


@@ 35,7 35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______,          _______, _______,          _______,  _______, _______,                   _______, _______, _______
    ),
    [2] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,


@@ 43,7 43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______,          _______, _______,          _______,  _______, _______,                   _______, _______, _______
    ),
    [3] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,


@@ 52,31 52,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    ),
};

keyevent_t encoder_ccw = {
    .key = (keypos_t){.row = 6, .col = 0},
    .pressed = false,
    .type = KEY_EVENT
 };

keyevent_t encoder_cw = {
    .key = (keypos_t){.row = 6, .col = 1},
    .pressed = false,
    .type = KEY_EVENT
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};

void matrix_scan_user(void) {
    if (encoder_ccw.pressed) {
        encoder_ccw.pressed = false;
        encoder_ccw.time = timer_read();
        action_exec(encoder_ccw);
    }

    if (encoder_cw.pressed) {
        encoder_cw.pressed = false;
        encoder_cw.time = timer_read();
        action_exec(encoder_cw);
    }
}
#endif

#ifdef OLED_ENABLE
uint32_t anim_timer = 0;


@@ 85,25 68,6 @@ uint8_t current_frame = 0;

#define FRAME_DURATION 50

bool encoder_update_user(uint8_t index, bool clockwise) {
    if (clockwise) {
        encoder_cw.pressed = true;
        encoder_cw.time = timer_read();
        action_exec(encoder_cw);
        wait_ms(20);
        anim_sleep = timer_read32();
        oled_on();
    } else {
        encoder_ccw.pressed = true;
        encoder_ccw.time = timer_read();
        action_exec(encoder_ccw);
        wait_ms(20);
        anim_sleep = timer_read32();
        oled_on();
    }
    return true;
}

static void render_pattern(void) {
    void animate(void) {
        oled_set_cursor(4, 0);

M keyboards/rmi_kb/herringbone/pro/keymaps/via/rules.mk => keyboards/rmi_kb/herringbone/pro/keymaps/via/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/rmi_kb/squishytkl/info.json => keyboards/rmi_kb/squishytkl/info.json +1 -4
@@ 460,10 460,7 @@

                {"matrix": [7, 23], "x": 15.25, "y": 5.75},
                {"matrix": [7, 24], "x": 16.25, "y": 5.75},
                {"matrix": [7, 25], "x": 17.25, "y": 5.75},

                {"matrix": [13, 0], "x": 18.5, "y": 0},
                {"matrix": [13, 1], "x": 18.5, "y": 1}
                {"matrix": [7, 25], "x": 17.25, "y": 5.75}
            ]
        }
    }

M keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c => keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c +6 -40
@@ 22,46 22,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        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_DEL,  KC_END,  KC_PGDN,
        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_LSFT, KC_NO,   KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT, KC_NO,            KC_UP,
        KC_LCTL, KC_LGUI, KC_LALT, KC_NO,   KC_NO,            KC_SPC,           KC_NO,            KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT,
        KC_VOLU, KC_VOLD
    ),
        KC_LCTL, KC_LGUI, KC_LALT, KC_NO,   KC_NO,            KC_SPC,           KC_NO,            KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
    )
};

keyevent_t encoder_ccw = {
    .key = (keypos_t){.row = 13, .col = 0},
    .pressed = false,
    .type = KEY_EVENT
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }
};

keyevent_t encoder_cw = {
    .key = (keypos_t){.row = 13, .col = 1},
    .pressed = false,
    .type = KEY_EVENT
};

void matrix_scan_user(void) {
    if (encoder_ccw.pressed) {
        encoder_ccw.pressed = false;
        encoder_ccw.time = timer_read();
        action_exec(encoder_ccw);
    }

    if (encoder_cw.pressed) {
        encoder_cw.pressed = false;
        encoder_cw.time = timer_read();
        action_exec(encoder_cw);
    }
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    if (clockwise) {
        encoder_cw.pressed = true;
        encoder_cw.time = timer_read();
        action_exec(encoder_cw);
    } else {
        encoder_ccw.pressed = true;
        encoder_ccw.time = timer_read();
        action_exec(encoder_ccw);
    }
    return true;
}
#endif

M keyboards/rmi_kb/squishytkl/keymaps/via/rules.mk => keyboards/rmi_kb/squishytkl/keymaps/via/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/rmi_kb/wete/v2/info.json => keyboards/rmi_kb/wete/v2/info.json +1 -4
@@ 396,10 396,7 @@
                {"matrix": [10, 8], "x": 16.25, "y": 5.25},
                {"matrix": [11, 8], "x": 17.25, "y": 5.25},
                {"matrix": [10, 9], "x": 18.25, "y": 5.25},
                {"matrix": [11, 9], "x": 19.25, "y": 5.25},

                {"matrix": [12, 0], "x": 19, "y": 0, "w": 0.5},
                {"matrix": [12, 1], "x": 20.5, "y": 0, "w": 0.5}
                {"matrix": [11, 9], "x": 19.25, "y": 5.25}
            ]
        }
    }

M keyboards/rmi_kb/wete/v2/keymaps/via/keymap.c => keyboards/rmi_kb/wete/v2/keymaps/via/keymap.c +8 -41
@@ 14,6 14,7 @@
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        KC_PSCR, KC_SCRL, KC_PAUS, KC_INS,  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_DEL,


@@ 21,8 22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_P7,   KC_P8,   KC_P9,   KC_PPLS, 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_END,
        KC_P4,   KC_P5,   KC_P6,   KC_NO,   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_PGUP,
        KC_P1,   KC_P2,   KC_P3,   KC_PENT, KC_LSFT, KC_NO,   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_PGDN,
        KC_P0,   KC_NO,   KC_PDOT, KC_NO,   KC_LCTL, KC_LGUI, KC_LALT,                   KC_SPC,                    KC_RALT, KC_RCTL, KC_NO,   KC_LEFT, KC_DOWN, KC_RGHT,
        KC_VOLD, KC_VOLU
        KC_P0,   KC_NO,   KC_PDOT, KC_NO,   KC_LCTL, KC_LGUI, KC_LALT,                   KC_SPC,                    KC_RALT, KC_RCTL, KC_NO,   KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,


@@ 30,49 30,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______,                   _______,                   _______, _______, _______, _______, _______, _______,
        _______, _______
        _______, _______, _______, _______, _______, _______, _______,                   _______,                   _______, _______, _______, _______, _______, _______
    ),
};

keyevent_t encoder_ccw = {
    .key = (keypos_t){.row = 12, .col = 0},
    .pressed = false,
    .type = KEY_EVENT
};

keyevent_t encoder_cw = {
    .key = (keypos_t){.row = 12, .col = 1},
    .pressed = false,
    .type = KEY_EVENT
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) }
};

void matrix_scan_user(void) {
    if (encoder_ccw.pressed) {
        encoder_ccw.pressed = false;
        encoder_ccw.time = timer_read();
        action_exec(encoder_ccw);
    }

    if (encoder_cw.pressed) {
        encoder_cw.pressed = false;
        encoder_cw.time = timer_read();
        action_exec(encoder_cw);
    }
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    if (clockwise) {
        encoder_cw.pressed = true;
        encoder_cw.time = timer_read();
        action_exec(encoder_cw);
    } else {
        encoder_ccw.pressed = true;
        encoder_ccw.time = timer_read();
        action_exec(encoder_ccw);
    }
    return true;
}
#endif

#ifdef RGBLIGHT_ENABLE
// Can probably still be optimized, but I like it as is for clarity

M keyboards/rmi_kb/wete/v2/keymaps/via/rules.mk => keyboards/rmi_kb/wete/v2/keymaps/via/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/sawnsprojects/krush/krush65/hotswap/config.h => keyboards/sawnsprojects/krush/krush65/hotswap/config.h +0 -5
@@ 16,11 16,6 @@

#pragma once

/* Encoders */

#define ENCODERS_CW_KEY  { { 12, 3 } }
#define ENCODERS_CCW_KEY { { 12, 4 } }

/* RGB */
    #define RGBLIGHT_HUE_STEP 8
    #define RGBLIGHT_SAT_STEP 8

D keyboards/sawnsprojects/krush/krush65/hotswap/encoder_actions.c => keyboards/sawnsprojects/krush/krush65/hotswap/encoder_actions.c +0 -53
@@ 1,53 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 * Copyright 2021 drashna jael're (@drashna)
 * Copyright 2021 uybv
 * Copyright 2021 SawnsProjects
 *
 * 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 3 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 "encoder_actions.h"

#ifdef ENCODER_ENABLE
static uint8_t  encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS]    = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS]   = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

#endif

D keyboards/sawnsprojects/krush/krush65/hotswap/encoder_actions.h => keyboards/sawnsprojects/krush/krush65/hotswap/encoder_actions.h +0 -23
@@ 1,23 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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

#include "quantum.h"

void encoder_action_unregister(void);

void encoder_action_register(uint8_t index, bool clockwise);
\ No newline at end of file

D keyboards/sawnsprojects/krush/krush65/hotswap/hotswap.h => keyboards/sawnsprojects/krush/krush65/hotswap/hotswap.h +0 -20
@@ 1,20 0,0 @@
/* Copyright 2021 SawnsProjects
 *
 * 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

#include "quantum.h"
#include "encoder_actions.h"

M keyboards/sawnsprojects/krush/krush65/hotswap/info.json => keyboards/sawnsprojects/krush/krush65/hotswap/info.json +1 -83
@@ 33,7 33,7 @@
    "processor": "atmega32u4",
    "bootloader": "atmel-dfu",
    "layouts": {
        "LAYOUT_all": {
        "LAYOUT": {
            "layout": [
                {"matrix": [0, 0], "x": 0, "y": 0},
                {"matrix": [0, 1], "x": 1, "y": 0},


@@ 111,88 111,6 @@
                {"matrix": [4, 14], "x": 14, "y": 4},
                {"matrix": [4, 15], "x": 15, "y": 4}
            ]
        },
        "LAYOUT_via_rotary": {
            "layout": [
                {"matrix": [0, 0], "x": 0, "y": 0.75},
                {"matrix": [0, 1], "x": 1, "y": 0.75},
                {"matrix": [0, 2], "x": 2, "y": 0.75},
                {"matrix": [0, 3], "x": 3, "y": 0.75},
                {"matrix": [0, 4], "x": 4, "y": 0.75},
                {"matrix": [0, 5], "x": 5, "y": 0.75},
                {"matrix": [0, 6], "x": 6, "y": 0.75},
                {"matrix": [0, 7], "x": 7, "y": 0.75},
                {"matrix": [0, 8], "x": 8, "y": 0.75},
                {"matrix": [0, 9], "x": 9, "y": 0.75},
                {"matrix": [0, 10], "x": 10, "y": 0.75},
                {"matrix": [0, 11], "x": 11, "y": 0.75},
                {"matrix": [0, 12], "x": 12, "y": 0.75},
                {"matrix": [0, 13], "x": 13, "y": 0.75},
                {"matrix": [0, 14], "x": 14, "y": 0.75},
                {"matrix": [0, 15], "x": 15, "y": 0.75},

                {"matrix": [3, 12], "x": 14.75, "y": 0, "w": 0.75, "h": 0.75},
                {"matrix": [4, 12], "x": 15.5, "y": 0, "w": 0.75, "h": 0.75},

                {"matrix": [1, 0], "x": 0, "y": 1.75, "w": 1.5},
                {"matrix": [1, 1], "x": 1.5, "y": 1.75},
                {"matrix": [1, 2], "x": 2.5, "y": 1.75},
                {"matrix": [1, 3], "x": 3.5, "y": 1.75},
                {"matrix": [1, 4], "x": 4.5, "y": 1.75},
                {"matrix": [1, 5], "x": 5.5, "y": 1.75},
                {"matrix": [1, 6], "x": 6.5, "y": 1.75},
                {"matrix": [1, 7], "x": 7.5, "y": 1.75},
                {"matrix": [1, 8], "x": 8.5, "y": 1.75},
                {"matrix": [1, 9], "x": 9.5, "y": 1.75},
                {"matrix": [1, 10], "x": 10.5, "y": 1.75},
                {"matrix": [1, 11], "x": 11.5, "y": 1.75},
                {"matrix": [1, 12], "x": 12.5, "y": 1.75},
                {"matrix": [1, 13], "x": 13.5, "y": 1.75, "w": 1.5},
                {"matrix": [1, 15], "x": 15, "y": 1.75},

                {"matrix": [2, 0], "x": 0, "y": 2.75, "w": 1.75},
                {"matrix": [2, 1], "x": 1.75, "y": 2.75},
                {"matrix": [2, 2], "x": 2.75, "y": 2.75},
                {"matrix": [2, 3], "x": 3.75, "y": 2.75},
                {"matrix": [2, 4], "x": 4.75, "y": 2.75},
                {"matrix": [2, 5], "x": 5.75, "y": 2.75},
                {"matrix": [2, 6], "x": 6.75, "y": 2.75},
                {"matrix": [2, 7], "x": 7.75, "y": 2.75},
                {"matrix": [2, 8], "x": 8.75, "y": 2.75},
                {"matrix": [2, 9], "x": 9.75, "y": 2.75},
                {"matrix": [2, 10], "x": 10.75, "y": 2.75},
                {"matrix": [2, 11], "x": 11.75, "y": 2.75},
                {"matrix": [2, 13], "x": 12.75, "y": 2.75, "w": 2.25},
                {"matrix": [2, 15], "x": 15, "y": 2.75},

                {"matrix": [3, 0], "x": 0, "y": 3.75, "w": 2.25},
                {"matrix": [3, 2], "x": 2.25, "y": 3.75},
                {"matrix": [3, 3], "x": 3.25, "y": 3.75},
                {"matrix": [3, 4], "x": 4.25, "y": 3.75},
                {"matrix": [3, 5], "x": 5.25, "y": 3.75},
                {"matrix": [3, 6], "x": 6.25, "y": 3.75},
                {"matrix": [3, 7], "x": 7.25, "y": 3.75},
                {"matrix": [3, 8], "x": 8.25, "y": 3.75},
                {"matrix": [3, 9], "x": 9.25, "y": 3.75},
                {"matrix": [3, 10], "x": 10.25, "y": 3.75},
                {"matrix": [3, 11], "x": 11.25, "y": 3.75},
                {"matrix": [3, 13], "x": 12.25, "y": 3.75, "w": 1.75},
                {"matrix": [3, 14], "x": 14, "y": 3.75},
                {"matrix": [3, 15], "x": 15, "y": 3.75},

                {"matrix": [4, 0], "x": 0, "y": 4.75, "w": 1.25},
                {"matrix": [4, 2], "x": 1.25, "y": 4.75, "w": 1.25},
                {"matrix": [4, 3], "x": 2.5, "y": 4.75, "w": 1.25},
                {"matrix": [4, 5], "x": 3.75, "y": 4.75, "w": 2.25},
                {"matrix": [4, 6], "x": 6, "y": 4.75, "w": 1.25},
                {"matrix": [4, 7], "x": 7.25, "y": 4.75, "w": 2.75},
                {"matrix": [4, 8], "x": 10, "y": 4.75, "w": 1.25},
                {"matrix": [4, 11], "x": 11.25, "y": 4.75, "w": 1.25},

                {"matrix": [4, 13], "x": 13, "y": 4.75},
                {"matrix": [4, 14], "x": 14, "y": 4.75},
                {"matrix": [4, 15], "x": 15, "y": 4.75}
            ]
        }
    }
}

M keyboards/sawnsprojects/krush/krush65/hotswap/keymaps/default/keymap.c => keyboards/sawnsprojects/krush/krush65/hotswap/keymaps/default/keymap.c +2 -2
@@ 19,7 19,7 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {


    [0] = LAYOUT_all(
    [0] = LAYOUT(
        KC_ESC,  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_GRV,  KC_PSCR, 
        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_DEL,  
        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_PGUP, 


@@ 27,7 27,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_LCTL, KC_LGUI, KC_LALT, KC_SPC,  KC_SPC,  KC_SPC,  MO(1),   KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT  
    ),

    [1] = LAYOUT_all(
    [1] = LAYOUT(
        KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 

M keyboards/sawnsprojects/krush/krush65/hotswap/keymaps/via/keymap.c => keyboards/sawnsprojects/krush/krush65/hotswap/keymaps/via/keymap.c +32 -32
@@ 19,42 19,42 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {


    [0] = LAYOUT_via_rotary(
        KC_ESC,  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_GRV,  KC_PSCR, KC_VOLD ,KC_VOLU, 
        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_DEL,  
        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_PGUP, 
        KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_LSFT, KC_UP,   KC_PGDN, 
        KC_LCTL, KC_LGUI, KC_LALT, KC_SPC,  KC_SPC,  KC_SPC,  MO(1),   KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT  
    [0] = LAYOUT(
        KC_ESC,  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_GRV,  KC_PSCR,
        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_DEL,
        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_PGUP,
        KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_LSFT, KC_UP,   KC_PGDN,
        KC_LCTL, KC_LGUI, KC_LALT, KC_SPC,  KC_SPC,  KC_SPC,  MO(1),   KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
    ),

    [1] = LAYOUT_via_rotary(
        KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS  
    [1] = LAYOUT(
        KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),
    [2] = LAYOUT_via_rotary(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS  
    [2] = LAYOUT(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),
    [3] = LAYOUT_via_rotary(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS  
    [3] = LAYOUT(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),
};


void matrix_scan_user(void) {
    encoder_action_unregister();
}
bool encoder_update_user(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
    return false; // override kb default behavior
};
\ No newline at end of file
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/sawnsprojects/krush/krush65/hotswap/keymaps/via/rules.mk => keyboards/sawnsprojects/krush/krush65/hotswap/keymaps/via/rules.mk +1 -3
@@ 1,5 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes

# Added encoder Action
SRC +=  encoder_actions.c
\ No newline at end of file
ENCODER_MAP_ENABLE = yes

D keyboards/sofle/keymaps/keyhive_via/encoder.c => keyboards/sofle/keymaps/keyhive_via/encoder.c +0 -48
@@ 1,48 0,0 @@
 /* Copyright 2020 Josef Adamcik
  * Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang
  *
  * 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/>.
  */

//Setting up what encoder rotation does. If your encoder can be pressed as a button, that function can be set in Via.

#ifdef ENCODER_ENABLE
    static uint8_t encoder_state[2] = {0};
    //Use these keymap positions to specify the encoder functions on rotate.
    static keypos_t encoder_ccw[2] = {{6, 3}, {6, 8}};
    static keypos_t encoder_cw[2] = {{6, 1}, {6, 6}};

    void encoder_action_unregister(void) {
        for (int index = 0; index < 2; ++index) {
            if (encoder_state[index]) {
                keyevent_t encoder_event = (keyevent_t){.key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], .pressed = false, .time = timer_read(), .type = KEY_EVENT};
                encoder_state[index] = 0;
                action_exec(encoder_event);
            }
        }
    }

    void encoder_action_register(uint8_t index, bool clockwise) {
        keyevent_t encoder_event = (keyevent_t){.key = clockwise ? encoder_cw[index] : encoder_ccw[index], .pressed = true, .time = timer_read(), .type = KEY_EVENT};
        encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
        action_exec(encoder_event);
    }

    void matrix_scan_user(void) { encoder_action_unregister(); }

    bool encoder_update_user(uint8_t index, bool clockwise) {
        encoder_action_register(index, clockwise);
        return false;
    };
#endif

M keyboards/sofle/keymaps/keyhive_via/keymap.c => keyboards/sofle/keymaps/keyhive_via/keymap.c +26 -39
@@ 18,7 18,6 @@
#include QMK_KEYBOARD_H

#include "oled.c"
#include "encoder.c"

// Base layer is the number of layers CYCLE selects from.
#define BASE_LAYERS 2


@@ 35,27 34,6 @@ enum custom_layers {
    _RAISE
};

// Extra keys are added for rotary encoder support in VIA
#define LAYOUT_via( \
    LA1, LA2, LA3, LA4, LA5, LA6,           RA6, RA5, RA4, RA3, RA2, RA1, \
    LB1, LB2, LB3, LB4, LB5, LB6, LB7, RB7, RB6, RB5, RB4, RB3, RB2, RB1, \
    LC1, LC2, LC3, LC4, LC5, LC6, LE1, RE6, RC6, RC5, RC4, RC3, RC2, RC1, \
    LD1, LD2, LD3, LD4, LD5, LD6, LD7, RD7, RD6, RD5, RD4, RD3, RD2, RD1, \
              LE2, LE3, LE4, LE5, LE6, RE5, RE4, RE3, RE2, RE1 \
    ) \
    { \
        { LA1, LA2, LA3, LA4, LA5, LA6, KC_NO }, \
        { LB1, LB2, LB3, LB4, LB5, LB6, LB7   }, \
        { LC1, LC2, LC3, LC4, LC5, LC6, KC_NO }, \
        { LD1, LD2, LD3, LD4, LD5, LD6, LD7   }, \
        { LE1, LE2, LE3, LE4, LE5, LE6, KC_NO }, \
        { RA1, RA2, RA3, RA4, RA5, RA6, KC_NO }, \
        { RB1, RB2, RB3, RB4, RB5, RB6, RB7   }, \
        { RC1, RC2, RC3, RC4, RC5, RC6, KC_NO }, \
        { RD1, RD2, RD3, RD4, RD5, RD6, RD7   }, \
        { RE1, RE2, RE3, RE4, RE5, RE6, KC_NO } \
    }

//Default keymap. This can be changed in Via. Use oled.c to change beavior that Via cannot change.
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*


@@ 74,11 52,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 *            `-----------------------------------'            '------''---------------------------'
 */

[_QWERTY] = LAYOUT_via(
[_QWERTY] = LAYOUT(
   KC_GRV, KC_1   , KC_2   , KC_3   , KC_4   , KC_5   ,                         KC_6    , KC_7   , KC_8   , KC_9   , KC_0   , KC_GRV ,
   KC_ESC, KC_Q   , KC_W   , KC_E   , KC_R   , KC_T   , KC_VOLU,       KC_PGUP, KC_Y    , KC_U   , KC_I   , KC_O   , KC_P   , KC_BSPC,
   KC_TAB, KC_A   , KC_S   , KC_D   , KC_F   , KC_G   , KC_MUTE,       KC_NO  , 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_VOLD,       KC_PGDN, KC_N    , KC_M   , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT,
   KC_ESC, KC_Q   , KC_W   , KC_E   , KC_R   , KC_T   ,                         KC_Y    , KC_U   , KC_I   , KC_O   , KC_P   , KC_BSPC,
   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_MUTE, KC_NO,         KC_N    , KC_M   , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT,
                  KC_LGUI,KC_LALT ,KC_LCTL,MO(_LOWER), KC_ENT ,           KC_SPC  ,MO(_RAISE),KC_RCTL, KC_RALT, KC_RGUI
),
/*


@@ 97,7 75,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 *            `-----------------------------------'            '------''---------------------------'
 */
/*
[_COLEMAK] = LAYOUT_via(
[_COLEMAK] = LAYOUT(
  KC_GRV , KC_1   , KC_2   , KC_3   , KC_4   , KC_5   ,                          KC_6    , KC_7   , KC_8   , KC_9   , KC_0   , KC_GRV ,
  KC_ESC , KC_Q   , KC_W   , KC_F   , KC_P   , KC_G   , KC_VOLU,       KC_PGUP,  KC_J    , KC_L   , KC_U   , KC_Y   , KC_SCLN, KC_BSPC,
  KC_TAB , KC_A   , KC_R   , KC_S   , KC_T   , KC_D   , KC_MUTE,       KC_NO  ,  KC_H    , KC_N   , KC_E   , KC_I   , KC_O   , KC_QUOT,


@@ 121,11 99,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 *            |      |      |      |      |/       /          \      \ |      |      |      |      |
 *            `-----------------------------------'            '------''---------------------------'
 */
[_COLEMAK] = LAYOUT_via(
[_COLEMAK] = LAYOUT(
  KC_GRV , KC_1   , KC_2   , KC_3   , KC_4   , KC_5   ,                          KC_6    , KC_7   , KC_8   , KC_9   , KC_0   , KC_GRV ,
  KC_ESC , KC_Q   , KC_W   , KC_F   , KC_P   , KC_B   , KC_VOLU,       KC_PGUP,  KC_J    , KC_L   , KC_U   , KC_Y   , KC_SCLN, KC_BSPC,
  KC_TAB , KC_A   , KC_R   , KC_S   , KC_T   , KC_G   , KC_MUTE,       KC_NO  ,  KC_M    , KC_N   , KC_E   , KC_I   , KC_O   , KC_QUOT,
  KC_LSFT, KC_Z   , KC_X   , KC_C   , KC_D   , KC_V   , KC_VOLD,       KC_PGDN,  KC_K    , KC_H   , KC_COMM,  KC_DOT, KC_SLSH, KC_RSFT,
  KC_ESC , KC_Q   , KC_W   , KC_F   , KC_P   , KC_B   ,                          KC_J    , KC_L   , KC_U   , KC_Y   , KC_SCLN, KC_BSPC,
  KC_TAB , KC_A   , KC_R   , KC_S   , KC_T   , KC_G   ,                          KC_M    , KC_N   , KC_E   , KC_I   , KC_O   , KC_QUOT,
  KC_LSFT, KC_Z   , KC_X   , KC_C   , KC_D   , KC_V   , _______, _______,        KC_K    , KC_H   , KC_COMM,  KC_DOT, KC_SLSH, KC_RSFT,
                  KC_LGUI, KC_LALT,KC_LCTL,MO(_LOWER), KC_ENT ,           KC_SPC ,MO(_RAISE),KC_RCTL, KC_RALT, KC_RGUI
),



@@ 143,11 121,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 *            |      |      |      |      |/       /          \      \ |      |      |      |      |
 *            `-----------------------------------'            '------''---------------------------'
 */
[_LOWER] = LAYOUT_via(
[_LOWER] = LAYOUT(
  _______, KC_F1  , KC_F2  , KC_F3  , KC_F4  , KC_F5  ,                         KC_F6  , KC_F7  , KC_F8  , KC_F9  , KC_F10 , KC_F11 ,
  KC_GRV , KC_1   , KC_2   , KC_3   , KC_4   , KC_5   , _______,       _______, KC_6   , KC_7   , KC_8   , KC_9   , KC_0   , KC_F12 ,
  _______, KC_EXLM, KC_AT  , KC_HASH, KC_DLR , KC_PERC, _______,       _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE,
  _______, KC_EQL , KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, _______,       _______, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, _______,
  KC_GRV , KC_1   , KC_2   , KC_3   , KC_4   , KC_5   ,                         KC_6   , KC_7   , KC_8   , KC_9   , KC_0   , KC_F12 ,
  _______, KC_EXLM, KC_AT  , KC_HASH, KC_DLR , KC_PERC,                         KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE,
  _______, KC_EQL , KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR,  _______,   _______,    KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, _______,
                  _______, _______, _______, _______, _______,           _______, _______, _______, _______, _______
),
/* RAISE


@@ 164,11 142,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 *            |      |      |      |      |/      /           \      \ |      |      |      |      |
 *            `----------------------------------'             '------''---------------------------'
 */
[_RAISE] = LAYOUT_via(
[_RAISE] = LAYOUT(
    CYCLE, _______, _______, _______, _______ , _______,                       _______, _______, _______, _______, _______, _______,
  _______, KC_INS , KC_PSCR, KC_APP , XXXXXXX , XXXXXXX, _______,    _______,  KC_PGUP, _______, KC_UP  , _______, _______, KC_BSPC,
  _______, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX , KC_CAPS, _______,    _______,  KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL , KC_BSPC,
  _______, KC_UNDO, KC_CUT , KC_COPY, KC_PASTE, XXXXXXX, _______,    _______,  XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, _______,
  _______, KC_INS , KC_PSCR, KC_APP , XXXXXXX , XXXXXXX,                       KC_PGUP, _______, KC_UP  , _______, _______, KC_BSPC,
  _______, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX , KC_CAPS,                       KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL , KC_BSPC,
  _______, KC_UNDO, KC_CUT , KC_COPY, KC_PASTE, XXXXXXX, _______, _______,      XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, _______,
                   _______, _______, _______, _______, _______,        _______, _______, _______, _______, _______
)
};


@@ 189,3 167,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    // this uses less memory than returning in each case.
    return keycode < SAFE_RANGE;
};

 #ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =   { ENCODER_CCW_CW(KC_BSPC, KC_DEL),  ENCODER_CCW_CW(KC_PGDN, KC_PGUP)  },
    [1] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [2] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  },
    [3] =   { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______)  }
};
#endif

M keyboards/sofle/keymaps/keyhive_via/rules.mk => keyboards/sofle/keymaps/keyhive_via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
RGBLIGHT_ENABLE = yes
ENCODER_MAP_ENABLE = yes

D keyboards/stello65/beta/beta.c => keyboards/stello65/beta/beta.c +0 -18
@@ 1,18 0,0 @@
// Copyright 2021 @wekey (@@wekey)
// SPDX-License-Identifier: GPL-2.0-or-later

#include "quantum.h"

#if defined(ENCODER_ENABLE)
bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) { return false; }
    if (index == 0) {
        if (clockwise) {
            tap_code_delay(KC_VOLU, 10);
        } else {
            tap_code_delay(KC_VOLD, 10);
        }
    }
    return true;
}
#endif

M keyboards/synthlabs/solo/config.h => keyboards/synthlabs/solo/config.h +0 -3
@@ 3,9 3,6 @@

#pragma once

#define ENCODERS_CW_KEY { { 2, 1 } }
#define ENCODERS_CCW_KEY { { 0, 1 } }

#define JOYSTICK_BUTTON_COUNT 13
#define JOYSTICK_AXIS_COUNT 1
#define JOYSTICK_AXIS_RESOLUTION 16

M keyboards/synthlabs/solo/info.json => keyboards/synthlabs/solo/info.json +3 -15
@@ 36,11 36,7 @@
                {"label": "P2 5", "x": 5, "y": 0, "w": 0.5, "h": 1.5, "matrix": [0, 4]},
                {"label": "P1 6", "x": 5.5, "y": 0, "w": 0.5, "h": 1.5, "matrix": [0, 5]},
                {"label": "P2 7", "x": 6, "y": 0, "w": 0.5, "h": 1.5, "matrix": [0, 6]},

                {"label": "Knob CCW", "x": 0, "y": 1.25, "w": 0.5, "matrix": [1, 0]},
                {"label": "Knob Press", "x": 0.5, "y": 1, "w": 1.5, "h": 1.5, "matrix": [1, 1]},
                {"label": "Knob CW", "x": 2, "y": 1.25, "w": 0.5, "matrix": [1, 2]},

                {"label":"Knob Press", "x":0.5, "y":1, "w":1.5, "h":1.5, "matrix":[1,1]},
                {"label": "P1 1", "x": 3, "y": 2, "w": 0.5, "h": 1.5, "matrix": [2, 0]},
                {"label": "P2 2", "x": 3.5, "y": 2, "w": 0.5, "h": 1.5, "matrix": [2, 1]},
                {"label": "P1 3", "x": 4, "y": 2, "w": 0.5, "h": 1.5, "matrix": [2, 2]},


@@ 55,11 51,7 @@
                {"label": "P1 2", "x": 3.5, "y": 0, "w": 0.5, "h": 1.5, "matrix": [0, 1]},
                {"label": "P1 4", "x": 4.5, "y": 0, "w": 0.5, "h": 1.5, "matrix": [0, 3]},
                {"label": "P1 6", "x": 5.5, "y": 0, "w": 0.5, "h": 1.5, "matrix": [0, 5]},

                {"label": "Knob CCW", "x": 0, "y": 1.25, "w": 0.5, "matrix": [1, 0]},
                {"label": "Knob Press", "x": 0.5, "y": 1, "w": 1.5, "h": 1.5, "matrix": [1, 1]},
                {"label": "Knob CW", "x": 2, "y": 1.25, "w": 0.5, "matrix": [1, 2]},

                {"label":"Knob Press", "x":0.5, "y":1, "w":1.5, "h":1.5, "matrix":[1,1]},
                {"label": "P1 1", "x": 3, "y": 2, "w": 0.5, "h": 1.5, "matrix": [2, 0]},
                {"label": "P1 3", "x": 4, "y": 2, "w": 0.5, "h": 1.5, "matrix": [2, 2]},
                {"label": "P1 5", "x": 5, "y": 2, "w": 0.5, "h": 1.5, "matrix": [2, 4]},


@@ 71,11 63,7 @@
                {"label": "P2 6", "x": 0.5, "y": 0, "w": 0.5, "h": 1.5, "matrix": [2, 5]},
                {"label": "P2 4", "x": 1.5, "y": 0, "w": 0.5, "h": 1.5, "matrix": [2, 3]},
                {"label": "P2 2", "x": 2.5, "y": 0, "w": 0.5, "h": 1.5, "matrix": [2, 1]},

                {"label": "Knob CCW", "x": 4, "y": 1.25, "w": 0.5, "matrix": [1, 0]},
                {"label": "Knob Press", "x": 4.5, "y": 1, "w": 1.5, "h": 1.5, "matrix": [1, 1]},
                {"label": "Knob CW", "x": 6, "y": 1.25, "w": 0.5, "matrix": [1, 2]},

                {"label":"Knob Press", "x":4.5, "y":1, "w":1.5, "h":1.5, "matrix":[1,1]},
                {"label": "P2 7", "x": 0, "y": 2, "w": 0.5, "h": 1.5, "matrix": [0, 6]},
                {"label": "P2 5", "x": 1, "y": 2, "w": 0.5, "h": 1.5, "matrix": [0, 4]},
                {"label": "P2 3", "x": 2, "y": 2, "w": 0.5, "h": 1.5, "matrix": [0, 2]},

M keyboards/synthlabs/solo/keymaps/default/keymap.c => keyboards/synthlabs/solo/keymaps/default/keymap.c +1 -1
@@ 6,7 6,7 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
                                       KC_J,    KC_U,    KC_K,    KC_I,    KC_L,    KC_O, KC_SCLN,
        _______, KC_MUTE, _______,
        KC_MUTE,
                                       KC_J,    KC_U,    KC_K,    KC_I,    KC_L,    KC_O, KC_SCLN
    )
};

M keyboards/synthlabs/solo/keymaps/gamepad/keymap.c => keyboards/synthlabs/solo/keymaps/gamepad/keymap.c +1 -1
@@ 6,7 6,7 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
                                    JS_0,JS_1,JS_2,JS_3,JS_4,JS_5,JS_6,
          KC_NO,   JS_7,  KC_NO,
        JS_7,
                                    JS_0,JS_1,JS_2,JS_3,JS_4,JS_5,JS_6
    )
};

M keyboards/synthlabs/solo/keymaps/via/keymap.c => keyboards/synthlabs/solo/keymaps/via/keymap.c +11 -44
@@ 6,64 6,31 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
                                       KC_J,    KC_U,    KC_K,    KC_I,    KC_L,    KC_O, KC_SCLN,
        KC_VOLD, KC_MUTE, KC_VOLU,
        KC_MUTE,
                                       KC_J,    KC_U,    KC_K,    KC_I,    KC_L,    KC_O, KC_SCLN
    ),
    [1] = LAYOUT_all(
                                    _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,
        _______,
                                    _______, _______, _______, _______, _______, _______, _______
    ),
    [2] = LAYOUT_all(
                                    _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,
        _______,
                                    _______, _______, _______, _______, _______, _______, _______
    ),
    [3] = LAYOUT_all(
                                    _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,
        _______,
                                    _______, _______, _______, _______, _______, _______, _______
    )
};

#if defined(VIA_ENABLE) && defined(ENCODER_ENABLE)
static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_user(void) {
    encoder_action_unregister();
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
    return false;
}

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/synthlabs/solo/keymaps/via/rules.mk => keyboards/synthlabs/solo/keymaps/via/rules.mk +1 -0
@@ 1,1 1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

D keyboards/synthlabs/solo/solo.c => keyboards/synthlabs/solo/solo.c +0 -18
@@ 1,18 0,0 @@
// Copyright 2022 Aaron Hong (@hongaaronc)
// SPDX-License-Identifier: GPL-2.0-or-later

#include "quantum.h"

#if !defined(VIA_ENABLE) && !defined(JOYSTICK_ENABLE) && defined(ENCODER_ENABLE)
bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) { return false; }
    if (index == 0) {
        if (clockwise) {
            tap_code_delay(KC_VOLU, 10);
        } else {
            tap_code_delay(KC_VOLD, 10);
        }
    }
    return true;
}
#endif

D keyboards/takashicompany/dogtag/dogtag.c => keyboards/takashicompany/dogtag/dogtag.c +0 -48
@@ 1,48 0,0 @@
/* Copyright 2021 takashicompany
 *
 * 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 "quantum.h"

bool encoder_update_kb(uint8_t index, bool clockwise) {
    keypos_t key;
    if (index == 0) {
        if (clockwise) {
            key.row = 2;
            key.col = 1;
        } else {
            key.row = 2;
            key.col = 0;
        }
        uint8_t layer = layer_switch_get_layer(key);
        uint16_t keycode = keymap_key_to_keycode(layer, key);

        tap_code16(keycode);
    } else {
        if (clockwise) {
            key.row = 5;
            key.col = 0;
        } else {
            key.row = 5;
            key.col = 1;
        }
        uint8_t  layer   = layer_switch_get_layer(key);
        uint16_t keycode = keymap_key_to_keycode(layer, key);

        tap_code16(keycode);
    }

    return true;
}

M keyboards/takashicompany/dogtag/info.json => keyboards/takashicompany/dogtag/info.json +1 -7
@@ 80,13 80,7 @@
                {"matrix": [4, 1], "x": 8, "y": 1},
                {"matrix": [4, 2], "x": 9, "y": 1},
                {"matrix": [4, 3], "x": 10, "y": 1},
                {"matrix": [4, 4], "x": 11, "y": 1},

                {"matrix": [2, 0], "x": 3.5, "y": 3.25},
                {"matrix": [2, 1], "x": 4.5, "y": 3.25},

                {"matrix": [5, 0], "x": 6.5, "y": 3.25},
                {"matrix": [5, 1], "x": 7.5, "y": 3.25}
                {"matrix": [4, 4], "x": 11, "y": 1}
            ]
        }
    }

M keyboards/takashicompany/dogtag/keymaps/default/keymap.c => keyboards/takashicompany/dogtag/keymaps/default/keymap.c +11 -6
@@ 16,15 16,20 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    LAYOUT(
    [0] = LAYOUT(
        LT(1, KC_ESC), KC_Q, KC_W, KC_E,                 KC_Y, KC_U, KC_I, KC_O,
        KC_LSFT,       KC_A, KC_S, KC_D, KC_SPC, KC_TAB, KC_H, KC_J, KC_K, KC_L,
        KC_WH_U, KC_WH_D, KC_WH_U, KC_WH_D
        KC_LSFT,       KC_A, KC_S, KC_D, KC_SPC, KC_TAB, KC_H, KC_J, KC_K, KC_L
    ),

    LAYOUT(
    [1] = LAYOUT(
        KC_TRNS, RGB_MOD, RGB_HUI, RGB_SAI,                   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, RGB_M_P, RGB_M_K, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_WH_L, KC_WH_R, KC_WH_L, KC_WH_R
        KC_TRNS, RGB_M_P, RGB_M_K, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN), ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) },
    [1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
};
#endif

A keyboards/takashicompany/dogtag/keymaps/default/rules.mk => keyboards/takashicompany/dogtag/keymaps/default/rules.mk +1 -0
@@ 0,0 1,1 @@
ENCODER_MAP_ENABLE = yes

M keyboards/takashicompany/dogtag/keymaps/via/keymap.c => keyboards/takashicompany/dogtag/keymaps/via/keymap.c +9 -4
@@ 18,13 18,18 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    LAYOUT(
        LT(1, KC_ESC), KC_Q, KC_W, KC_E,                 KC_Y, KC_U, KC_I, KC_O,
        KC_LSFT,       KC_A, KC_S, KC_D, KC_SPC, KC_TAB, KC_H, KC_J, KC_K, KC_L,
        KC_WH_U, KC_WH_D, KC_WH_U, KC_WH_D
        KC_LSFT,       KC_A, KC_S, KC_D, KC_SPC, KC_TAB, KC_H, KC_J, KC_K, KC_L
    ),

    LAYOUT(
        KC_TRNS, RGB_MOD, RGB_HUI, RGB_SAI,                   KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, RGB_M_P, RGB_M_K, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_WH_L, KC_WH_R, KC_WH_L, KC_WH_R
        KC_TRNS, RGB_M_P, RGB_M_K, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    )
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN), ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) },
    [1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
};
#endif

M keyboards/takashicompany/dogtag/keymaps/via/rules.mk => keyboards/takashicompany/dogtag/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/takashicompany/spreadwriter/info.json => keyboards/takashicompany/spreadwriter/info.json +1 -3
@@ 105,9 105,7 @@
                {"matrix": [7, 3], "x": 12, "y": 3},
                {"matrix": [7, 4], "x": 13, "y": 3.25},
                {"matrix": [7, 5], "x": 14, "y": 3.5},
                {"matrix": [7, 6], "x": 15, "y": 3.5},
                {"matrix": [0, 6], "x": 7, "y": 4.25},
                {"matrix": [4, 0], "x": 8, "y": 4.25}
                {"matrix": [7, 6], "x": 15, "y": 3.5}
            ]
        }
    }

M keyboards/takashicompany/spreadwriter/keymaps/default/keymap.c => keyboards/takashicompany/spreadwriter/keymaps/default/keymap.c +11 -19
@@ 13,56 13,49 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_ESC, LT(2, KC_Q), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
        KC_LCTL, KC_A, KC_S, LT(2, KC_D), KC_F, KC_G, SPREADWRITER, KC_H, KC_J, LT(2, KC_K), KC_L, KC_ENT, KC_ENT,
        KC_LSFT, SFT_T(KC_Z), GUI_T(KC_X), KC_C, KC_V, KC_B, MEH(KC_4), LSA(KC_5),  KC_N, KC_M, KC_COMM, CTL_T(KC_DOT), KC_BSPC, KC_DEL,
        KC_LCTL, KC_LGUI, KC_LALT, MO(5), MO(4), ALT_T(KC_LNG2), SFT_T(KC_TAB), WEB, LT(6, KC_SPC), LT(1, KC_LNG1), KC_RALT, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT,
        KC_WH_U, KC_WH_D
        KC_LCTL, KC_LGUI, KC_LALT, MO(5), MO(4), ALT_T(KC_LNG2), SFT_T(KC_TAB), WEB, LT(6, KC_SPC), LT(1, KC_LNG1), KC_RALT, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT
    ),

    LAYOUT(
        KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
        KC_LCTL, CTL_T(KC_EQL), KC_LBRC, KC_SLSH, KC_MINS, KC_INT1, KC_TRNS, KC_SCLN, KC_QUOT, KC_RBRC, KC_NUHS, KC_INT3, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),

    LAYOUT(
        KC_ESC, KC_TAB, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO,
        KC_TRNS, KC_LCTL, KC_TRNS, KC_QUES, KC_EXLM, KC_NO, KC_TRNS, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_BSPC, KC_SPC
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),

    LAYOUT(
        RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
        KC_TRNS, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
        KC_TRNS, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, RGB_M_T, KC_TRNS, QK_BOOT, KC_F11, KC_F12, KC_CAPS, KC_NO, KC_NO, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS
        KC_TRNS, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, RGB_M_T, KC_TRNS, QK_BOOT, KC_F11, KC_F12, KC_CAPS, KC_NO, KC_NO, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),

    LAYOUT(
        KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_INT3, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_NUHS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_COMM, KC_DOT, KC_SLSH, KC_INT1, KC_TRNS,
        KC_TRNS, KC_TRNS
        KC_TRNS, KC_TRNS, KC_P0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_COMM, KC_DOT, KC_SLSH, KC_INT1, KC_TRNS
    ),

    LAYOUT(
        KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_INT3), KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_LBRC), S(KC_RBRC), KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_SCLN), S(KC_QUOT), S(KC_NUHS), KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_COMM), S(KC_DOT), S(KC_SLSH), S(KC_INT1), KC_TRNS,
        KC_TRNS, KC_TRNS
        KC_TRNS, KC_TRNS, KC_P0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_COMM), S(KC_DOT), S(KC_SLSH), S(KC_INT1), KC_TRNS
    ),

    LAYOUT(
        KC_TRNS, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), G(KC_INT3), KC_TRNS,
        KC_LCTL, S(KC_EQL), S(KC_LBRC), S(KC_SLSH), S(KC_MINS), S(KC_INT1), KC_TRNS, S(KC_SCLN), S(KC_QUOT), S(KC_RBRC), S(KC_NUHS), S(KC_INT3), KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    )
};



@@ 81,7 74,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
            }
            return false;
    }
    

    return true;
}



@@ 92,6 85,5 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    } else {
        tap_code(KC_MS_WH_UP);
    }

    return true;
}
\ No newline at end of file
    return false;
}

M keyboards/takashicompany/spreadwriter/keymaps/via/keymap.c => keyboards/takashicompany/spreadwriter/keymaps/via/keymap.c +14 -57
@@ 13,56 13,49 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_ESC, LT(2, KC_Q), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
        KC_LCTL, KC_A, KC_S, LT(2, KC_D), KC_F, KC_G, SPREADWRITER, KC_H, KC_J, LT(2, KC_K), KC_L, KC_ENT, KC_ENT,
        KC_LSFT, SFT_T(KC_Z), GUI_T(KC_X), KC_C, KC_V, KC_B, MEH(KC_4), LSA(KC_5),  KC_N, KC_M, KC_COMM, CTL_T(KC_DOT), KC_BSPC, KC_DEL,
        KC_LCTL, KC_LGUI, KC_LALT, MO(5), MO(4), ALT_T(KC_LNG2), SFT_T(KC_TAB), WEB, LT(6, KC_SPC), LT(1, KC_LNG1), KC_RALT, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT,
        KC_WH_U, KC_WH_D
        KC_LCTL, KC_LGUI, KC_LALT, MO(5), MO(4), ALT_T(KC_LNG2), SFT_T(KC_TAB), WEB, LT(6, KC_SPC), LT(1, KC_LNG1), KC_RALT, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT
    ),

    LAYOUT(
        KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
        KC_LCTL, CTL_T(KC_EQL), KC_LBRC, KC_SLSH, KC_MINS, KC_INT1, KC_TRNS, KC_SCLN, KC_QUOT, KC_RBRC, KC_NUHS, KC_INT3, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),

    LAYOUT(
        KC_ESC, KC_TAB, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO,
        KC_TRNS, KC_LCTL, KC_TRNS, KC_QUES, KC_EXLM, KC_NO, KC_TRNS, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_BSPC, KC_SPC
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),

    LAYOUT(
        RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
        KC_TRNS, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
        KC_TRNS, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, RGB_M_T, KC_TRNS, QK_BOOT, KC_F11, KC_F12, KC_CAPS, KC_NO, KC_NO, KC_TRNS, 
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS
        KC_TRNS, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, RGB_M_T, KC_TRNS, QK_BOOT, KC_F11, KC_F12, KC_CAPS, KC_NO, KC_NO, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    ),

    LAYOUT(
        KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_INT3, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_NUHS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_COMM, KC_DOT, KC_SLSH, KC_INT1, KC_TRNS,
        KC_TRNS, KC_TRNS
        KC_TRNS, KC_TRNS, KC_P0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_COMM, KC_DOT, KC_SLSH, KC_INT1, KC_TRNS
    ),

    LAYOUT(
        KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_INT3), KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_LBRC), S(KC_RBRC), KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_SCLN), S(KC_QUOT), S(KC_NUHS), KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_P0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_COMM), S(KC_DOT), S(KC_SLSH), S(KC_INT1), KC_TRNS,
        KC_TRNS, KC_TRNS
        KC_TRNS, KC_TRNS, KC_P0, KC_COMM, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_COMM), S(KC_DOT), S(KC_SLSH), S(KC_INT1), KC_TRNS
    ),

    LAYOUT(
        KC_TRNS, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), G(KC_INT3), KC_TRNS,
        KC_LCTL, S(KC_EQL), S(KC_LBRC), S(KC_SLSH), S(KC_MINS), S(KC_INT1), KC_TRNS, S(KC_SCLN), S(KC_QUOT), S(KC_RBRC), S(KC_NUHS), S(KC_INT3), KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    )
};



@@ 81,49 74,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
            }
            return false;
    }
    
    return true;
}

//------------------------------------------------------------------------------
// Rotary Encoder
//------------------------------------------------------------------------------
static uint8_t  encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS]    = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS]   = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
    return true;
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
    return true;
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =       { ENCODER_CCW_CW(KC_WH_U, KC_WH_D) },
    [1 ... 6] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/takashicompany/spreadwriter/keymaps/via/rules.mk => keyboards/takashicompany/spreadwriter/keymaps/via/rules.mk +2 -1
@@ 1,1 1,2 @@
VIA_ENABLE = yes
\ No newline at end of file
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/tkc/portico75/info.json => keyboards/tkc/portico75/info.json +0 -91
@@ 113,97 113,6 @@
                {"matrix": [5, 12], "x": 14.25, "y": 5.5},
                {"matrix": [5, 13], "x": 15.25, "y": 5.5}
            ]
        },
        "LAYOUT_75_via": {
            "layout": [
                {"matrix": [0, 0], "x": 0, "y": 0},
                {"matrix": [0, 1], "x": 1, "y": 0},
                {"matrix": [0, 2], "x": 2, "y": 0},
                {"matrix": [0, 3], "x": 3, "y": 0},
                {"matrix": [0, 4], "x": 4, "y": 0},
                {"matrix": [0, 5], "x": 5, "y": 0},
                {"matrix": [0, 6], "x": 6, "y": 0},
                {"matrix": [0, 7], "x": 7, "y": 0},
                {"matrix": [0, 8], "x": 8, "y": 0},
                {"matrix": [0, 9], "x": 9, "y": 0},
                {"matrix": [0, 10], "x": 10, "y": 0},
                {"matrix": [0, 11], "x": 11, "y": 0},
                {"matrix": [0, 12], "x": 12, "y": 0},
                {"matrix": [0, 13], "x": 13, "y": 0},
                {"matrix": [0, 14], "x": 14, "y": 0},

                {"matrix": [1, 0], "x": 15, "y": 0},
                {"matrix": [1, 1], "x": 16, "y": 0},
                {"matrix": [1, 2], "x": 17, "y": 0},
                {"matrix": [1, 3], "x": 18, "y": 0},
                {"matrix": [1, 4], "x": 19, "y": 0},
                {"matrix": [1, 5], "x": 20, "y": 0},
                {"matrix": [1, 6], "x": 21, "y": 0},
                {"matrix": [1, 7], "x": 22, "y": 0},
                {"matrix": [1, 8], "x": 23, "y": 0},
                {"matrix": [1, 9], "x": 24, "y": 0},
                {"matrix": [1, 10], "x": 25, "y": 0},
                {"matrix": [1, 11], "x": 26, "y": 0},
                {"matrix": [1, 12], "x": 27, "y": 0},
                {"matrix": [1, 13], "x": 28, "y": 0},
                {"matrix": [1, 14], "x": 29, "y": 0},

                {"matrix": [2, 0], "x": 30, "y": 0},
                {"matrix": [2, 1], "x": 31, "y": 0},
                {"matrix": [2, 2], "x": 32, "y": 0},
                {"matrix": [2, 3], "x": 33, "y": 0},
                {"matrix": [2, 4], "x": 34, "y": 0},
                {"matrix": [2, 5], "x": 35, "y": 0},
                {"matrix": [2, 6], "x": 36, "y": 0},
                {"matrix": [2, 7], "x": 37, "y": 0},
                {"matrix": [2, 8], "x": 38, "y": 0},
                {"matrix": [2, 9], "x": 39, "y": 0},
                {"matrix": [2, 10], "x": 40, "y": 0},
                {"matrix": [2, 11], "x": 41, "y": 0},
                {"matrix": [2, 12], "x": 42, "y": 0},
                {"matrix": [2, 13], "x": 43, "y": 0},
                {"matrix": [2, 14], "x": 44, "y": 0},

                {"matrix": [3, 0], "x": 45, "y": 0},
                {"matrix": [3, 1], "x": 46, "y": 0},
                {"matrix": [3, 2], "x": 47, "y": 0},
                {"matrix": [3, 3], "x": 48, "y": 0},
                {"matrix": [3, 4], "x": 49, "y": 0},
                {"matrix": [3, 5], "x": 50, "y": 0},
                {"matrix": [3, 6], "x": 51, "y": 0},
                {"matrix": [3, 7], "x": 52, "y": 0},
                {"matrix": [3, 8], "x": 53, "y": 0},
                {"matrix": [3, 9], "x": 54, "y": 0},
                {"matrix": [3, 10], "x": 55, "y": 0},
                {"matrix": [3, 11], "x": 56, "y": 0},
                {"matrix": [3, 12], "x": 57, "y": 0},
                {"matrix": [3, 14], "x": 58, "y": 0},

                {"matrix": [4, 0], "x": 59, "y": 0},
                {"matrix": [4, 1], "x": 60, "y": 0},
                {"matrix": [4, 2], "x": 61, "y": 0},
                {"matrix": [4, 3], "x": 62, "y": 0},
                {"matrix": [4, 4], "x": 63, "y": 0},
                {"matrix": [4, 5], "x": 64, "y": 0},
                {"matrix": [4, 6], "x": 65, "y": 0},
                {"matrix": [4, 7], "x": 66, "y": 0},
                {"matrix": [4, 8], "x": 67, "y": 0},
                {"matrix": [4, 9], "x": 68, "y": 0},
                {"matrix": [4, 10], "x": 69, "y": 0},
                {"matrix": [4, 11], "x": 70, "y": 0},
                {"matrix": [4, 12], "x": 71, "y": 0},
                {"matrix": [4, 14], "x": 72, "y": 0},

                {"matrix": [5, 0], "x": 73, "y": 0},
                {"matrix": [5, 1], "x": 74, "y": 0},
                {"matrix": [5, 2], "x": 75, "y": 0},
                {"matrix": [5, 5], "x": 76, "y": 0},
                {"matrix": [5, 9], "x": 77, "y": 0},
                {"matrix": [5, 10], "x": 78, "y": 0},
                {"matrix": [5, 11], "x": 79, "y": 0},
                {"matrix": [5, 12], "x": 80, "y": 0},
                {"matrix": [5, 13], "x": 81, "y": 0}
            ]
        }
    }
}

M keyboards/tkc/portico75/keymaps/via/keymap.c => keyboards/tkc/portico75/keymaps/via/keymap.c +15 -15
@@ 27,47 27,47 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
//  BR_INC, BR_DEC,   // backlight brightness increase/decrease

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_75_via(
    [0] = LAYOUT_75_ansi(
        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_HOME,
        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_DEL,
        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_VOLD,
        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_VOLU,
        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_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_LCTL, KC_LGUI, KC_LALT,                    KC_SPC,                            KC_RALT,   MO(1), KC_LEFT, KC_DOWN, KC_RGHT
    ),
#ifdef RGB_BACKLIGHT_PORTICO75
    [1] = LAYOUT_75_via(
    [1] = LAYOUT_75_ansi(
        _______,  EF_INC,  EF_DEC,  H1_INC,  H1_DEC,  S1_INC,  S1_DEC,  H2_INC,  H2_DEC,  S2_INC,  S2_DEC,  BR_INC,  BR_DEC, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,                   _______,                            _______, _______, _______, _______, _______
    ),
#else
    [1] = LAYOUT_75_via(
    [1] = LAYOUT_75_ansi(
        _______, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,                   _______,                            _______, _______, _______, _______, _______
    ),
#endif
    [2] = LAYOUT_75_via(
    [2] = LAYOUT_75_ansi(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,                   _______,                            _______, _______, _______, _______, _______
    ),
    [3] = LAYOUT_75_via(
    [3] = LAYOUT_75_ansi(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,                   _______,                            _______, _______, _______, _______, _______
    )
};

D keyboards/wekey/we27/encoder_actions.c => keyboards/wekey/we27/encoder_actions.c +0 -52
@@ 1,52 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 * Copyright 2021 drashna jael're (@drashna)
 * Copyright 2021 uybv
 *
 * 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 3 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 "encoder_actions.h"

#ifdef ENCODER_ENABLE
static uint8_t  encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS]    = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS]   = ENCODERS_CCW_KEY;

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index]) {
            keyevent_t encoder_event = (keyevent_t) {
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

#endif

D keyboards/wekey/we27/encoder_actions.h => keyboards/wekey/we27/encoder_actions.h +0 -23
@@ 1,23 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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

#include "quantum.h"

void encoder_action_unregister(void);

void encoder_action_register(uint8_t index, bool clockwise);

M keyboards/wekey/we27/info.json => keyboards/wekey/we27/info.json +0 -39
@@ 63,45 63,6 @@
                {"matrix": [5, 3], "x": 3, "y": 5.5},
                {"matrix": [4, 4], "x": 4, "y": 4.5, "h": 2}
            ]
        },
        "LAYOUT_numpad_6x5_encoder": {
            "layout": [
                {"matrix": [0, 0], "x": 0, "y": 0.75},
                {"matrix": [0, 1], "x": 1, "y": 0.75},
                {"matrix": [0, 2], "x": 2, "y": 0.75},
                {"matrix": [0, 3], "x": 3, "y": 0.75},
                {"matrix": [0, 4], "x": 4, "y": 0.75},

                {"matrix": [3, 4], "x": 3.75, "y": 0, "w": 0.75, "h": 0.75},
                {"matrix": [5, 4], "x": 4.5, "y": 0, "w": 0.75, "h": 0.75},

                {"matrix": [1, 0], "x": 0, "y": 2.25},
                {"matrix": [1, 1], "x": 1, "y": 2.25},
                {"matrix": [1, 2], "x": 2, "y": 2.25},
                {"matrix": [1, 3], "x": 3, "y": 2.25},
                {"matrix": [1, 4], "x": 4, "y": 2.25},

                {"matrix": [2, 0], "x": 0, "y": 3.25},
                {"matrix": [2, 1], "x": 1, "y": 3.25},
                {"matrix": [2, 2], "x": 2, "y": 3.25},
                {"matrix": [2, 3], "x": 3, "y": 3.25},

                {"matrix": [3, 0], "x": 0, "y": 4.25},
                {"matrix": [3, 1], "x": 1, "y": 4.25},
                {"matrix": [3, 2], "x": 2, "y": 4.25},
                {"matrix": [3, 3], "x": 3, "y": 4.25},
                {"matrix": [2, 4], "x": 4, "y": 3.25, "h": 2},

                {"matrix": [4, 0], "x": 0, "y": 5.25},
                {"matrix": [4, 1], "x": 1, "y": 5.25},
                {"matrix": [4, 2], "x": 2, "y": 5.25},
                {"matrix": [4, 3], "x": 3, "y": 5.25},

                {"matrix": [5, 0], "x": 0, "y": 6.25},
                {"matrix": [5, 1], "x": 1, "y": 6.25, "w": 2},
                {"matrix": [5, 3], "x": 3, "y": 6.25},
                {"matrix": [4, 4], "x": 4, "y": 5.25, "h": 2}
            ]
        }
    }
}

M keyboards/wekey/we27/keymaps/default/keymap.c => keyboards/wekey/we27/keymaps/default/keymap.c +18 -9
@@ 17,32 17,32 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
	/* Base */
	[0] = LAYOUT_numpad_6x5_encoder(
		KC_ESC , KC_PWR , KC_SLEP, KC_F11 , KC_MUTE, KC_VOLD, KC_VOLU,
	[0] = LAYOUT_numpad_6x5(
		KC_ESC , KC_PWR , KC_SLEP, KC_F11 , KC_MUTE,
		KC_NUM,  KC_BSPC, KC_PSLS, KC_PAST, KC_PMNS,
		RGB_MOD, KC_P7  , KC_P8  , KC_P9  ,
		RGB_RMOD, KC_P4  , KC_P5  , KC_P6  , KC_PPLS,
		RGB_TOG, KC_P1  , KC_P2  , KC_P3  ,
		MO(1)  , KC_P0  ,          KC_PDOT, KC_PENT
	),
	[1] = LAYOUT_numpad_6x5_encoder(
		_______, _______, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT,
	[1] = LAYOUT_numpad_6x5(
		_______, _______, _______, _______, KC_MPLY,
		_______, _______, _______, _______, _______,
		RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI,
		RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______,
		_______, _______, _______, _______, 
		_______, _______, _______, _______,
		_______, _______,          _______, QK_BOOT
	),
	[2] = LAYOUT_numpad_6x5_encoder(
		_______, _______, _______, _______, _______, _______, _______,
	[2] = LAYOUT_numpad_6x5(
		_______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______,
		_______, _______, _______, _______,
		_______, _______, _______, _______, _______,
		_______, _______, _______, _______,
		_______, _______,          _______, _______
	),
	[3] = LAYOUT_numpad_6x5_encoder(
		_______, _______, _______, _______, _______, _______, _______,
	[3] = LAYOUT_numpad_6x5(
		_______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______,
		_______, _______, _______, _______,
		_______, _______, _______, _______, _______,


@@ 50,3 50,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
		_______, _______,          _______, _______
	)
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

A keyboards/wekey/we27/keymaps/default/rules.mk => keyboards/wekey/we27/keymaps/default/rules.mk +1 -0
@@ 0,0 1,1 @@
ENCODER_MAP_ENABLE = yes

M keyboards/wekey/we27/keymaps/via/keymap.c => keyboards/wekey/we27/keymaps/via/keymap.c +18 -9
@@ 17,32 17,32 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
	/* Base */
	[0] = LAYOUT_numpad_6x5_encoder(
		KC_ESC , KC_PWR , KC_SLEP, KC_F11 , KC_MUTE, KC_VOLD, KC_VOLU,
	[0] = LAYOUT_numpad_6x5(
		KC_ESC , KC_PWR , KC_SLEP, KC_F11 , KC_MUTE,
		KC_NUM,  KC_BSPC, KC_PSLS, KC_PAST, KC_PMNS,
		RGB_MOD, KC_P7  , KC_P8  , KC_P9  ,
		RGB_RMOD, KC_P4  , KC_P5  , KC_P6  , KC_PPLS,
		RGB_TOG, KC_P1  , KC_P2  , KC_P3  ,
		MO(1)  , KC_P0  ,          KC_PDOT, KC_PENT
	),
	[1] = LAYOUT_numpad_6x5_encoder(
		_______, _______, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT,
	[1] = LAYOUT_numpad_6x5(
		_______, _______, _______, _______, KC_MPLY,
		_______, _______, _______, _______, _______,
		RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI,
		RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______,
		_______, _______, _______, _______, 
		_______, _______, _______, _______,
		_______, _______,          _______, QK_BOOT
	),
	[2] = LAYOUT_numpad_6x5_encoder(
		_______, _______, _______, _______, _______, _______, _______,
	[2] = LAYOUT_numpad_6x5(
		_______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______,
		_______, _______, _______, _______,
		_______, _______, _______, _______, _______,
		_______, _______, _______, _______,
		_______, _______,          _______, _______
	),
	[3] = LAYOUT_numpad_6x5_encoder(
		_______, _______, _______, _______, _______, _______, _______,
	[3] = LAYOUT_numpad_6x5(
		_______, _______, _______, _______, _______,
		_______, _______, _______, _______, _______,
		_______, _______, _______, _______,
		_______, _______, _______, _______, _______,


@@ 50,3 50,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
		_______, _______,          _______, _______
	)
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/wekey/we27/keymaps/via/rules.mk => keyboards/wekey/we27/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

M keyboards/wekey/we27/rules.mk => keyboards/wekey/we27/rules.mk +0 -2
@@ 15,5 15,3 @@ RGB_MATRIX_ENABLE = yes     # Use RGB matrix

DEBOUNCE_TYPE	  = sym_defer_pk
RGB_MATRIX_CUSTOM_KB = yes

SRC += encoder_actions.c

M keyboards/wekey/we27/we27.c => keyboards/wekey/we27/we27.c +0 -12
@@ 15,7 15,6 @@
 */

#include "quantum.h"
#include "encoder_actions.h"

#ifdef RGB_MATRIX_ENABLE



@@ 45,14 44,3 @@ led_config_t g_led_config = { {
} };

#endif

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    if (!encoder_update_user(index, clockwise)) { return false; }
    encoder_action_register(index, clockwise);
    return true;
};

D keyboards/winry/winry315/keymaps/via/encoder_actions.c => keyboards/winry/winry315/keymaps/via/encoder_actions.c +0 -80
@@ 1,80 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 * Copyright 2021 drashna jael're (@drashna)
 * Copyright 2022 Sergey Vlasov (@sigprof)
 *
 * 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 3 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 "encoder_actions.h"

#if defined(VIA_ENABLE) && defined(ENCODER_ENABLE)

#    ifndef ENCODER_TAP_DURATION_MS
#        define ENCODER_TAP_DURATION_MS 10
#    endif

#    define ENCODER_STATE_CW 0x01
#    define ENCODER_STATE_CCW 0x02

static uint8_t  encoder_state[NUM_ENCODERS] = {0};
static uint16_t encoder_timer[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS]    = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS]   = ENCODERS_CCW_KEY;

static void exec_encoder_action(uint8_t index, bool clockwise, bool pressed) {
    // clang-format off
    keyevent_t encoder_event = (keyevent_t) {
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = pressed,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    // clang-format on
    action_exec(encoder_event);
}

void encoder_action_unregister(void) {
    for (int index = 0; index < NUM_ENCODERS; ++index) {
        if (encoder_state[index] && (timer_elapsed(encoder_timer[index]) >= ENCODER_TAP_DURATION_MS)) {
            bool clockwise       = !!(encoder_state[index] & ENCODER_STATE_CW);
            encoder_state[index] = 0;
            exec_encoder_action(index, clockwise, false);
        }
    }
}

void encoder_action_register(uint8_t index, bool clockwise) {
    if (encoder_state[index]) {
        bool was_clockwise   = !!(encoder_state[index] & ENCODER_STATE_CW);
        encoder_state[index] = 0;
        exec_encoder_action(index, was_clockwise, false);
    }
    encoder_state[index] = clockwise ? ENCODER_STATE_CW : ENCODER_STATE_CCW;
    encoder_timer[index] = timer_read();
    exec_encoder_action(index, clockwise, true);
}

void matrix_scan_kb(void) {
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise) {
    encoder_action_register(index, clockwise);
    // don't return user actions, because they are in the keymap
    // encoder_update_user(index, clockwise);
    return true;
};

#endif

D keyboards/winry/winry315/keymaps/via/encoder_actions.h => keyboards/winry/winry315/keymaps/via/encoder_actions.h +0 -21
@@ 1,21 0,0 @@
/* Copyright 2020 Neil Brian Ramirez
 *
 * 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 3 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 "quantum.h"

void encoder_action_unregister(void);

void encoder_action_register(uint8_t index, bool clockwise);

M keyboards/winry/winry315/keymaps/via/keymap.c => keyboards/winry/winry315/keymaps/via/keymap.c +11 -16
@@ 5,36 5,23 @@

// clang-format off

#define LAYOUT_via(             \
      k17,     k15,    k16,     \
    k23,k22, k19,k18, k21,k20,  \
     k00, k01, k02, k03, k04,   \
     k05, k06, k07, k08, k09,   \
     k10, k11, k12, k13, k14    \
) { \
    { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23 } \
}

#define U_LTESC LT(1, KC_ESC)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_via(
    [0] = LAYOUT_top(
            KC_HOME,           KC_MUTE,           KC_MPLY,
        KC_PGUP, KC_PGDN,  KC_VOLD, KC_VOLU,  KC_MPRV, KC_MNXT,
             KC_1,    KC_2,    KC_3,    KC_4,    KC_5,
             KC_6,    KC_7,    KC_8,    KC_9,    KC_0,
             U_LTESC, KC_TAB,  KC_SPC,  KC_BSPC, KC_ENT
    ),
    [1] = LAYOUT_via(
    [1] = LAYOUT_top(
            RGB_M_P,           RGB_M_B,           RGB_M_R,
        RGB_HUD, RGB_HUI,  RGB_SAD, RGB_SAI,  RGB_VAD, RGB_VAI,
             RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI,
             RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD,
             KC_TRNS, RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_R
    ),
    [2 ... 7] = LAYOUT_via(
    [2 ... 7] = LAYOUT_top(
            KC_TRNS,           KC_TRNS,           KC_TRNS,
        KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS,
             KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
             KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
             KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS


@@ 42,3 29,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};

// clang-format on

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] =        { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_MPRV, KC_MNXT) },
    [1] =        { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) },
    [2 ... 7] =  { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }
};
#endif

M keyboards/winry/winry315/keymaps/via/rules.mk => keyboards/winry/winry315/keymaps/via/rules.mk +1 -2
@@ 1,4 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes

SRC += encoder_actions.c
ENCODER_MAP_ENABLE = yes

M keyboards/wuque/mammoth20x/config.h => keyboards/wuque/mammoth20x/config.h +0 -4
@@ 22,7 22,3 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.

/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE

// Note:  array is { col, row )
#define ENCODERS_CW_KEY  { { 3, 2 } }
#define ENCODERS_CCW_KEY { { 3, 4 } }

M keyboards/wuque/mammoth20x/info.json => keyboards/wuque/mammoth20x/info.json +0 -2
@@ 29,9 29,7 @@
                {"matrix": [0, 0], "x": 0, "y": 0},
                {"matrix": [0, 1], "x": 1, "y": 0},
                {"matrix": [0, 2], "x": 2, "y": 0},
                {"matrix": [2, 3], "x": 3, "y": 0, "w": 0.5},
                {"matrix": [0, 3], "x": 3.5, "y": 0},
                {"matrix": [4, 3], "x": 4.5, "y": 0, "w": 0.5},

                {"matrix": [1, 0], "x": 0, "y": 1},
                {"matrix": [1, 1], "x": 1, "y": 1},

M keyboards/wuque/mammoth20x/keymaps/default/keymap.c => keyboards/wuque/mammoth20x/keymaps/default/keymap.c +2 -2
@@ 18,7 18,7 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT(
        KC_ESC,  KC_PAUS, KC_DEL,  KC_VOLU, KC_MUTE, KC_VOLD,
        KC_ESC,  KC_PAUS, KC_DEL,  KC_MUTE,
        KC_LNUM, KC_PSLS, KC_PAST, KC_PMNS,
        KC_P7,   KC_P8,   KC_P9,
        KC_P4,   KC_P5,   KC_P6,   KC_PPLS,


@@ 26,7 26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_P0,            KC_PDOT, KC_PENT
    ),
    [1] = LAYOUT(
        _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______,
        _______, _______, _______, _______,

M keyboards/wuque/mammoth20x/keymaps/via/keymap.c => keyboards/wuque/mammoth20x/keymaps/via/keymap.c +13 -4
@@ 18,7 18,7 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT(
        KC_ESC,  KC_PAUS, KC_DEL,  KC_VOLD, KC_MUTE, KC_VOLU,
        KC_ESC,  KC_PAUS, KC_DEL,  KC_MUTE,
        KC_NUM,  KC_PSLS, KC_PAST, KC_PMNS,
        KC_P7,   KC_P8,   KC_P9,
        KC_P4,   KC_P5,   KC_P6,   KC_PPLS,


@@ 26,7 26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_P0,            KC_PDOT, KC_PENT
    ),
    [1] = LAYOUT(
        _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______,
        _______, _______, _______, _______,


@@ 34,7 34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______,          _______, _______
    ),
    [2] = LAYOUT(
        _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______,
        _______, _______, _______, _______,


@@ 42,7 42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______,          _______, _______
    ),
    [3] = LAYOUT(
        _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______,
        _______, _______, _______, _______,


@@ 50,3 50,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______,          _______, _______
    ),
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/wuque/mammoth20x/keymaps/via/rules.mk => keyboards/wuque/mammoth20x/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

D keyboards/wuque/mammoth20x/mammoth20x.c => keyboards/wuque/mammoth20x/mammoth20x.c +0 -62
@@ 1,62 0,0 @@
/* Copyright 2021 wuquestudio
 *
 * 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 "quantum.h"

static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;

void encoder_action_unregister(void)
{
    for (int index = 0; index < NUM_ENCODERS; ++index)
    {
        if (encoder_state[index])
        {
            keyevent_t encoder_event = (keyevent_t){
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}
void encoder_action_register(uint8_t index, bool clockwise)
{
    keyevent_t encoder_event = (keyevent_t){
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_kb(void)
{
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise)
{
    encoder_action_register(index, clockwise);
    return true;
};

M keyboards/wuque/mammoth75x/config.h => keyboards/wuque/mammoth75x/config.h +0 -4
@@ 22,7 22,3 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.

/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE

// Note:  array is { col, row )
#define ENCODERS_CW_KEY  { { 3, 5 } }
#define ENCODERS_CCW_KEY { { 5, 5 } }

M keyboards/wuque/mammoth75x/info.json => keyboards/wuque/mammoth75x/info.json +0 -3
@@ 41,10 41,7 @@
                {"matrix": [0, 11], "x": 11.75, "y": 0},
                {"matrix": [0, 12], "x": 12.75, "y": 0},
                {"matrix": [0, 13], "x": 14, "y": 0},

                {"matrix": [5, 3], "x": 15.65, "y": 0.125, "w": 0.6, "h": 0.5},
                {"matrix": [0, 14], "x": 15.75, "y": 0.625},
                {"matrix": [5, 5], "x": 16.25, "y": 0.125, "w": 0.6, "h": 0.5},

                {"matrix": [1, 0], "x": 0, "y": 1.25},
                {"matrix": [1, 1], "x": 1, "y": 1.25},

M keyboards/wuque/mammoth75x/keymaps/default/keymap.c => keyboards/wuque/mammoth75x/keymaps/default/keymap.c +2 -2
@@ 18,7 18,7 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        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_DEL,           KC_VOLD, KC_MUTE,KC_VOLU,
        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_DEL, 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_BSPC,
        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_INS, 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_END, KC_PGDN,


@@ 26,7 26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_LCTL, KC_LGUI, KC_LALT,          KC_SPC,           KC_SPC,           KC_SPC,           KC_RALT, MO(1),   KC_RCTL,               KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          KC_MPRV, KC_MPLY, KC_MNXT,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,               _______, QK_BOOT,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,               _______, _______,

M keyboards/wuque/mammoth75x/keymaps/via/keymap.c => keyboards/wuque/mammoth75x/keymaps/via/keymap.c +13 -4
@@ 18,7 18,7 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        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_DEL,           KC_VOLD, KC_MUTE,KC_VOLU,
        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_DEL, 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_BSPC,
        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_INS, 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_END, KC_PGDN,


@@ 26,7 26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        KC_LCTL, KC_LGUI, KC_LALT,          KC_SPC,           KC_SPC,           KC_SPC,           KC_RALT, MO(1),   KC_RCTL,               KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          KC_MPRV, KC_MPLY, KC_MNXT,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,               _______, QK_BOOT,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,               _______, _______,


@@ 34,7 34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______,          _______,          _______,          _______,          _______, _______, _______,               _______, _______, _______
    ),
    [2] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,               _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,               _______, _______,


@@ 42,7 42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______,          _______,          _______,          _______,          _______, _______, _______,               _______, _______, _______
    ),
    [3] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,               _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,               _______, _______,


@@ 50,3 50,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
        _______, _______, _______,          _______,          _______,          _______,          _______, _______, _______,               _______, _______, _______
    ),
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(KC_MPRV, KC_MNXT) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/wuque/mammoth75x/keymaps/via/rules.mk => keyboards/wuque/mammoth75x/keymaps/via/rules.mk +1 -0
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

D keyboards/wuque/mammoth75x/mammoth75x.c => keyboards/wuque/mammoth75x/mammoth75x.c +0 -64
@@ 1,64 0,0 @@
/* Copyright 2021 wuquestudio
 *
 * 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 "quantum.h"

#ifdef VIA_ENABLE
static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;

void encoder_action_unregister(void)
{
    for (int index = 0; index < NUM_ENCODERS; ++index)
    {
        if (encoder_state[index])
        {
            keyevent_t encoder_event = (keyevent_t){
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}
void encoder_action_register(uint8_t index, bool clockwise)
{
    keyevent_t encoder_event = (keyevent_t){
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_kb(void)
{
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise)
{
    encoder_action_register(index, clockwise);
    return true;
};
#endif

M keyboards/wuque/serneity65/info.json => keyboards/wuque/serneity65/info.json +0 -2
@@ 41,9 41,7 @@
                {"matrix": [0, 11], "x": 11, "y": 0},
                {"matrix": [0, 12], "x": 12, "y": 0},
                {"matrix": [0, 13], "x": 13, "y": 0},
                {"matrix": [4, 3], "x": 15, "y": 0, "w": 0.5},
                {"matrix": [0, 14], "x": 15.5, "y": 0},
                {"matrix": [4, 5], "x": 16.5, "y": 0, "w": 0.5},

                {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
                {"matrix": [1, 1], "x": 1.5, "y": 1},

M keyboards/wuque/serneity65/keymaps/default/keymap.c => keyboards/wuque/serneity65/keymaps/default/keymap.c +4 -4
@@ 18,17 18,17 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        KC_ESC,  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_VOLD, KC_MUTE, KC_VOLU,
        KC_ESC,  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_MUTE,
        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_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_BSPC, KC_PGUP,
        KC_LSFT, 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_SPC,           KC_SPC,           KC_RALT, MO(1),   KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_all(
        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,  _______,   KC_MPRV, KC_MPLY, KC_MNXT,
        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,  _______, KC_MPLY,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT,
        _______, _______, _______,          _______,          _______,          _______,          _______, _______, _______, _______, _______
    ),
};
    )
 };

M keyboards/wuque/serneity65/keymaps/via/keymap.c => keyboards/wuque/serneity65/keymaps/via/keymap.c +13 -4
@@ 18,31 18,40 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        KC_ESC,  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_VOLD, KC_MUTE, KC_VOLU,
        KC_ESC,  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_MUTE,
        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_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_BSPC, KC_PGUP,
        KC_LSFT, 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_SPC,           KC_SPC,           KC_RALT, MO(1),   KC_LEFT, KC_DOWN, KC_RGHT
    ),
    [1] = LAYOUT_all(
        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,  _______,   KC_MPRV, KC_MPLY, KC_MNXT,
        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,  _______, KC_MPLY,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT,
        _______, _______, _______,          _______,          _______,          _______,          _______, _______, _______, _______, _______
    ),
    [2] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,   _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,          _______,          _______,          _______,          _______, _______, _______, _______, _______
    ),
    [3] = LAYOUT_all(
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,   _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,  _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______,          _______,          _______,          _______,          _______, _______, _______, _______, _______
    ),
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(KC_MPRV, KC_MNXT) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

M keyboards/wuque/serneity65/keymaps/via/rules.mk => keyboards/wuque/serneity65/keymaps/via/rules.mk +2 -1
@@ 1,2 1,3 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes
ENCODER_MAP_ENABLE = yes

D keyboards/wuque/serneity65/serneity65.c => keyboards/wuque/serneity65/serneity65.c +0 -64
@@ 1,64 0,0 @@
/* Copyright 2021 wuque
 *
 * 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 "quantum.h"

#ifdef VIA_ENABLE
static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY;

void encoder_action_unregister(void)
{
    for (int index = 0; index < NUM_ENCODERS; ++index)
    {
        if (encoder_state[index])
        {
            keyevent_t encoder_event = (keyevent_t){
                .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
                .pressed = false,
                .time = timer_read(),
                .type = KEY_EVENT
            };
            encoder_state[index] = 0;
            action_exec(encoder_event);
        }
    }
}
void encoder_action_register(uint8_t index, bool clockwise)
{
    keyevent_t encoder_event = (keyevent_t){
        .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
        .pressed = true,
        .time = timer_read(),
        .type = KEY_EVENT
    };
    encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
    action_exec(encoder_event);
}

void matrix_scan_kb(void)
{
    encoder_action_unregister();
    matrix_scan_user();
}

bool encoder_update_kb(uint8_t index, bool clockwise)
{
    encoder_action_register(index, clockwise);
    return true;
};
#endif

M keyboards/yandrstudio/nz67v2/info.json => keyboards/yandrstudio/nz67v2/info.json +0 -2
@@ 40,10 40,8 @@
                {"matrix": [0, 11], "x": 11, "y": 0.5},
                {"matrix": [0, 12], "x": 12, "y": 0.5},
                {"matrix": [0, 13], "x": 13, "y": 0.5, "w": 2},
                {"matrix": [4, 4], "x": 16, "y": 0},
                {"matrix": [0, 14], "x": 15, "y": 0.5},

                {"matrix": [4, 6], "x": 16, "y": 1},
                {"matrix": [1, 0], "x": 0, "y": 1.5, "w": 1.5},
                {"matrix": [1, 1], "x": 1.5, "y": 1.5},
                {"matrix": [1, 2], "x": 2.5, "y": 1.5},

M keyboards/yandrstudio/nz67v2/keymaps/default/keymap.c => keyboards/yandrstudio/nz67v2/keymaps/default/keymap.c +2 -3
@@ 18,16 18,15 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        KC_ESC,  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_VOLD, KC_HOME, KC_VOLU,
        KC_ESC,  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_HOME,
        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_END,
        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_PGUP,
        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_PGDN,
        KC_LCTL, KC_LGUI, KC_LALT,                   KC_SPC,  KC_SPC,  KC_SPC,           KC_RALT, MO(1),            KC_LEFT, KC_DOWN, KC_RGHT),
    [1] = LAYOUT_all(
        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,  KC_DEL,     KC_TRNS, KC_TRNS, KC_TRNS,
        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,  KC_DEL, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, URGB_K,  RGB_HUI, RGB_HUD, RGB_SAI,  RGB_SAD, KC_TRNS, KC_TRNS, KC_TRNS, GUI_TOG, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS,
        KC_TRNS,          RGB_TOG, RGB_MOD, RGB_RMOD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                    KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS,  KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS)
};


M keyboards/yandrstudio/nz67v2/keymaps/via/keymap.c => keyboards/yandrstudio/nz67v2/keymaps/via/keymap.c +11 -34
@@ 18,59 18,36 @@

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_all(
        KC_ESC,  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_VOLD, KC_HOME, KC_VOLU,
        KC_ESC,  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_HOME,
        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_END,
        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_PGUP,
        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_PGDN,
        KC_LCTL, KC_LGUI, KC_LALT,                   KC_SPC,  KC_SPC,  KC_SPC,           KC_RALT, MO(1),            KC_LEFT, KC_DOWN, KC_RGHT),
    [1] = LAYOUT_all(
        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,  KC_DEL,     KC_TRNS, KC_TRNS, KC_TRNS,
        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,  KC_DEL,  KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, URGB_K,  RGB_HUI, RGB_HUD, RGB_SAI,  RGB_SAD, KC_TRNS, KC_TRNS, KC_TRNS, GUI_TOG, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS,
        KC_TRNS,          RGB_TOG, RGB_MOD, RGB_RMOD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                    KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS,  KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS),
    [2] = LAYOUT_all(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS,
        KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS),
    [3] = LAYOUT_all(
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS,
        KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
        KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS, KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS,          KC_TRNS, KC_TRNS, KC_TRNS)
};
#ifdef ENCODER_ENABLE
keyevent_t encoder1_ccw = {.key = (keypos_t){.row = 4, .col = 4}, .pressed = false, .type = KEY_EVENT};

keyevent_t encoder1_cw = {.key = (keypos_t){.row = 4, .col = 6}, .pressed = false, .type = KEY_EVENT};

void matrix_scan_user(void) {
    if (encoder1_ccw.pressed) {
        encoder1_ccw.pressed = false;
        encoder1_ccw.time    = timer_read();
        action_exec(encoder1_ccw);
    }

    if (encoder1_cw.pressed) {
        encoder1_cw.pressed = false;
        encoder1_cw.time    = timer_read();
        action_exec(encoder1_cw);
    }
}

bool encoder_update_user(uint8_t index, bool clockwise) {
    if (clockwise) {
        encoder1_cw.pressed = true;
        encoder1_cw.time    = timer_read();
        action_exec(encoder1_cw);
    } else {
        encoder1_ccw.pressed = true;
        encoder1_ccw.time    = timer_read();
        action_exec(encoder1_ccw);
    }
    return true;
}
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
    [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
    [1] = { ENCODER_CCW_CW(_______, _______) },
    [2] = { ENCODER_CCW_CW(_______, _______) },
    [3] = { ENCODER_CCW_CW(_______, _______) },
};
#endif

Do not follow this link