From 13f73a30e73f0349968f827e4003b3b4c84ebbf3 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 21 Dec 2014 18:15:29 +0000 Subject: Added /inpblock command --- src/command/command.c | 11 +++++++++++ src/command/commands.c | 13 +++++++++++++ src/command/commands.h | 1 + 3 files changed, 25 insertions(+) (limited to 'src/command') diff --git a/src/command/command.c b/src/command/command.c index 776dd533..d00b1896 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -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.", diff --git a/src/command/commands.c b/src/command/commands.c index 39bcf287..cc914c1f 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -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) { diff --git a/src/command/commands.h b/src/command/commands.h index 5245b2c7..48a11e24 100644 --- a/src/command/commands.h +++ b/src/command/commands.h @@ -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); -- cgit 1.4.1-2-gfad0 3'>aqua
blob: a0f7fb91218ea568abcd66684b427f3f3bf859b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77