summaryrefslogtreecommitdiff
path: root/users/rverst/rverst.h
blob: b7aea556c20e12684a74d8c98cc796a8a058d384 (plain)
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
/* Copyright 2021 Robert Verst <robert@verst.eu> @rverst
 *
 * 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 QMK_KEYBOARD_H

enum userspace_mode {
    MAC = 0,
    WINDOWS,
    MAC_UNI,
    WINDOWS_UNI,
    LINUX_UNI,
};

enum userspace_keycodes {
    RV_NON = SAFE_RANGE,
    RV_SM0,   // set Mac Unicode mode
    RV_SM1,   // set Window Unicode mode
    RV_SM2,   // set Linux Unicode mode
    RV_SM3,   // set Mac lagecy mode
    RV_SM4,   // set Windows legacy mode
    RV_SM0S,  // set Mac Unicode mode and save
    RV_SM1S,  // set Windows Unicode mode and save
    RV_SM2S,  // set Linux Unicode and save
    RV_SM3S,  // set Mac legacy mode
    RV_SM4S,  // set Windows legacy and save
    RV_SAYM,  // say mode
    RV_LOCK,  // lock computer
    RV_AUML,  // äÄ
    RV_OUML,  // öÖ
    RV_UUML,  // üÜ
    RV_EUR,   // €
    RV_SZ,    // ߧ
    RV_TM,    // ™
    RV_RT,    // ®
    RV_CC,    // ©
    RV_DEG,   // °
    RV_SNAP,  // Screenshot
    RV_PM,    // ±
    RV_UNEQ,  // ≠
    RV_SUP1,  // ¹
    RV_SUP2,  // ²
    RV_SUP3,  // ³

};

typedef union {
    uint32_t raw;
    struct {
        bool mode_1 : 1;
        bool mode_2 : 1;
        bool mode_3 : 1;
    };
} userspace_config_t;

extern userspace_config_t userspace_config;

uint8_t  get_mode(void);
void     set_mode(uint8_t mode, bool save);
void     switch_mode(uint8_t mode);
bool     is_unicode(uint8_t mode);

void keyboard_pre_init_keymap(void);
void keyboard_post_init_keymap(void);
void eeconfig_init_keymap(void);
bool process_record_keymap(uint16_t keycode, keyrecord_t *record);