summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-07-26 09:45:40 +0200
committerSébastien Helleu <flashcode@flashtux.org>2015-07-26 09:45:40 +0200
commit74f1592f218608040f1c09df1764b6dda25fd6f6 (patch)
tree42b8cbd103ba43bb05b6a41816f0ce25d758cd68 /src
parent6ec5d5a1485bad5fb79489a9ebdb30a00a29cabb (diff)
downloadweechat-74f1592f218608040f1c09df1764b6dda25fd6f6.zip
core: add option weechat.look.key_grab_delay to set the default delay when grabbing a key with alt-k
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-config.c8
-rw-r--r--src/core/wee-config.h1
-rw-r--r--src/gui/gui-key.c2
-rw-r--r--src/gui/gui-key.h2
4 files changed, 10 insertions, 3 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 36b781de4..5df37722f 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -143,6 +143,7 @@ struct t_config_option *config_look_jump_current_to_previous_buffer;
struct t_config_option *config_look_jump_previous_buffer_when_closing;
struct t_config_option *config_look_jump_smart_back_to_buffer;
struct t_config_option *config_look_key_bind_safe;
+struct t_config_option *config_look_key_grab_delay;
struct t_config_option *config_look_mouse;
struct t_config_option *config_look_mouse_timer_delay;
struct t_config_option *config_look_nick_prefix;
@@ -2622,6 +2623,13 @@ config_weechat_init_options ()
N_("allow only binding of \"safe\" keys (beginning with a ctrl or meta "
"code)"),
NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ config_look_key_grab_delay = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "key_grab_delay", "integer",
+ N_("default delay (in milliseconds) to grab a key (using default key "
+ "alt-k); this delay can be overridden in the /input command (see "
+ "/help input"),
+ NULL, 1, 10000, "800", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_mouse = config_file_new_option (
weechat_config_file, ptr_section,
"mouse", "boolean",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 7a8651281..9ce97a4f9 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -189,6 +189,7 @@ extern struct t_config_option *config_look_jump_current_to_previous_buffer;
extern struct t_config_option *config_look_jump_previous_buffer_when_closing;
extern struct t_config_option *config_look_jump_smart_back_to_buffer;
extern struct t_config_option *config_look_key_bind_safe;
+extern struct t_config_option *config_look_key_grab_delay;
extern struct t_config_option *config_look_mouse;
extern struct t_config_option *config_look_mouse_timer_delay;
extern struct t_config_option *config_look_nick_prefix;
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c
index a9d6e4053..209ce061e 100644
--- a/src/gui/gui-key.c
+++ b/src/gui/gui-key.c
@@ -177,7 +177,7 @@ gui_key_grab_init (int grab_command, const char *delay)
gui_key_grab_count = 0;
gui_key_grab_command = grab_command;
- gui_key_grab_delay = GUI_KEY_GRAB_DELAY_DEFAULT;
+ gui_key_grab_delay = CONFIG_INTEGER(config_look_key_grab_delay);
if (delay != NULL)
{
error = NULL;
diff --git a/src/gui/gui-key.h b/src/gui/gui-key.h
index 8b7aa3e0b..e6af2d88a 100644
--- a/src/gui/gui-key.h
+++ b/src/gui/gui-key.h
@@ -24,8 +24,6 @@ struct t_hashtable;
#define GUI_KEY_BUFFER_BLOCK_SIZE 256
-#define GUI_KEY_GRAB_DELAY_DEFAULT 500
-
#define GUI_KEY_BRACKETED_PASTE_START "\x1B[200~"
#define GUI_KEY_BRACKETED_PASTE_END "\x1B[201~"
#define GUI_KEY_BRACKETED_PASTE_LENGTH 6