summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-Jin Park <input.hacker@gmail.com>2015-11-30 14:05:10 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-11-30 14:05:10 -0500
commit6826608961a903dd7b117535bd16e8f83cfb26a0 (patch)
treeef340f0414e9084ea461bce89e6632a3a847b6bd
parent81ff082e0d762f3d16f5e2cafd2717456d30c872 (diff)
(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
-rw-r--r--config/default/e.src2
-rw-r--r--config/mobile/e.src2
-rw-r--r--config/standard/e.src2
-rw-r--r--config/tiling/e.src2
-rw-r--r--src/bin/e_comp_wl.h2
-rw-r--r--src/bin/e_comp_wl_input.c13
-rw-r--r--src/bin/e_config.c14
-rw-r--r--src/bin/e_config.h10
8 files changed, 43 insertions, 4 deletions
diff --git a/config/default/e.src b/config/default/e.src
index db89920ae..b7cb8359b 100644
--- a/config/default/e.src
+++ b/config/default/e.src
@@ -215,6 +215,8 @@ group "E_Config" struct {
215 value "update.later" uchar: 0; 215 value "update.later" uchar: 0;
216 value "xkb.only_label" int: 0; 216 value "xkb.only_label" int: 0;
217 value "xkb.default_model" string: "default"; 217 value "xkb.default_model" string: "default";
218 value "keyboard.repeat_delay" int: 400;
219 value "keyboard.repeat_rate" int: 25;
218 value "exe_always_single_instance" uchar: 0; 220 value "exe_always_single_instance" uchar: 0;
219 value "use_desktop_window_profile" int: 0; 221 value "use_desktop_window_profile" int: 0;
220 value "powersave.none" double: 0.25; 222 value "powersave.none" double: 0.25;
diff --git a/config/mobile/e.src b/config/mobile/e.src
index f4e607019..1431dde33 100644
--- a/config/mobile/e.src
+++ b/config/mobile/e.src
@@ -865,6 +865,8 @@ group "E_Config" struct {
865 } 865 }
866 value "xkb.only_label" int: 0; 866 value "xkb.only_label" int: 0;
867 value "xkb.default_model" string: "default"; 867 value "xkb.default_model" string: "default";
868 value "keyboard.repeat_delay" int: 400;
869 value "keyboard.repeat_rate" int: 25;
868 value "exe_always_single_instance" uchar: 1; 870 value "exe_always_single_instance" uchar: 1;
869 value "use_desktop_window_profile" int: 0; 871 value "use_desktop_window_profile" int: 0;
870} 872}
diff --git a/config/standard/e.src b/config/standard/e.src
index 585d3f09a..b41057cc6 100644
--- a/config/standard/e.src
+++ b/config/standard/e.src
@@ -1106,6 +1106,8 @@ group "E_Config" struct {
1106 } 1106 }
1107 value "xkb.only_label" int: 0; 1107 value "xkb.only_label" int: 0;
1108 value "xkb.default_model" string: "default"; 1108 value "xkb.default_model" string: "default";
1109 value "keyboard.repeat_delay" int: 400;
1110 value "keyboard.repeat_rate" int: 25;
1109 value "exe_always_single_instance" uchar: 0; 1111 value "exe_always_single_instance" uchar: 0;
1110 value "use_desktop_window_profile" int: 0; 1112 value "use_desktop_window_profile" int: 0;
1111} 1113}
diff --git a/config/tiling/e.src b/config/tiling/e.src
index 8bde334ad..afeac1fb3 100644
--- a/config/tiling/e.src
+++ b/config/tiling/e.src
@@ -1128,6 +1128,8 @@ group "E_Config" struct {
1128 } 1128 }
1129 value "xkb.only_label" int: 0; 1129 value "xkb.only_label" int: 0;
1130 value "xkb.default_model" string: "default"; 1130 value "xkb.default_model" string: "default";
1131 value "keyboard.repeat_delay" int: 400;
1132 value "keyboard.repeat_rate" int: 25;
1131 value "exe_always_single_instance" uchar: 0; 1133 value "exe_always_single_instance" uchar: 0;
1132 value "use_desktop_window_profile" int: 0; 1134 value "use_desktop_window_profile" int: 0;
1133} 1135}
diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index 7142f4d46..dc268dc09 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -155,6 +155,8 @@ struct _E_Comp_Wl_Data
155 struct wl_array keys; 155 struct wl_array keys;
156 struct wl_resource *focus; 156 struct wl_resource *focus;
157 int mod_changed; 157 int mod_changed;
158 int repeat_delay;
159 int repeat_rate;
158 } kbd; 160 } kbd;
159 161
160 struct 162 struct
diff --git a/src/bin/e_comp_wl_input.c b/src/bin/e_comp_wl_input.c
index 27934481c..d27d72acd 100644
--- a/src/bin/e_comp_wl_input.c
+++ b/src/bin/e_comp_wl_input.c
@@ -181,9 +181,9 @@ _e_comp_wl_input_cb_keyboard_get(struct wl_client *client, struct wl_resource *r
181 e_comp->wl_comp_data, 181 e_comp->wl_comp_data,
182 _e_comp_wl_input_cb_keyboard_unbind); 182 _e_comp_wl_input_cb_keyboard_unbind);
183 183
184 /* FIXME: These values should be configurable */ 184 /* send current repeat_info */
185 if (wl_resource_get_version(res) >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION) 185 if (wl_resource_get_version(res) >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION)
186 wl_keyboard_send_repeat_info(res, 25, 400); 186 wl_keyboard_send_repeat_info(res, e_comp_wl->kbd.repeat_rate, e_comp_wl->kbd.repeat_delay);
187 187
188 /* send current keymap */ 188 /* send current keymap */
189 wl_keyboard_send_keymap(res, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, 189 wl_keyboard_send_keymap(res, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
@@ -419,6 +419,15 @@ e_comp_wl_input_init(void)
419 419
420 e_comp_wl->xkb.fd = -1; 420 e_comp_wl->xkb.fd = -1;
421 421
422 /* get default keyboard repeat rate/delay from configuration */
423 e_comp_wl->kbd.repeat_delay = e_config->keyboard.repeat_delay;
424 e_comp_wl->kbd.repeat_rate = e_config->keyboard.repeat_rate;
425
426 /* check for valid repeat_delay and repeat_rate value */
427 /* if invalid, set the default value of repeat delay and rate value */
428 if (e_comp_wl->kbd.repeat_delay < 0) e_comp_wl->kbd.repeat_delay = 400;
429 if (e_comp_wl->kbd.repeat_rate < 0) e_comp_wl->kbd.repeat_rate = 25;
430
422 /* create the global resource for input seat */ 431 /* create the global resource for input seat */
423 e_comp_wl->seat.global = 432 e_comp_wl->seat.global =
424 wl_global_create(e_comp_wl->wl.disp, &wl_seat_interface, 4, 433 wl_global_create(e_comp_wl->wl.disp, &wl_seat_interface, 4,
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index b8043b34d..80501aaf9 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -733,6 +733,9 @@ _e_config_edd_init(Eina_Bool old)
733 E_CONFIG_VAL(D, T, xkb.dont_touch_my_damn_keyboard, UCHAR); 733 E_CONFIG_VAL(D, T, xkb.dont_touch_my_damn_keyboard, UCHAR);
734 E_CONFIG_VAL(D, T, xkb.default_model, STR); 734 E_CONFIG_VAL(D, T, xkb.default_model, STR);
735 735
736 E_CONFIG_VAL(D, T, keyboard.repeat_delay, INT);
737 E_CONFIG_VAL(D, T, keyboard.repeat_rate, INT);
738
736 if (old) 739 if (old)
737 { 740 {
738 E_CONFIG_SUB(D, T, xkb.current_layout, _e_config_xkb_option_edd); 741 E_CONFIG_SUB(D, T, xkb.current_layout, _e_config_xkb_option_edd);
@@ -1326,6 +1329,14 @@ e_config_load(void)
1326 free(ecc); 1329 free(ecc);
1327 } 1330 }
1328 } 1331 }
1332 CONFIG_VERSION_CHECK(19)
1333 {
1334 CONFIG_VERSION_UPDATE_INFO(19);
1335
1336 /* set (400, 25) as the default values of repeat delay, rate */
1337 e_config->keyboard.repeat_delay = 400;
1338 e_config->keyboard.repeat_rate = 25;
1339 }
1329 } 1340 }
1330 if (!e_config->remember_internal_fm_windows) 1341 if (!e_config->remember_internal_fm_windows)
1331 e_config->remember_internal_fm_windows = !!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS); 1342 e_config->remember_internal_fm_windows = !!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS);
@@ -1504,6 +1515,9 @@ e_config_load(void)
1504 E_CONFIG_LIMIT(e_config->backlight.dim, 0.05, 1.0); 1515 E_CONFIG_LIMIT(e_config->backlight.dim, 0.05, 1.0);
1505 E_CONFIG_LIMIT(e_config->backlight.idle_dim, 0, 1); 1516 E_CONFIG_LIMIT(e_config->backlight.idle_dim, 0, 1);
1506 1517
1518 E_CONFIG_LIMIT(e_config->keyboard.repeat_delay, -1, 1000); // 1 second
1519 E_CONFIG_LIMIT(e_config->keyboard.repeat_rate, -1, 1000); // 1 second
1520
1507 if (!e_config->icon_theme) 1521 if (!e_config->icon_theme)
1508 e_config->icon_theme = eina_stringshare_add("hicolor"); // FDO default 1522 e_config->icon_theme = eina_stringshare_add("hicolor"); // FDO default
1509 1523
diff --git a/src/bin/e_config.h b/src/bin/e_config.h
index 7fe67c41c..2874ac7c2 100644
--- a/src/bin/e_config.h
+++ b/src/bin/e_config.h
@@ -47,7 +47,7 @@ typedef enum
47/* increment this whenever a new set of config values are added but the users 47/* increment this whenever a new set of config values are added but the users
48 * config doesn't need to be wiped - simply new values need to be put in 48 * config doesn't need to be wiped - simply new values need to be put in
49 */ 49 */
50#define E_CONFIG_FILE_GENERATION 18 50#define E_CONFIG_FILE_GENERATION 19
51#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION) 51#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
52 52
53#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!! 53#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!!
@@ -428,7 +428,13 @@ struct _E_Config
428 const char *selected_layout; // whatever teh current layout that the user has selected is 428 const char *selected_layout; // whatever teh current layout that the user has selected is
429 const char *desklock_layout; 429 const char *desklock_layout;
430 } xkb; 430 } xkb;
431 431
432 struct
433 {
434 int repeat_delay;//delay in milliseconds since key down until repeating starts
435 int repeat_rate;//the rate of repeating keys in characters per second
436 } keyboard;
437
432 Eina_List *menu_applications; 438 Eina_List *menu_applications;
433 unsigned char exe_always_single_instance; // GUI 439 unsigned char exe_always_single_instance; // GUI
434 int use_desktop_window_profile; // GUI 440 int use_desktop_window_profile; // GUI