-
-
Notifications
You must be signed in to change notification settings - Fork 40.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New Feature] Custom Modified Values #2900
Changes from all commits
16afcd7
a81897d
481340b
965e74c
fd32b99
9711b72
f0f8bd7
49f2074
2d9f73e
d6110e0
b472bd8
d30e8ea
340c45a
741f7f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#define CUSTOM_MODIFIED_VALUES_ENABLE |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
See the `docs/feature_custom_modified_values.md` file for more details on the feature this keymap is using (which allows you to **assign several keycodes for a single key**: the keycode returned to the firmware **depends on the state of the `Shifts` and `Right Alt` keys**). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
CUSTOM_MODIFIED_VALUES_ENABLE = yes | ||
|
||
|
||
BOOTMAGIC_ENABLE = no | ||
MOUSEKEY_ENABLE = yes | ||
EXTRAKEY_ENABLE = yes | ||
CONSOLE_ENABLE = no | ||
COMMAND_ENABLE = no | ||
SLEEP_LED_ENABLE = no | ||
NKRO_ENABLE = no | ||
BACKLIGHT_ENABLE = no | ||
MIDI_ENABLE = no | ||
UNICODE_ENABLE = yes | ||
UNICODEMAP_ENABLE = no | ||
BLUETOOTH_ENABLE = no | ||
AUDIO_ENABLE = no | ||
FAUXCLICKY_ENABLE = no | ||
#VARIABLE_TRACE = no | ||
API_SYSEX_ENABLE = no | ||
KEY_LOCK_ENABLE = no | ||
|
||
RGBLIGHT_ENABLE = no | ||
TAP_DANCE_ENABLE = no | ||
FORCE_NKRO = no | ||
KEYLOGGER_ENABLE = no | ||
UCIS_ENABLE = no | ||
AUTOLOG_ENABLE = no | ||
RGBLIGHT_ANIMATION= no |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef _SHORTCUT_UTILS_H_ | ||
#define _SHORTCUT_UTILS_H_ | ||
|
||
#include <stdint.h> | ||
#include <stdarg.h> | ||
#include <quantum.h> | ||
|
||
#define VA_ARRAY_UINT16_T(array, argc) va_list valist; \ | ||
int i; \ | ||
va_start(valist, argc); \ | ||
for(i = 0; i < argc; i++) { \ | ||
array[i] = va_arg(valist, uint16_t); \ | ||
} \ | ||
va_end(valist); | ||
|
||
void shortcut_press(int argc_local, ...) { | ||
uint16_t kcs[argc_local]; | ||
VA_ARRAY_UINT16_T(kcs, argc_local) | ||
for(i = 0; i < argc_local; i++) { | ||
register_code16(kcs[i]); | ||
} | ||
} | ||
|
||
void shortcut_release(int argc_local, ...) { | ||
uint16_t kcs[argc_local]; | ||
VA_ARRAY_UINT16_T(kcs, argc_local) | ||
for(i = 0; i < argc_local; i++) { | ||
unregister_code16(kcs[i]); | ||
} | ||
} | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef _CUSTOM_MODIFIED_VALUES_H_ | ||
#define _CUSTOM_MODIFIED_VALUES_H_ | ||
|
||
#include <stdint.h> | ||
#include <stdbool.h> | ||
#include "action.h" | ||
#include "action_util.h" | ||
|
||
#define CMV(kc_default, kc_shifted, kc_altgred, kc_sftralt) set_cmv_buffer(kc_default, kc_shifted, kc_altgred, kc_sftralt) | ||
bool set_cmv_buffer(uint16_t kc_default, uint16_t kc_shifted, uint16_t kc_altgred, uint16_t kc_sftralt); | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -120,7 +120,7 @@ void process_hand_swap(keyevent_t *event) { | |||||
} | ||||||
#endif | ||||||
|
||||||
#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) | ||||||
#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
bool disable_action_cache = false; | ||||||
|
||||||
void process_record_nocache(keyrecord_t *record) | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -62,7 +62,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt); | |||||
bool process_record_quantum(keyrecord_t *record); | ||||||
|
||||||
/* Utilities for actions. */ | ||||||
#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) | ||||||
#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
extern bool disable_action_cache; | ||||||
#endif | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -228,7 +228,7 @@ void layer_debug(void) | |||||
} | ||||||
#endif | ||||||
|
||||||
#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) | ||||||
#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
uint8_t source_layers_cache[(MATRIX_ROWS * MATRIX_COLS + 7) / 8][MAX_LAYER_BITS] = {{0}}; | ||||||
|
||||||
void update_source_layers_cache(keypos_t key, uint8_t layer) | ||||||
|
@@ -272,7 +272,7 @@ uint8_t read_source_layers_cache(keypos_t key) | |||||
*/ | ||||||
action_t store_or_get_action(bool pressed, keypos_t key) | ||||||
{ | ||||||
#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) | ||||||
#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
if (disable_action_cache) { | ||||||
return layer_switch_get_action(key); | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -88,7 +88,7 @@ uint32_t layer_state_set_user(uint32_t state); | |||||
uint32_t layer_state_set_kb(uint32_t state); | ||||||
|
||||||
/* pressed actions cache */ | ||||||
#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) | ||||||
#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
/* The number of bits needed to represent the layer number: log2(32). */ | ||||||
#define MAX_LAYER_BITS 5 | ||||||
void update_source_layers_cache(keypos_t key, uint8_t layer); | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be reverted. There is no more PSM, as it is now the default behavior.