forked from filterpaper/qmk_userspace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilterpaper.h
More file actions
85 lines (77 loc) · 2 KB
/
filterpaper.h
File metadata and controls
85 lines (77 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Copyright 2021 @filterpaper
// SPDX-License-Identifier: GPL-2.0+
#pragma once
#include QMK_KEYBOARD_H
// Dimmer RGB colors
#define RGB_BSTEEL 55, 80, 115
#define RGB_DPURPLE 60, 0, 115
#define RGB_DPINK 115, 20, 45
#define RGB_DTEAL 5, 35, 35
#define RGB_FLUOR 75, 122, 22
#define RGB_CAPS RGB_FLUOR
#define RGB_MODS RGB_DPURPLE
#define RGB_LAYER RGB_DPINK
// Custom effects
#ifdef ENABLE_RGB_MATRIX_CANDY_TAP
# define DEF_MODE RGB_MATRIX_CUSTOM_CANDY_TAP
#else
# define DEF_MODE RGB_MATRIX_SOLID_REACTIVE_SIMPLE
#endif
#ifdef ENABLE_RGB_MATRIX_CANDY_RAIN
# define CMK_MODE RGB_MATRIX_CUSTOM_CANDY_RAIN
#else
# define CMK_MODE RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
#endif
// Custom indicators
#if defined(IMK)
# define MOD_FLAG LED_FLAG_UNDERGLOW
# define CAP_FLAG LED_FLAG_UNDERGLOW
#else
# define MOD_FLAG LED_FLAG_MODIFIER
# define CAP_FLAG LED_FLAG_KEYLIGHT
#endif
// Layer and mod tap mask bits
// 0xFF00 bitmask
#define LT0_BITS 0x4000
#define LT1_BITS 0x4100
#define LT2_BITS 0x4200
#define LT3_BITS 0x4300
#define CTL_T_BITS 0x6100
#define SFT_T_BITS 0x6200
#define ALT_T_BITS 0x6400
#define GUI_T_BITS 0x6800
// 0xF000 bitmask
#define LT_BITS LT0_BITS
#define LMT_BITS 0x6000
#define RMT_BITS 0x7000
/* (kc >> 8) & 0x1F for mod bits
*
* Mod bits: 43210
* bit 0 ||||+- Control
* bit 1 |||+-- Shift
* bit 2 ||+--- Alt
* bit 3 |+---- Gui
* bit 4 +----- LR flag(Left:0, Right:1)
*/
/*
enum mods_bit {
MOD_LCTL = 0x01,
MOD_LSFT = 0x02,
MOD_LALT = 0x04,
MOD_LGUI = 0x08,
MOD_RCTL = 0x11,
MOD_RSFT = 0x12,
MOD_RALT = 0x14,
MOD_RGUI = 0x18,
}; */
// Macro for LT(0,kc) mod tap. Return true for kc on tap
// send custom tap code on hold after TAPPING_TERM
#define TAP_HOLD(_hold_) \
if (record->tap.count) return true; \
else if (record->event.pressed) tap_code16(_hold_); \
return false
// Macro to send oneshot mod on tap with mod tap keys
// like LT(1,MOD_LSFT)
#define MT_OSM(_mod_) \
if (record->tap.count && record->event.pressed) { \
add_oneshot_mods(_mod_); return false; }