aboutsummaryrefslogtreecommitdiff
path: root/users/replicaJunction/features/secrets.c
diff options
context:
space:
mode:
authorJoshua T <replicaJunction@users.noreply.github.com>2021-08-13 20:14:21 -0500
committerGitHub <noreply@github.com>2021-08-13 18:14:21 -0700
commitade989962af613b24687f20f54e2dd0e37240216 (patch)
tree7e6e53b4c4151270f465ca16fc4eeb5270a7870d /users/replicaJunction/features/secrets.c
parent424b9ff7090d8407bd6bc56ff42afff05acecb12 (diff)
downloadqmk_firmware-ade989962af613b24687f20f54e2dd0e37240216.tar.gz
qmk_firmware-ade989962af613b24687f20f54e2dd0e37240216.zip
[Keymap] clean up userspace, add XD75 / Keyboardio Atreus (#13121)
Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'users/replicaJunction/features/secrets.c')
-rw-r--r--users/replicaJunction/features/secrets.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/users/replicaJunction/features/secrets.c b/users/replicaJunction/features/secrets.c
new file mode 100644
index 000000000..3e1ea283d
--- /dev/null
+++ b/users/replicaJunction/features/secrets.c
@@ -0,0 +1,51 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17// Before you can compile with this feature, you'll need to manually
18// create a file in this directory called "secret_definitions.h"
19// containing the data to be added.
20//
21// Example implementation:
22//
23// #pragma once
24// static const char * const secrets[] = {
25// "secret1",
26// "secret2",
27// "secret3",
28// "secret4"
29// }
30
31#include QMK_KEYBOARD_H
32#include "replicaJunction.h"
33#include "secrets.h"
34#include "secret_definitions.h"
35
36#ifndef MACRO_TIMER
37# define MACRO_TIMER 5
38#endif
39
40bool process_record_secrets(uint16_t keycode, const keyrecord_t *record) {
41 switch (keycode) {
42 case K_SECR1 ... K_SECR4: // Secrets! Externally defined strings, not stored in repo
43 if (!record->event.pressed) {
44 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
45 send_string_with_delay(secrets[keycode - K_SECR1], MACRO_TIMER);
46 }
47 return false;
48 }
49
50 return true;
51}