mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
keyboard repeat configuration
This commit is contained in:
parent
3dc4c02c54
commit
326b4aebd1
3 changed files with 9 additions and 1 deletions
|
|
@ -29,6 +29,8 @@ struct rcxml {
|
||||||
enum libinput_config_accel_profile accel_profile;
|
enum libinput_config_accel_profile accel_profile;
|
||||||
enum libinput_config_middle_emulation_state middle_emu;
|
enum libinput_config_middle_emulation_state middle_emu;
|
||||||
enum libinput_config_dwt_state dwt;
|
enum libinput_config_dwt_state dwt;
|
||||||
|
int repeat_rate;
|
||||||
|
int repeat_delay;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct rcxml rc;
|
extern struct rcxml rc;
|
||||||
|
|
|
||||||
|
|
@ -271,6 +271,10 @@ entry(xmlNode *node, char *nodename, char *content)
|
||||||
LIBINPUT_CONFIG_DWT_DISABLED;
|
LIBINPUT_CONFIG_DWT_DISABLED;
|
||||||
} else if (!strcasecmp(nodename, "AccelerationProfile.libinput")) {
|
} else if (!strcasecmp(nodename, "AccelerationProfile.libinput")) {
|
||||||
rc.accel_profile = get_accel_profile(content);
|
rc.accel_profile = get_accel_profile(content);
|
||||||
|
} else if (!strcasecmp(nodename, "RepeatRate.keyboard")) {
|
||||||
|
rc.repeat_rate = atoi(content);
|
||||||
|
} else if (!strcasecmp(nodename, "RepeatDelay.keyboard")) {
|
||||||
|
rc.repeat_delay = atoi(content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -362,6 +366,8 @@ rcxml_init()
|
||||||
rc.accel_profile = -1;
|
rc.accel_profile = -1;
|
||||||
rc.middle_emu = -1;
|
rc.middle_emu = -1;
|
||||||
rc.dwt = -1;
|
rc.dwt = -1;
|
||||||
|
rc.repeat_rate = 25;
|
||||||
|
rc.repeat_delay = 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ keyboard_init(struct seat *seat)
|
||||||
wlr_keyboard_set_keymap(kb, keymap);
|
wlr_keyboard_set_keymap(kb, keymap);
|
||||||
xkb_keymap_unref(keymap);
|
xkb_keymap_unref(keymap);
|
||||||
xkb_context_unref(context);
|
xkb_context_unref(context);
|
||||||
wlr_keyboard_set_repeat_info(kb, 25, 600);
|
wlr_keyboard_set_repeat_info(kb, rc.repeat_rate, rc.repeat_delay);
|
||||||
|
|
||||||
seat->keyboard_key.notify = keyboard_key_notify;
|
seat->keyboard_key.notify = keyboard_key_notify;
|
||||||
wl_signal_add(&kb->events.key, &seat->keyboard_key);
|
wl_signal_add(&kb->events.key, &seat->keyboard_key);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue