Welcome to mirror list, hosted at ThFree Co, Russian Federation.

program_mousectl.cpp « dos « src - github.com/dosbox-staging/dosbox-staging.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 64709fe55aeed5bd7498096b50ada27088f35c4b (plain)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
/*
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *
 *  Copyright (C) 2022-2022  The DOSBox Staging Team
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include "program_mousectl.h"

#include "ansi_code_markup.h"
#include "checks.h"
#include "string_utils.h"
#include "video.h"

#include <set>

CHECK_NARROWING();

void MOUSECTL::Run()
{
	if (HelpRequested()) {
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_HELP_LONG"));
		return;
	}

	ParseAndRun();
	// TODO: once exit codes are supported, set it according to result
}

bool MOUSECTL::ParseAndRun()
{
	// Put all the parameters into vector
	std::vector<std::string> params;
	cmd->FillVector(params);

	// Extract the list of interfaces from the vector
	list_ids.clear();
	if (!ParseInterfaces(params) || !CheckInterfaces())
		return false;

	auto param_equal = [&params](const size_t idx, const char *string) {
		if (idx >= params.size())
			return false;
		return iequals(params[idx], string);
	};

	// CmdShow
	if (list_ids.size() == 0 && params.empty())
		return CmdShow(false);
	if (list_ids.size() == 0 && params.size() == 1)
		if (param_equal(0, "-all"))
			return CmdShow(true);

	// CmdMap - by supplied host mouse name
	if (list_ids.size() == 1 && params.size() == 2)
		if (param_equal(0, "-map"))
			return CmdMap(list_ids[0], params[1]);

	// CmdMap - interactive
	if (!list_ids.empty() && params.size() == 1)
		if (param_equal(0, "-map"))
			return CmdMap();

	// CmdUnmap / CmdOnOff / CmdReset / CmdSensitivity / CmdMinRate
	if (params.size() == 1) {
		if (param_equal(0, "-unmap"))
			return CmdUnMap();
		if (param_equal(0, "-on"))
			return CmdOnOff(true);
		if (param_equal(0, "-off"))
			return CmdOnOff(false);
		if (param_equal(0, "-reset"))
			return CmdReset();
		if (param_equal(0, "-s"))
			return CmdSensitivity();
		if (param_equal(0, "-sx"))
			return CmdSensitivityX();
		if (param_equal(0, "-sy"))
			return CmdSensitivityY();
		if (param_equal(0, "-r"))
			return CmdMinRate();
	}

	// CmdSensitivity / CmdMinRate with a non-default value
	if (params.size() == 2) {
		if (param_equal(0, "-r"))
			return CmdMinRate(params[1]);

		if (param_equal(0, "-s"))
			return CmdSensitivity(params[1], params[1]);
		if (param_equal(0, "-sx"))
			return CmdSensitivityX(params[1]);
		if (param_equal(0, "-sy"))
			return CmdSensitivityY(params[1]);
	}
	if (params.size() == 3) {
		if (param_equal(0, "-s"))
			return CmdSensitivity(params[1], params[2]);
	}

	WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX"));
	return false;
}

bool MOUSECTL::ParseSensitivity(const std::string &param, int16_t &value)
{
	value = 0;

	int tmp = 0;
	if (!ParseIntParam(param, tmp)) {
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_SENSITIVITY"));
		return false;
	}

	// Maximum allowed user sensitivity value
	constexpr int16_t sensitivity_user_max = 999;
	if (tmp < -sensitivity_user_max || tmp > sensitivity_user_max) {
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_SENSITIVITY"));
		return false;
	}

	value = static_cast<int16_t>(tmp);
	return true;
}

bool MOUSECTL::ParseIntParam(const std::string &param, int &value)
{
	try {
		value = std::stoi(param);
	} catch (...) {
		value = 0;
		return false;
	}

	return true;
}

bool MOUSECTL::ParseInterfaces(std::vector<std::string> &params)
{
	auto add_if_is_interface = [&](const std::string &param) {
		for (const auto id : {
		             MouseInterfaceId::DOS,
		             MouseInterfaceId::PS2,
		             MouseInterfaceId::COM1,
		             MouseInterfaceId::COM2,
		             MouseInterfaceId::COM3,
		             MouseInterfaceId::COM4,
		     }) {
			if (iequals(param, MouseControlAPI::GetInterfaceNameStr(id))) {
				list_ids.push_back(id);
				return true;
			}
		}
		if (iequals(param, "PS2")) { // syntax sugar, easier to type
			                     // than 'PS/2'
			list_ids.push_back(MouseInterfaceId::PS2);
			return true;
		}
		return false;
	};
	while (!params.empty() && add_if_is_interface(params.front()))
		params.erase(params.begin()); // pop

	// Check that all interfaces are unique
	const std::set<MouseInterfaceId> tmp(list_ids.begin(), list_ids.end());
	if (list_ids.size() != tmp.size()) {
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_DUPLICATED"));
		return false;
	}

	return true;
}

bool MOUSECTL::CheckInterfaces()
{
	if (MouseControlAPI::CheckInterfaces(list_ids))
		return true;

	if (list_ids.empty())
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_NO_INTERFACES"));
	else
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MISSING_INTERFACES"));

	return false;
}

const char *MOUSECTL::GetMapStatusStr(const MouseMapStatus map_status)
{
	switch (map_status) {
	case MouseMapStatus::HostPointer:
		return MSG_Get("SHELL_CMD_MOUSECTL_TABLE_STATUS_HOST");
	case MouseMapStatus::Mapped:
		return MSG_Get("SHELL_CMD_MOUSECTL_TABLE_STATUS_MAPPED");
	case MouseMapStatus::Disconnected:
		return MSG_Get("SHELL_CMD_MOUSECTL_TABLE_STATUS_DISCONNECTED");
	case MouseMapStatus::Disabled:
		return MSG_Get("SHELL_CMD_MOUSECTL_TABLE_STATUS_DISABLED");
	default:
		assert(false); // missing implementation
		return nullptr;
	}
}

bool MOUSECTL::CmdShow(const bool show_all)
{
	MouseControlAPI mouse_config_api;
	const auto info_interfaces = mouse_config_api.GetInfoInterfaces();

	bool show_mapped   = false;
	bool hint_rate_com = false;
	bool hint_rate_min = false;

	// Display emulated interface list
	WriteOut("\n");
	WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_HEADER1"));
	WriteOut("\n");
	for (const auto &entry : info_interfaces) {
		if (!entry.IsEmulated())
			continue;
		const auto interface_id  = entry.GetInterfaceId();
		const auto rate_hz       = entry.GetRate();
		const bool rate_enforced = entry.GetMinRate();

		if (rate_enforced)
			hint_rate_min = true;

		if (interface_id == MouseInterfaceId::COM1 ||
		    interface_id == MouseInterfaceId::COM2 ||
		    interface_id == MouseInterfaceId::COM3 ||
		    interface_id == MouseInterfaceId::COM4)
			hint_rate_com = true;

		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_LAYOUT1"),
		         MouseControlAPI::GetInterfaceNameStr(interface_id).c_str(),
		         entry.GetSensitivityX(),
		         entry.GetSensitivityY(),
		         rate_enforced ? "*" : "",
		         rate_hz ? std::to_string(rate_hz).c_str() : "-",
		         convert_ansi_markup(GetMapStatusStr(entry.GetMapStatus()))
		                 .c_str());
		WriteOut("\n");

		if (entry.GetMapStatus() == MouseMapStatus::Mapped)
			show_mapped = true;
	}
	WriteOut("\n");

	const bool hint = hint_rate_com || hint_rate_min;
	if (hint) {
		if (hint_rate_com) {
			WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_HINT_RATE_COM"));
			WriteOut("\n");
		}
		if (hint_rate_min) {
			WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_HINT_RATE_MIN"));
			WriteOut("\n");
		}
		WriteOut("\n");
	}

	if (!show_all && !show_mapped)
		return true;

	const auto info_physical = mouse_config_api.GetInfoPhysical();
	if (info_physical.empty()) {
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_NO_PHYSICAL_MICE"));
		WriteOut("\n\n");
		return true;
	}

	if (hint)
		WriteOut("\n");
	WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_HEADER2"));
	WriteOut("\n");

	// Display physical mice mapped to some interface
	bool needs_newline = false;
	for (const auto &entry : info_interfaces) {
		if (!entry.IsMapped() || entry.IsMappedDeviceDisconnected())
			continue;
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_LAYOUT2"),
		         MouseControlAPI::GetInterfaceNameStr(entry.GetInterfaceId())
		                 .c_str(),
		         entry.GetMappedDeviceName().c_str());
		WriteOut("\n");
		needs_newline = true;
	}

	if (!show_all) {
		if (needs_newline)
			WriteOut("\n");
		return true;
	}

	// Display physical mice not mapped to any interface
	for (const auto &entry : info_physical) {
		if (entry.IsMapped() || entry.IsDeviceDisconnected())
			continue;
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_LAYOUT2_UNMAPPED"),
		         entry.GetDeviceName().c_str());
		WriteOut("\n");
	}
	WriteOut("\n");

	return true;
}

void MOUSECTL::FinalizeMapping()
{
	WriteOut("\n");
	WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MAP_HINT"));
	WriteOut("\n\n");

	GFX_MouseCaptureAfterMapping();
}

bool MOUSECTL::CmdMap(const MouseInterfaceId interface_id, const std::string &pattern)
{
	std::regex regex;
	if (!MouseControlAPI::PatternToRegex(pattern, regex)) {
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_PATTERN"));
		return false;
	}

	if (MouseControlAPI::IsNoMouseMode()) {
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MAPPING_NO_MOUSE"));
		return false;
	}

	MouseControlAPI mouse_config_api;
	if (!mouse_config_api.Map(interface_id, regex)) {
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_NO_MATCH"));
		return false;
	}

	FinalizeMapping();
	return true;
}

bool MOUSECTL::CmdMap()
{
	assert(!list_ids.empty());

	if (MouseControlAPI::IsNoMouseMode()) {
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MAPPING_NO_MOUSE"));
		return false;
	}

	MouseControlAPI mouse_config_api;
	const auto info_physical = mouse_config_api.GetInfoPhysical();

	if (info_physical.empty()) {
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_NO_PHYSICAL_MICE"));
		WriteOut("\n\n");
		return false;
	}

	// Clear the current mapping before starting interactive mapper
	std::vector<MouseInterfaceId> empty;
	mouse_config_api.UnMap(empty);

	WriteOut("\n");
	WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MAP_ADVICE"));
	WriteOut("\n\n");

	for (const auto &interface_id : list_ids) {
		WriteOut(convert_ansi_markup("[color=cyan]%-4s[reset]   ?").c_str(),
		         MouseControlAPI::GetInterfaceNameStr(interface_id).c_str());

		uint8_t device_id = 0;
		if (!mouse_config_api.ProbeForMapping(device_id)) {
			mouse_config_api.UnMap(empty);
			WriteOut("\b");
			WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MAP_CANCEL"));
			WriteOut("\n\n");
			return false;
		}

		WriteOut("\b");
		WriteOut(info_physical[device_id].GetDeviceName().c_str());
		WriteOut("\n");
		mouse_config_api.Map(interface_id, device_id);
	}

	FinalizeMapping();
	return true;
}

bool MOUSECTL::CmdUnMap()
{
	MouseControlAPI mouse_config_api;
	mouse_config_api.UnMap(list_ids);
	return true;
}

bool MOUSECTL::CmdOnOff(const bool enable)
{
	MouseControlAPI mouse_config_api;
	mouse_config_api.OnOff(list_ids, enable);
	return true;
}

bool MOUSECTL::CmdReset()
{
	MouseControlAPI mouse_config_api;
	mouse_config_api.Reset(list_ids);
	return true;
}

bool MOUSECTL::CmdSensitivity(const std::string &param_x, const std::string &param_y)
{
	int16_t value_x = 0;
	int16_t value_y = 0;
	if (!ParseSensitivity(param_x, value_x) || !ParseSensitivity(param_y, value_y))
		return false;

	MouseControlAPI mouse_config_api;
	mouse_config_api.SetSensitivity(list_ids, value_x, value_y);
	return true;
}

bool MOUSECTL::CmdSensitivityX(const std::string &param)
{
	int16_t value = 0;
	if (!ParseSensitivity(param, value))
		return false;

	MouseControlAPI mouse_config_api;
	mouse_config_api.SetSensitivityX(list_ids, value);
	return true;
}

bool MOUSECTL::CmdSensitivityY(const std::string &param)
{
	int16_t value = 0;
	if (!ParseSensitivity(param, value))
		return false;

	MouseControlAPI mouse_config_api;
	mouse_config_api.SetSensitivityY(list_ids, value);
	return true;
}

bool MOUSECTL::CmdSensitivity()
{
	MouseControlAPI mouse_config_api;
	mouse_config_api.ResetSensitivity(list_ids);
	return true;
}

bool MOUSECTL::CmdSensitivityX()
{
	MouseControlAPI mouse_config_api;
	mouse_config_api.ResetSensitivityX(list_ids);
	return true;
}

bool MOUSECTL::CmdSensitivityY()
{
	MouseControlAPI mouse_config_api;
	mouse_config_api.ResetSensitivityY(list_ids);
	return true;
}

bool MOUSECTL::CmdMinRate(const std::string &param)
{
	const auto &valid_list = MouseControlAPI::GetValidMinRateList();
	const auto &valid_str  = MouseControlAPI::GetValidMinRateStr();

	int tmp = 0;
	if (!ParseIntParam(param, tmp)) {
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_MIN_RATE"),
		         valid_str.c_str());
		return false;
	}

	if (tmp < 0 || tmp > UINT16_MAX) {
		// Parameter way out of range
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_MIN_RATE"),
		         valid_str.c_str());
		return false;
	}

	const auto value_hz = static_cast<uint16_t>(tmp);
	if (!contains(valid_list, value_hz)) {
		// Parameter not in the list of allowed values
		WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_MIN_RATE"),
		         valid_str.c_str());
		return false;
	}

	MouseControlAPI mouse_config_api;
	mouse_config_api.SetMinRate(list_ids, value_hz);
	return true;
}

bool MOUSECTL::CmdMinRate()
{
	MouseControlAPI mouse_config_api;
	mouse_config_api.ResetMinRate(list_ids);
	return true;
}

void MOUSECTL::AddMessages()
{
	MSG_Add("SHELL_CMD_MOUSECTL_HELP_LONG",
	        "Manages physical and logical mice.\n"
	        "\n"
	        "Usage:\n"
	        "  [color=green]mousectl[reset] [-all]\n"
	        "  [color=green]mousectl[reset] [color=white]INTERFACE[reset] -map [color=cyan]NAME[reset]\n"
	        "  [color=green]mousectl[reset] [color=white]INTERFACE[reset] [[color=white]INTERFACE[reset] ...] -map\n"
	        "  [color=green]mousectl[reset] [[color=white]INTERFACE[reset] ...] -unmap | -on | -off | -reset\n"
	        "  [color=green]mousectl[reset] [[color=white]INTERFACE[reset] ...] -s | -sx | -sy [sensitivity]\n"
	        "  [color=green]mousectl[reset] [[color=white]INTERFACE[reset] ...] -s sensitivity_x sensitivity_y\n"
	        "  [color=green]mousectl[reset] [[color=white]INTERFACE[reset] ...] -r [min_rate]\n"
	        "\n"
	        "Where:\n"
	        "  [color=white]INTERFACE[reset]      one of [color=white]DOS[reset], [color=white]PS/2[reset], [color=white]COM1[reset], [color=white]COM2[reset], [color=white]COM3[reset], [color=white]COM4[reset]\n"
	        "  -map -unmap    maps/unmaps physical mouse, honors DOS wildcards in [color=cyan]NAME[reset]\n"
	        "  -s -sx -sy     sets sensitivity / for x axis / for y axis, from -999 to +999\n"
	        "  -r             sets minimum mouse sampling rate\n"
	        "  -on -off       enables or disables mouse on the given interface\n"
	        "  -reset         restores all mouse settings from the configuration file\n"
	        "\n"
	        "Notes:\n"
	        "  - if sensitivity or rate is omitted, it is reset to default value\n"
	        "\n"
	        "Examples:\n"
	        "  [color=green]mousectl[reset] [color=white]DOS[reset] [color=white]COM1[reset] -map    ; asks user to select mice for a two player game");

	MSG_Add("SHELL_CMD_MOUSECTL_SYNTAX", "Wrong command syntax.");
	MSG_Add("SHELL_CMD_MOUSECTL_SYNTAX_PATTERN",
	        "Wrong syntax, only ASCII characters allowed in pattern.");
	MSG_Add("SHELL_CMD_MOUSECTL_SYNTAX_SENSITIVITY",
	        "Wrong syntax, sensitivity needs to be in -999 to +999 range.");
	MSG_Add("SHELL_CMD_MOUSECTL_SYNTAX_DUPLICATED",
	        "Wrong syntax, duplicated mouse interfaces.");
	MSG_Add("SHELL_CMD_MOUSECTL_SYNTAX_MIN_RATE",
	        "Wrong syntax, sampling rate has to be one of:\n%s");

	MSG_Add("SHELL_CMD_MOUSECTL_MAPPING_NO_MOUSE",
	        "Mapping not available in NoMouse mode.");
	MSG_Add("SHELL_CMD_MOUSECTL_NO_INTERFACES", "No mouse interfaces available.");
	MSG_Add("SHELL_CMD_MOUSECTL_MISSING_INTERFACES",
	        "Mouse interface not available.");
	MSG_Add("SHELL_CMD_MOUSECTL_NO_PHYSICAL_MICE", "No physical mice detected.");
	MSG_Add("SHELL_CMD_MOUSECTL_NO_MATCH",
	        "No available mouse matching the pattern found.");

	MSG_Add("SHELL_CMD_MOUSECTL_TABLE_HEADER1",
	        "[color=white]Interface      Sensitivity      Rate (Hz)     Status[reset]");
	MSG_Add("SHELL_CMD_MOUSECTL_TABLE_LAYOUT1",
	        "[color=cyan]%-4s[reset]          X:%+.3d Y:%+.3d       %1s %3s       %s");

	MSG_Add("SHELL_CMD_MOUSECTL_TABLE_HEADER2",
	        "[color=white]Interface     Mouse Name[reset]");
	MSG_Add("SHELL_CMD_MOUSECTL_TABLE_LAYOUT2",
	        "[color=cyan]%-4s[reset]          %s");
	MSG_Add("SHELL_CMD_MOUSECTL_TABLE_LAYOUT2_UNMAPPED", "not mapped    %s");

	MSG_Add("SHELL_CMD_MOUSECTL_TABLE_STATUS_HOST", "uses system pointer");
	MSG_Add("SHELL_CMD_MOUSECTL_TABLE_STATUS_MAPPED", "mapped physical mouse");
	MSG_Add("SHELL_CMD_MOUSECTL_TABLE_STATUS_DISCONNECTED",
	        "[color=red]mapped mouse disconnected[reset]");
	MSG_Add("SHELL_CMD_MOUSECTL_TABLE_STATUS_DISABLED", "disabled");

	MSG_Add("SHELL_CMD_MOUSECTL_TABLE_HINT_RATE_COM",
	        "Sampling rates for mice on [color=cyan]COM[reset] interfaces are estimations only.");
	MSG_Add("SHELL_CMD_MOUSECTL_TABLE_HINT_RATE_MIN",
	        "Sampling rates with minimum value set are marked with '*'.");

	MSG_Add("SHELL_CMD_MOUSECTL_MAP_ADVICE",
	        "Click [color=white]left[reset] mouse button to map the physical mouse to the interface. Clicking\n"
	        "any other button cancels the mapping and assigns system pointer to all the\n"
	        "mouse interfaces.");
	MSG_Add("SHELL_CMD_MOUSECTL_MAP_CANCEL", "(mapping cancelled)");
	MSG_Add("SHELL_CMD_MOUSECTL_MAP_HINT",
	        "Mouse captured. Seamless mouse integration is always disabled while mapping is\n"
	        "in effect and mapped mice always receive raw input events.");
}