From 3bc7f46412e6e6c829aaff6d0f15c4cf36011948 Mon Sep 17 00:00:00 2001 From: Robert Verst Date: Wed, 17 Mar 2021 17:44:21 +0100 Subject: [Keymap] Add userspace rverst (#12205) Co-authored-by: Robert Verst --- users/rverst/rverst.h | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 users/rverst/rverst.h (limited to 'users/rverst/rverst.h') diff --git a/users/rverst/rverst.h b/users/rverst/rverst.h new file mode 100644 index 0000000000..b7aea556c2 --- /dev/null +++ b/users/rverst/rverst.h @@ -0,0 +1,81 @@ +/* Copyright 2021 Robert Verst @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 . + */ + +#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); + -- cgit v1.2.3