1 { 2 This file is part of the Free Pascal run time library. 3 4 A file in Amiga system run time library. 5 Copyright (c) 1998-2003 by Nils Sjoholm 6 member of the Amiga RTL development team. 7 8 See the file COPYING.FPC, included in this distribution, 9 for details about the copyright. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 15 **********************************************************************} 16 17 { 18 To call the two routines defined below, you'll need to set 19 ConsoleBase to an appropriate value. 20 21 nils.sjoholm@mailbox.swipnet.se Nils Sjoholm 22 } 23 24 unit console; 25 26 interface 27 28 uses 29 exec, inputevent, keymap; 30 31 const 32 33 {***** Console commands *****} 34 CD_ASKKEYMAP = CMD_NONSTD + 0; 35 CD_SETKEYMAP = CMD_NONSTD + 1; 36 CD_ASKDEFAULTKEYMAP = CMD_NONSTD + 2; 37 CD_SETDEFAULTKEYMAP = CMD_NONSTD + 3; 38 39 {***** SGR parameters *****} 40 41 SGR_PRIMARY = 0; 42 SGR_BOLD = 1; 43 SGR_ITALIC = 3; 44 SGR_UNDERSCORE = 4; 45 SGR_NEGATIVE = 7; 46 47 SGR_NORMAL = 22; // default foreground color, not bold 48 SGR_NOTITALIC = 23; 49 SGR_NOTUNDERSCORE = 24; 50 SGR_POSITIVE = 27; 51 52 { these names refer to the ANSI standard, not the implementation } 53 54 SGR_BLACK = 30; 55 SGR_RED = 31; 56 SGR_GREEN = 32; 57 SGR_YELLOW = 33; 58 SGR_BLUE = 34; 59 SGR_MAGENTA = 35; 60 SGR_CYAN = 36; 61 SGR_WHITE = 37; 62 SGR_DEFAULT = 39; 63 64 SGR_BLACKBG = 40; 65 SGR_REDBG = 41; 66 SGR_GREENBG = 42; 67 SGR_YELLOWBG = 43; 68 SGR_BLUEBG = 44; 69 SGR_MAGENTABG = 45; 70 SGR_CYANBG = 46; 71 SGR_WHITEBG = 47; 72 SGR_DEFAULTBG = 49; 73 74 { these names refer to the implementation, they are the preferred } 75 { names for use with the Amiga console device. } 76 77 SGR_CLR0 = 30; 78 SGR_CLR1 = 31; 79 SGR_CLR2 = 32; 80 SGR_CLR3 = 33; 81 SGR_CLR4 = 34; 82 SGR_CLR5 = 35; 83 SGR_CLR6 = 36; 84 SGR_CLR7 = 37; 85 86 SGR_CLR0BG = 40; 87 SGR_CLR1BG = 41; 88 SGR_CLR2BG = 42; 89 SGR_CLR3BG = 43; 90 SGR_CLR4BG = 44; 91 SGR_CLR5BG = 45; 92 SGR_CLR6BG = 46; 93 SGR_CLR7BG = 47; 94 95 {***** DSR parameters *****} 96 DSR_CPR = 6; 97 98 {***** CTC parameters *****} 99 CTC_HSETTAB = 0; 100 CTC_HCLRTAB = 2; 101 CTC_HCLRTABSALL = 5; 102 103 {***** TBC parameters *****} 104 TBC_HCLRTAB = 0; 105 TBC_HCLRTABSALL = 3; 106 107 {***** SM and RM parameters *****} 108 M_LNM = 20; // linefeed newline mode 109 M_ASM = '>1'; // auto scroll mode 110 M_AWM = '?7'; // auto wrap mode 111 112 var 113 ConsoleDevice: PDevice = nil; 114 CDInputHandlernull115function CDInputHandler(Events: PInputEvent location 'a0'; ConsoleDev: PLibrary location 'a1'): PInputEvent; syscall ConsoleDevice 042; RawKeyConvertnull116function RawKeyConvert(Events: PInputEvent location 'a0'; Buffer: PCHAR location 'a1'; Length: LongInt location 'd1'; KeyMap: PKeyMap location 'a2'): LongInt; syscall ConsoleDevice 048; 117 118 implementation 119 120 end. 121