1 /**
2  * Consoleur: a package for interaction with character-oriented terminal emulators
3  *
4  * Copyright: Maxim Freck, 2017.
5  * Authors:   Maxim Freck <maxim@freck.pp.ru>
6  * License:   $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
7  */
8 module consoleur.extended.posix;
9 version(Posix) {
10 
11 /*******
12  * Enables keypad mode
13  * Returns: false if option is not available, otherwise true
14  */
15 bool enableKeypad() @safe
16 {
17 	import consoleur.commands: invokeCommand, TermCommand;
18 	return invokeCommand(TermCommand.keypadXmit);
19 }
20 
21 /*******
22  * Disables keypad mode
23  * Returns: false if option is not available, otherwise true
24  */
25 bool disableKeypad() @safe
26 {
27 	import consoleur.commands: invokeCommand, TermCommand;
28 	return invokeCommand(TermCommand.keypadLocal);
29 }
30 
31 /*******
32  * Sets console title
33  *
34  * Params:
35  *  title = The title
36  */
37 void setConsoleTitle(string title) @safe
38 {
39 	import consoleur.core: isAttyOut, rawStdout;
40 	if (isAttyOut()) {
41 		rawStdout("\033]0;"~title~"\007");
42 	} else {
43 		import std.stdio: writeln;
44 		writeln("**"~title~"**");
45 	}
46 }
47 
48 }