(1) e_config.c/e_comp_wl.c: add code for making repeat values configurable

(2) e.src(s): add keyboard.repeat_delay, keyboard.repeat_rate into e.src files

Summary:
As of now, the default values of repeat delay/rate are being set in e_comp_wl.c.
Those values need to be configurable and will be used in e_comp_wl_init().
The limit of each of the values is defined from -1 to 1000. (maximum 1s).
If one of the two is negative, it means default repeat delay/rate are going to be used.
(e.g. delay:400, rate:25)

Test Plan:
N/A

Signed-off-by: Sung-Jin Park <input.hacker@gmail.com>

Reviewers: raster, stefan_schmidt, gwanglim, devilhorns, zmike

Subscribers: Jeon, ohduna, cedric

Differential Revision: https://phab.enlightenment.org/D3364
This commit is contained in:
Sung-Jin Park 2015-11-30 14:05:10 -05:00 committed by Mike Blumenkrantz
parent 81ff082e0d
commit 6826608961
8 changed files with 43 additions and 4 deletions

View File

@ -215,6 +215,8 @@ group "E_Config" struct {
value "update.later" uchar: 0;
value "xkb.only_label" int: 0;
value "xkb.default_model" string: "default";
value "keyboard.repeat_delay" int: 400;
value "keyboard.repeat_rate" int: 25;
value "exe_always_single_instance" uchar: 0;
value "use_desktop_window_profile" int: 0;
value "powersave.none" double: 0.25;

View File

@ -865,6 +865,8 @@ group "E_Config" struct {
}
value "xkb.only_label" int: 0;
value "xkb.default_model" string: "default";
value "keyboard.repeat_delay" int: 400;
value "keyboard.repeat_rate" int: 25;
value "exe_always_single_instance" uchar: 1;
value "use_desktop_window_profile" int: 0;
}

View File

@ -1106,6 +1106,8 @@ group "E_Config" struct {
}
value "xkb.only_label" int: 0;
value "xkb.default_model" string: "default";
value "keyboard.repeat_delay" int: 400;
value "keyboard.repeat_rate" int: 25;
value "exe_always_single_instance" uchar: 0;
value "use_desktop_window_profile" int: 0;
}

View File

@ -1128,6 +1128,8 @@ group "E_Config" struct {
}
value "xkb.only_label" int: 0;
value "xkb.default_model" string: "default";
value "keyboard.repeat_delay" int: 400;
value "keyboard.repeat_rate" int: 25;
value "exe_always_single_instance" uchar: 0;
value "use_desktop_window_profile" int: 0;
}

View File

@ -155,6 +155,8 @@ struct _E_Comp_Wl_Data
struct wl_array keys;
struct wl_resource *focus;
int mod_changed;
int repeat_delay;
int repeat_rate;
} kbd;
struct

View File

@ -181,9 +181,9 @@ _e_comp_wl_input_cb_keyboard_get(struct wl_client *client, struct wl_resource *r
e_comp->wl_comp_data,
_e_comp_wl_input_cb_keyboard_unbind);
/* FIXME: These values should be configurable */
/* send current repeat_info */
if (wl_resource_get_version(res) >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION)
wl_keyboard_send_repeat_info(res, 25, 400);
wl_keyboard_send_repeat_info(res, e_comp_wl->kbd.repeat_rate, e_comp_wl->kbd.repeat_delay);
/* send current keymap */
wl_keyboard_send_keymap(res, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
@ -419,6 +419,15 @@ e_comp_wl_input_init(void)
e_comp_wl->xkb.fd = -1;
/* get default keyboard repeat rate/delay from configuration */
e_comp_wl->kbd.repeat_delay = e_config->keyboard.repeat_delay;
e_comp_wl->kbd.repeat_rate = e_config->keyboard.repeat_rate;
/* check for valid repeat_delay and repeat_rate value */
/* if invalid, set the default value of repeat delay and rate value */
if (e_comp_wl->kbd.repeat_delay < 0) e_comp_wl->kbd.repeat_delay = 400;
if (e_comp_wl->kbd.repeat_rate < 0) e_comp_wl->kbd.repeat_rate = 25;
/* create the global resource for input seat */
e_comp_wl->seat.global =
wl_global_create(e_comp_wl->wl.disp, &wl_seat_interface, 4,

View File

@ -733,6 +733,9 @@ _e_config_edd_init(Eina_Bool old)
E_CONFIG_VAL(D, T, xkb.dont_touch_my_damn_keyboard, UCHAR);
E_CONFIG_VAL(D, T, xkb.default_model, STR);
E_CONFIG_VAL(D, T, keyboard.repeat_delay, INT);
E_CONFIG_VAL(D, T, keyboard.repeat_rate, INT);
if (old)
{
E_CONFIG_SUB(D, T, xkb.current_layout, _e_config_xkb_option_edd);
@ -1326,6 +1329,14 @@ e_config_load(void)
free(ecc);
}
}
CONFIG_VERSION_CHECK(19)
{
CONFIG_VERSION_UPDATE_INFO(19);
/* set (400, 25) as the default values of repeat delay, rate */
e_config->keyboard.repeat_delay = 400;
e_config->keyboard.repeat_rate = 25;
}
}
if (!e_config->remember_internal_fm_windows)
e_config->remember_internal_fm_windows = !!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS);
@ -1504,6 +1515,9 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->backlight.dim, 0.05, 1.0);
E_CONFIG_LIMIT(e_config->backlight.idle_dim, 0, 1);
E_CONFIG_LIMIT(e_config->keyboard.repeat_delay, -1, 1000); // 1 second
E_CONFIG_LIMIT(e_config->keyboard.repeat_rate, -1, 1000); // 1 second
if (!e_config->icon_theme)
e_config->icon_theme = eina_stringshare_add("hicolor"); // FDO default

View File

@ -47,7 +47,7 @@ typedef enum
/* increment this whenever a new set of config values are added but the users
* config doesn't need to be wiped - simply new values need to be put in
*/
#define E_CONFIG_FILE_GENERATION 18
#define E_CONFIG_FILE_GENERATION 19
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!!
@ -428,7 +428,13 @@ struct _E_Config
const char *selected_layout; // whatever teh current layout that the user has selected is
const char *desklock_layout;
} xkb;
struct
{
int repeat_delay;//delay in milliseconds since key down until repeating starts
int repeat_rate;//the rate of repeating keys in characters per second
} keyboard;
Eina_List *menu_applications;
unsigned char exe_always_single_instance; // GUI
int use_desktop_window_profile; // GUI