Added /inpblock command

This commit is contained in:
James Booth
2014-12-21 18:15:29 +00:00
parent 79d4cbe967
commit 13f73a30e7
8 changed files with 55 additions and 1 deletions

View File

@@ -617,6 +617,17 @@ static struct cmd_t command_defs[] =
"Configure time precision for the main window.",
NULL } } },
{ "/inpblock",
cmd_inpblock, parse_args, 1, 1, &cons_inpblock_setting,
{ "/inpblock millis", "Input blocking delay.",
{ "/inpblock millis",
"----------------",
"Time to wait in milliseconds before reading input from the terminal buffer, defaults to 20.",
"Valid values are 1-1000.",
"A higher value will result in less CPU usage, but a noticable delay for response to input.",
"A lower value will result in higher CPU usage, but faster response to input.",
NULL } } },
{ "/notify",
cmd_notify, parse_args, 2, 3, &cons_notify_setting,
{ "/notify [type value]|[type setting value]", "Control various desktop noficiations.",

View File

@@ -3395,6 +3395,19 @@ cmd_notify(gchar **args, struct cmd_help_t help)
return TRUE;
}
gboolean
cmd_inpblock(gchar **args, struct cmd_help_t help)
{
char *value = args[0];
int intval;
if (_strtoi(value, &intval, 1, 1000) == 0) {
cons_show("Input blocking set to %d milliseconds.", intval);
prefs_set_inpblock(intval);
ui_input_nonblocking();
}
return TRUE;
}
gboolean
cmd_log(gchar **args, struct cmd_help_t help)
{

View File

@@ -136,6 +136,7 @@ gboolean cmd_presence(gchar **args, struct cmd_help_t help);
gboolean cmd_wrap(gchar **args, struct cmd_help_t help);
gboolean cmd_time(gchar **args, struct cmd_help_t help);
gboolean cmd_resource(gchar **args, struct cmd_help_t help);
gboolean cmd_inpblock(gchar **args, struct cmd_help_t help);
gboolean cmd_form_field(char *tag, gchar **args);