use a separate repeat-rate for keybindings

This commit is contained in:
Andrea Chiavazza 2025-04-17 19:35:34 +01:00
parent 4456f4536a
commit 05278fb6ce
2 changed files with 4 additions and 3 deletions

View File

@ -60,6 +60,7 @@ static const struct xkb_rule_names xkb_rules = {
.options = NULL,
};
static const int keybinding_repeat_rate = 0;
static const int repeat_rate = 25;
static const int repeat_delay = 600;

6
dwl.c
View File

@ -1686,11 +1686,11 @@ keyrepeat(void *data)
{
KeyboardGroup *group = data;
int i;
if (!group->nsyms || group->wlr_group->keyboard.repeat_info.rate <= 0)
int krr = keybinding_repeat_rate; // avoids div-by-zero warning
if (group->nsyms <= 0 || krr <= 0)
return 0;
wl_event_source_timer_update(group->key_repeat_source,
1000 / group->wlr_group->keyboard.repeat_info.rate);
wl_event_source_timer_update(group->key_repeat_source, 1000 / krr);
for (i = 0; i < group->nsyms; i++)
keybinding(group->mods, group->keysyms[i]);