buffyboard: add sticky_shift config option
Adds a keyboard config option to control shift key behavior. When sticky_shift is enabled (default), the keyboard remains in uppercase mode until the shift key is pressed again. When disabled, the keyboard switches back into lowercase mode when a non-modifier key is pressed.
This commit is contained in:
parent
32b4e069bd
commit
c3e12af143
6 changed files with 22 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ If a change only affects particular applications, they are listed in parentheses
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- feat(buffyboard): Add sticky_shift config option to control shift key behavior
|
||||||
- fix(unl0kr): Two clicks were required to toggle the password when "obscured" is set to "false" in unl0kr.conf (!68, thanks @vstoiakin)
|
- fix(unl0kr): Two clicks were required to toggle the password when "obscured" is set to "false" in unl0kr.conf (!68, thanks @vstoiakin)
|
||||||
- feat: Use events instead of threads for input processing (!63, thanks @vstoiakin)
|
- feat: Use events instead of threads for input processing (!63, thanks @vstoiakin)
|
||||||
- fix(buffyboard): Fix initialization of uinput (!73, thanks @vstoiakin)
|
- fix(buffyboard): Fix initialization of uinput (!73, thanks @vstoiakin)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
[keyboard]
|
[keyboard]
|
||||||
haptic_feedback=true
|
haptic_feedback=true
|
||||||
|
#sticky_shift=true
|
||||||
|
|
||||||
[theme]
|
[theme]
|
||||||
default=breezy-light
|
default=breezy-light
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,10 @@ static int parsing_handler(void* user_data, const char* section, const char* key
|
||||||
if (bbx_config_parse_bool(value, &(opts->keyboard.haptic_feedback))) {
|
if (bbx_config_parse_bool(value, &(opts->keyboard.haptic_feedback))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
} else if (strcmp(key, "sticky_shift") == 0) {
|
||||||
|
if (bbx_config_parse_bool(value, &(opts->keyboard.sticky_shift))) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (strcmp(section, "theme") == 0) {
|
} else if (strcmp(section, "theme") == 0) {
|
||||||
if (strcmp(key, "default") == 0) {
|
if (strcmp(key, "default") == 0) {
|
||||||
|
|
@ -87,6 +91,7 @@ static int parsing_handler(void* user_data, const char* section, const char* key
|
||||||
|
|
||||||
void bb_config_init_opts(bb_config_opts *opts) {
|
void bb_config_init_opts(bb_config_opts *opts) {
|
||||||
opts->keyboard.haptic_feedback = true;
|
opts->keyboard.haptic_feedback = true;
|
||||||
|
opts->keyboard.sticky_shift = true;
|
||||||
opts->theme.default_id = BBX_THEMES_THEME_BREEZY_DARK;
|
opts->theme.default_id = BBX_THEMES_THEME_BREEZY_DARK;
|
||||||
opts->input.pointer = true;
|
opts->input.pointer = true;
|
||||||
opts->input.touchscreen = true;
|
opts->input.touchscreen = true;
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* If true, vibrate on key presses */
|
/* If true, vibrate on key presses */
|
||||||
bool haptic_feedback;
|
bool haptic_feedback;
|
||||||
|
/* If true, remain in uppercase mode until shift is pressed again.
|
||||||
|
* If false, switch back to lowercase after a non-modifier key is pressed. */
|
||||||
|
bool sticky_shift;
|
||||||
} bb_config_opts_keyboard;
|
} bb_config_opts_keyboard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,11 @@ static void keyboard_value_changed_cb(lv_event_t *event) {
|
||||||
/* Pop any previously checked modifiers when a non-modifier key was pressed */
|
/* Pop any previously checked modifiers when a non-modifier key was pressed */
|
||||||
if (!is_modifier) {
|
if (!is_modifier) {
|
||||||
pop_checked_modifier_keys();
|
pop_checked_modifier_keys();
|
||||||
|
|
||||||
|
/* If sticky_shift is disabled and we're in uppercase mode, switch back to lowercase */
|
||||||
|
if (!conf_opts.keyboard.sticky_shift && lv_keyboard_get_mode(keyboard) == LV_KEYBOARD_MODE_TEXT_UPPER) {
|
||||||
|
lv_keyboard_set_mode(keyboard, LV_KEYBOARD_MODE_TEXT_LOWER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,13 @@ for and, if found, merged in the following order:
|
||||||
Enable or disable vibrations when pressing keys.
|
Enable or disable vibrations when pressing keys.
|
||||||
Default: true.
|
Default: true.
|
||||||
|
|
||||||
|
*sticky_shift* = <true|false>
|
||||||
|
Changes shift key behavior. When true, the keyboard remains in uppercase mode
|
||||||
|
until the shift key is pressed again (sticky). When false, the keyboard switches
|
||||||
|
back to lowercase mode and the shift key deactivates after a non-modifier key is
|
||||||
|
pressed.
|
||||||
|
Default: true.
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
*default* = <adwaita-light|adwaita-dark|breezy-light|breezy-dark|nord-light|nord-dark|pmos-light|pmos-dark>
|
*default* = <adwaita-light|adwaita-dark|breezy-light|breezy-dark|nord-light|nord-dark|pmos-light|pmos-dark>
|
||||||
Selects the default theme on boot. Can be changed at runtime to the
|
Selects the default theme on boot. Can be changed at runtime to the
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue