「App:Library:FabGL:Class:Terminal」の版間の差分
9行目: | 9行目: | ||
==Public Member Functions== | ==Public Member Functions== | ||
{| class="wikitable" | {| class="wikitable" | ||
− | |void activate (TerminalTransition transition=TerminalTransition::None) | + | | |
− | + | ===== void activate (TerminalTransition transition=TerminalTransition::None) ===== | |
− | : | + | :この端子を入出力用にアクティブにします。 |
|- | |- | ||
− | |int available () | + | | |
− | + | ===== int available () ===== | |
− | : | + | :キーボードキューで使用可能なコードの数を取得します。 |
|- | |- | ||
− | |int availableForWrite () | + | | |
− | + | ===== int availableForWrite () ===== | |
− | : | + | :表示入力キューが引き続き受け入れることができるコードの数を決定します。 |
|- | |- | ||
− | |bool begin (BaseDisplayController *displayController, int maxColumns=-1, int maxRows=-1, Keyboard *keyboard=nullptr) | + | | |
− | + | ===== bool begin (BaseDisplayController *displayController, int maxColumns=-1, int maxRows=-1, Keyboard *keyboard=nullptr) ===== | |
− | : | + | :端末を初期化します。 |
|- | |- | ||
− | |Canvas * canvas () | + | | |
− | + | ===== Canvas * canvas () ===== | |
− | : | + | :関連するキャンバスオブジェクトを取得します。 |
|- | |- | ||
− | |void clear (bool moveCursor=true) | + | | |
− | + | ===== void clear (bool moveCursor=true) ===== | |
− | : | + | :画面をクリアします。 |
|- | |- | ||
− | |void connectLocally () | + | | |
− | + | ===== void connectLocally () ===== | |
− | : | + | :ローカルでの端末の使用を許可します。 |
|- | |- | ||
− | |void connectSerialPort (HardwareSerial &serialPort, bool autoXONXOFF=true) | + | | |
− | + | ===== void connectSerialPort (HardwareSerial &serialPort, bool autoXONXOFF=true) ===== | |
− | : | + | :指定されたシリアルポートを使用してリモートホストを接続します。 |
|- | |- | ||
− | |void connectSerialPort (uint32_t baud, uint32_t config, int rxPin, int txPin, FlowControl flowControl, bool inverted=false, int rtsPin=-1, int ctsPin=-1) | + | | |
− | + | ===== void connectSerialPort (uint32_t baud, uint32_t config, int rxPin, int txPin, FlowControl flowControl, bool inverted=false, int rtsPin=-1, int ctsPin=-1) ===== | |
− | : | + | :UARTを使用してリモートホストを接続します。 |
|- | |- | ||
− | |bool CTSStatus () | + | | |
− | + | ===== bool CTSStatus () ===== | |
− | : | + | :現在のCTS信号ステータスを報告します。 |
|- | |- | ||
− | |void deactivate () | + | | |
− | + | ===== void deactivate () ===== | |
− | : | + | :この端末を非アクティブにします。 |
|- | |- | ||
− | |void disableSerialPortRX (bool value) | + | | |
− | + | ===== void disableSerialPortRX (bool value) ===== | |
− | : | + | :シリアルポートRXを無効/有効にします。 |
|- | |- | ||
− | |void disconnectLocally () | + | | |
− | + | ===== void disconnectLocally () ===== | |
− | : | + | :ローカルでの端末の使用を回避します。 |
|- | |- | ||
− | |void enableCursor (bool value) | + | | |
− | + | ===== void enableCursor (bool value) ===== | |
− | : | + | :カーソルを有効または無効にします。 |
|- | |- | ||
− | |void end () | + | | |
− | + | ===== void end () ===== | |
− | : | + | :ターミナルを完成させます。 |
|- | |- | ||
− | |void flowControl (bool enableRX) | + | | |
− | + | ===== void flowControl (bool enableRX) ===== | |
− | : | + | :ホストがデータを送信することを許可/禁止します。 |
|- | |- | ||
− | |bool flowControl () | + | | |
− | + | ===== bool flowControl () ===== | |
− | : | + | :ホストがデータを受信できるかどうかを確認します。 |
|- | |- | ||
− | |void flush (bool waitVSync) | + | | |
− | + | ===== void flush (bool waitVSync) ===== | |
− | : | + | :ディスプレイに送信されたすべてのコードが処理されるのを待ちます。 |
|- | |- | ||
− | |void flush () | + | | |
− | + | ===== void flush () ===== | |
− | : | + | :ディスプレイに送信されたすべてのコードが処理されるのを待ちます。 |
|- | |- | ||
− | |int getColumns () | + | | |
− | + | ===== int getColumns () ===== | |
− | : | + | :列数を返します。 |
|- | |- | ||
− | |int getRows () | + | | |
− | + | ===== int getRows () ===== | |
− | : | + | :行数を返します。 |
|- | |- | ||
− | |bool isActive () | + | | |
− | + | ===== bool isActive () ===== | |
− | : | + | :この端末がアクティブかどうかを判別します。 |
|- | |- | ||
− | |Keyboard * keyboard () | + | | |
− | + | ===== Keyboard * keyboard () ===== | |
− | : | + | :関連するキーボードオブジェクトを取得します。 |
|- | |- | ||
− | |void loadFont (FontInfo const *font) | + | | |
− | + | ===== void loadFont (FontInfo const *font) ===== | |
− | : | + | :使用するフォントを設定します。 |
|- | |- | ||
− | |void localInsert (uint8_t c) | + | | |
− | + | ===== void localInsert (uint8_t c) ===== | |
− | : | + | :キーをキーボードキューに挿入します。 |
|- | |- | ||
− | |void localWrite (uint8_t c) | + | | |
− | + | ===== void localWrite (uint8_t c) ===== | |
− | : | + | :キーをキーボードキューに挿入します。 |
|- | |- | ||
− | |void localWrite (char const *str) | + | | |
− | + | ===== void localWrite (char const *str) ===== | |
− | : | + | :キーの文字列をキーボードキューに挿入します。 |
|- | |- | ||
− | |int peek () | + | | |
− | + | ===== int peek () ===== | |
− | : | + | :次のコードに進むことなく、キーボードからコードを読み取ります。 |
|- | |- | ||
− | |void pollSerialPort () | + | | |
− | + | ===== void pollSerialPort () ===== | |
− | : | + | :着信データ用にシリアルポートをプールします。 |
|- | |- | ||
− | |int read () | + | | |
− | + | ===== int read () ===== | |
− | : | + | :キーボードからコードを読み取ります。 |
|- | |- | ||
− | |int read (int timeOutMS) | + | | |
− | + | ===== int read (int timeOutMS) ===== | |
− | : | + | :キーボード指定タイムアウトからコードを読み取ります。 |
|- | |- | ||
− | |bool RTSStatus () | + | | |
− | + | ===== bool RTSStatus () ===== | |
− | : | + | :現在のRTS信号ステータスを報告します。 |
|- | |- | ||
− | |void send (uint8_t c) | + | | |
− | + | ===== void send (uint8_t c) ===== | |
− | : | + | :localWrite()と同様ですが、接続されている場合はシリアルポートにも送信します。 |
|- | |- | ||
− | |void send (char const *str) | + | | |
− | + | ===== void send (char const *str) ===== | |
− | : | + | :localWrite()と同様ですが、接続されている場合はシリアルポートにも送信します。 |
|- | |- | ||
− | |void setBackgroundColor (Color color, bool setAsDefault=true) | + | | |
− | + | ===== void setBackgroundColor (Color color, bool setAsDefault=true) ===== | |
− | : | + | :背景色を設定します。 |
|- | |- | ||
− | |void setColorForAttribute (CharStyle attribute, Color color, bool maintainStyle) | + | | |
− | + | ===== void setColorForAttribute (CharStyle attribute, Color color, bool maintainStyle) ===== | |
− | : | + | :指定した属性の色を選択します。 |
|- | |- | ||
− | |void setColorForAttribute (CharStyle attribute) | + | | |
− | + | ===== void setColorForAttribute (CharStyle attribute) ===== | |
− | : | + | :指定された属性の色を無効にします。 |
|- | |- | ||
− | |void setForegroundColor (Color color, bool setAsDefault=true) | + | | |
− | + | ===== void setForegroundColor (Color color, bool setAsDefault=true) ===== | |
− | : | + | :前景色を設定します。 |
|- | |- | ||
− | |void setLogStream (Stream &stream) | + | | |
− | + | ===== void setLogStream (Stream &stream) ===== | |
− | : | + | :デバッグログを出力するストリームを設定します。 |
|- | |- | ||
− | |void setRTSStatus (bool value) | + | | |
− | + | ===== void setRTSStatus (bool value) ===== | |
− | : | + | :RTS信号のステータスを設定します。 |
|- | |- | ||
− | | | + | | |
− | + | ===== oid setTerminalType (TermType value) ===== | |
− | : | + | :エミュレートする端末タイプを設定します。 |
|- | |- | ||
− | |SoundGenerator * soundGenerator () | + | | |
− | + | ===== SoundGenerator * soundGenerator () ===== | |
− | : | + | :埋め込まれたサウンドジェネレータを取得します。 |
|- | |- | ||
− | |TermInfo const & terminalType () | + | | |
− | + | ===== TermInfo const & terminalType () ===== | |
− | : | + | :現在の端末タイプを決定します。 |
|- | |- | ||
− | |void unRead (uint8_t c) | + | | |
− | + | ===== void unRead (uint8_t c) ===== | |
− | : | + | :キーをキーボードキューに挿入します。 |
|- | |- | ||
− | |bool waitFor (int value, int timeOutMS=-1) | + | | |
− | + | ===== bool waitFor (int value, int timeOutMS=-1) ===== | |
− | : | + | :キーボードから特定のコードを待ち、以前のコードをすべて破棄します。 |
|- | |- | ||
− | |size_t write (const uint8_t *buffer, size_t size) | + | | |
− | + | ===== size_t write (const uint8_t *buffer, size_t size) ===== | |
− | : | + | :指定された数のコードをディスプレイに送信します。 |
|- | |- | ||
− | |size_t write (uint8_t c) | + | | |
− | + | ===== size_t write (uint8_t c) ===== | |
− | : | + | :単一のコードをディスプレイに送信します。 |
|- | |- | ||
− | |bool XOFFStatus () | + | | |
− | + | ===== bool XOFFStatus () ===== | |
− | : | + | :TXがアクティブかどうかを報告します。 |
|} | |} | ||
==Public Attributes== | ==Public Attributes== | ||
{| class="wikitable" | {| class="wikitable" | ||
− | |Delegate< char const * > onUserSequence | + | | |
− | + | ===== Delegate< char const * > [http://www.fabglib.org/classfabgl_1_1_terminal_af05ed15439143da3bc5b6b58d2e65daa.html#af05ed15439143da3bc5b6b58d2e65daa onUserSequence] ===== | |
− | : | + | :新しいユーザーシーケンスが受信されるたびに、デリゲートが呼び出されます。 |
|- | |- | ||
− | |Delegate< VirtualKey *, bool > onVirtualKey | + | | |
− | + | ===== Delegate< [[App:Library:FabGL:Enum:VirtualKey|VirtualKey]] *, bool > [http://www.fabglib.org/classfabgl_1_1_terminal_a41c6325db16da56b81f05e8d9dcabd0e.html#a41c6325db16da56b81f05e8d9dcabd0e onVirtualKey] ===== | |
− | : | + | :キーボードから新しい仮想キーを受信するたびに、デリゲートが呼び出されます。 |
|- | |- | ||
− | |Delegate< VirtualKeyItem * > onVirtualKeyItem | + | | |
− | + | ===== Delegate< [[App:Library:FabGL:Struct:VirtualKeyItem|VirtualKeyItem]] * > [http://www.fabglib.org/classfabgl_1_1_terminal_abeb3bffa27a71e1c6dbdba8ac88d14fe.html#abeb3bffa27a71e1c6dbdba8ac88d14fe onVirtualKeyItem] ===== | |
− | : | + | :シフト状態を含め、キーボードから新しい仮想キーを受信するたびに、デリゲートが呼び出されます。 |
|} | |} | ||
==Static Public Attributes== | ==Static Public Attributes== | ||
{| class="wikitable" | {| class="wikitable" | ||
− | |static int inputConsumerTaskStackSize = 2048 | + | | |
− | : | + | ===== static int [http://www.fabglib.org/classfabgl_1_1_terminal_aade947364dc37ddbcd51607715332dd5.html#aade947364dc37ddbcd51607715332dd5 inputConsumerTaskStackSize] = 2048 ===== |
+ | :ターミナル入力ストリームを処理するタスクのスタックサイズ。 | ||
|- | |- | ||
− | |static int inputQueueSize = 1024 | + | | |
− | : | + | ===== static int [http://www.fabglib.org/classfabgl_1_1_terminal_a8508592f91c82a7a4a0c2edf4effce61.html#a8508592f91c82a7a4a0c2edf4effce61 inputQueueSize] = 1024 ===== |
+ | :端末が一時停止せずに「書き込む」ことができる文字数(シリアルポートで文字が失われた場合は増加します)。 | ||
|- | |- | ||
− | |static int keyboardReaderTaskStackSize = 2048 | + | | |
− | : | + | ===== static int [http://www.fabglib.org/classfabgl_1_1_terminal_a77b40b81c5e1ba039ed39891bf8c6a20.html#a77b40b81c5e1ba039ed39891bf8c6a20 keyboardReaderTaskStackSize] = 2048 ===== |
+ | :キーボードからキーを読み取り、ANSI/VTコードをTerminalの出力ストリームに送信するタスクのスタックサイズです。 | ||
|} | |} | ||
==Detailed Description== | ==Detailed Description== | ||
− | + | ANSI-VT100互換のディスプレイ端末。 | |
− | + | 非CSIコード(RIS、IND、DECID、DECDHLなど)など、一般的なANSI、VT52、VT100、VT200、VT300、VT420、およびVT500エスケープコードのほとんどを実装します。 | |
− | + | CSIコード(プライベートモード、CUP、TBCなど)、CSI-SGRコード(太字、斜体、点滅など)、DCSコード(DECRQSSなど)のように。 | |
− | + | PS / 2キーボード仮想キーからANSIまたはVTコード(キーパッド、カーソルキー、ファンクションキーなど)への変換をサポートします。 | |
− | + | 端末は、シリアルポートから表示するコードを受信することも、アプリケーションから直接制御することもできます。同様に、ターミナルはキーボードコードをシリアルポートまたはアプリケーションに直接送信できます。 | |
− | + | デフォルトでは、640x350で80x25または132x25文字をサポートします。ただし、カスタムフォントを指定すると、任意のカスタム解像度とテキストバッファサイズがサポートされます。 | |
− | + | カーソルのスタイルには、点滅または非点滅の3つのスタイル(ブロック、下線、バー)があります。 | |
− | + | ターミナルはStreamを継承するため、アプリケーションはすべてのStreamおよびPrint入力および出力メソッドを使用できます。 | |
− | + | ターミナルは、VTTEST VT100/VT102互換性テストスコアシートの95/110に合格します。 | |
− | '''Example1: | + | === '''Example1:''' === |
{| class="wikitable" | {| class="wikitable" | ||
|fabgl::VGAController VGAController; | |fabgl::VGAController VGAController; | ||
307行目: | 310行目: | ||
|} | |} | ||
− | '''Example2: | + | === '''Example2:''' === |
{| class="wikitable" | {| class="wikitable" | ||
|fabgl::VGAController VGAController; | |fabgl::VGAController VGAController; | ||
344行目: | 347行目: | ||
|} | |} | ||
− | '''Examples: | + | === '''Examples:''' === |
:[http://www.fabglib.org/_others_2_keyboard_scan_codes_2_keyboard_scan_codes_8ino-example.html#_a1 Others/KeyboardScanCodes/KeyboardScanCodes.ino], [http://www.fabglib.org/_others_2_keyboard_virtual_keys_2_keyboard_virtual_keys_8ino-example.html#_a1 Others/KeyboardVirtualKeys/KeyboardVirtualKeys.ino], [http://www.fabglib.org/_s_s_d1306__o_l_e_d_2128x32_2_simple_terminal_out_2_simple_terminal_out_8ino-example.html#_a2 SSD1306_OLED/128x32/SimpleTerminalOut/SimpleTerminalOut.ino], [http://www.fabglib.org/_s_s_d1306__o_l_e_d_2128x64_2_network_terminal_2_network_terminal_8ino-example.html#_a3 SSD1306_OLED/128x64/NetworkTerminal/NetworkTerminal.ino], [http://www.fabglib.org/_s_s_d1306__o_l_e_d_2128x64_2_r_t_clock_2_r_t_clock_8ino-example.html#_a4 SSD1306_OLED/128x64/RTClock/RTClock.ino], [http://www.fabglib.org/_s_s_d1306__o_l_e_d_2128x64_2_simple_terminal_out_2_simple_terminal_out_8ino-example.html#_a2 SSD1306_OLED/128x64/SimpleTerminalOut/SimpleTerminalOut.ino], [http://www.fabglib.org/_s_t7789__t_f_t_2240x240_2_simple_terminal_out_2_simple_terminal_out_8ino-example.html#_a1 ST7789_TFT/240x240/SimpleTerminalOut/SimpleTerminalOut.ino], [http://www.fabglib.org/_v_g_a_2_altair8800_2_altair8800_8ino-example.html#_a9 VGA/Altair8800/Altair8800.ino], [http://www.fabglib.org/_v_g_a_2_ansi_terminal_2_ansi_terminal_8ino-example.html#_a2 VGA/AnsiTerminal/AnsiTerminal.ino], [http://www.fabglib.org/_v_g_a_2_loopback_terminal_2_loopback_terminal_8ino-example.html#_a2 VGA/LoopbackTerminal/LoopbackTerminal.ino], [http://www.fabglib.org/_v_g_a_2_multitasking_c_p_m_2_multitasking_c_p_m_8ino-example.html#_a12 VGA/MultitaskingCPM/MultitaskingCPM.ino], [http://www.fabglib.org/_v_g_a_2_network_terminal_2_network_terminal_8ino-example.html#_a2 VGA/NetworkTerminal/NetworkTerminal.ino], [http://www.fabglib.org/_v_g_a_2_simple_terminal_out_2_simple_terminal_out_8ino-example.html#_a1 VGA/SimpleTerminalOut/SimpleTerminalOut.ino], [http://www.fabglib.org/_v_g_a_2_simple_text_terminal_out_2_simple_text_terminal_out_8ino-example.html#_a1 VGA/SimpleTextTerminalOut/SimpleTextTerminalOut.ino], and [http://www.fabglib.org/_v_g_a_2_songs_2_songs_8ino-example.html#_a3 VGA/Songs/Songs.ino]. | :[http://www.fabglib.org/_others_2_keyboard_scan_codes_2_keyboard_scan_codes_8ino-example.html#_a1 Others/KeyboardScanCodes/KeyboardScanCodes.ino], [http://www.fabglib.org/_others_2_keyboard_virtual_keys_2_keyboard_virtual_keys_8ino-example.html#_a1 Others/KeyboardVirtualKeys/KeyboardVirtualKeys.ino], [http://www.fabglib.org/_s_s_d1306__o_l_e_d_2128x32_2_simple_terminal_out_2_simple_terminal_out_8ino-example.html#_a2 SSD1306_OLED/128x32/SimpleTerminalOut/SimpleTerminalOut.ino], [http://www.fabglib.org/_s_s_d1306__o_l_e_d_2128x64_2_network_terminal_2_network_terminal_8ino-example.html#_a3 SSD1306_OLED/128x64/NetworkTerminal/NetworkTerminal.ino], [http://www.fabglib.org/_s_s_d1306__o_l_e_d_2128x64_2_r_t_clock_2_r_t_clock_8ino-example.html#_a4 SSD1306_OLED/128x64/RTClock/RTClock.ino], [http://www.fabglib.org/_s_s_d1306__o_l_e_d_2128x64_2_simple_terminal_out_2_simple_terminal_out_8ino-example.html#_a2 SSD1306_OLED/128x64/SimpleTerminalOut/SimpleTerminalOut.ino], [http://www.fabglib.org/_s_t7789__t_f_t_2240x240_2_simple_terminal_out_2_simple_terminal_out_8ino-example.html#_a1 ST7789_TFT/240x240/SimpleTerminalOut/SimpleTerminalOut.ino], [http://www.fabglib.org/_v_g_a_2_altair8800_2_altair8800_8ino-example.html#_a9 VGA/Altair8800/Altair8800.ino], [http://www.fabglib.org/_v_g_a_2_ansi_terminal_2_ansi_terminal_8ino-example.html#_a2 VGA/AnsiTerminal/AnsiTerminal.ino], [http://www.fabglib.org/_v_g_a_2_loopback_terminal_2_loopback_terminal_8ino-example.html#_a2 VGA/LoopbackTerminal/LoopbackTerminal.ino], [http://www.fabglib.org/_v_g_a_2_multitasking_c_p_m_2_multitasking_c_p_m_8ino-example.html#_a12 VGA/MultitaskingCPM/MultitaskingCPM.ino], [http://www.fabglib.org/_v_g_a_2_network_terminal_2_network_terminal_8ino-example.html#_a2 VGA/NetworkTerminal/NetworkTerminal.ino], [http://www.fabglib.org/_v_g_a_2_simple_terminal_out_2_simple_terminal_out_8ino-example.html#_a1 VGA/SimpleTerminalOut/SimpleTerminalOut.ino], [http://www.fabglib.org/_v_g_a_2_simple_text_terminal_out_2_simple_text_terminal_out_8ino-example.html#_a1 VGA/SimpleTextTerminalOut/SimpleTextTerminalOut.ino], and [http://www.fabglib.org/_v_g_a_2_songs_2_songs_8ino-example.html#_a3 VGA/Songs/Songs.ino]. | ||
− | Definition at line 953 of file terminal.h. | + | [http://www.fabglib.org/terminal_8h_source.html#l00953 Definition at line 953 of file terminal.h]. |
2022年3月23日 (水) 12:14時点における最新版
class Terminal
ANSI-VT100互換のディスプレイ端末。
#include <terminal.h> |
ストリームを継承します。
Public Member Functions
void activate (TerminalTransition transition=TerminalTransition::None)
|
int available ()
|
int availableForWrite ()
|
bool begin (BaseDisplayController *displayController, int maxColumns=-1, int maxRows=-1, Keyboard *keyboard=nullptr)
|
Canvas * canvas ()
|
void clear (bool moveCursor=true)
|
void connectLocally ()
|
void connectSerialPort (HardwareSerial &serialPort, bool autoXONXOFF=true)
|
void connectSerialPort (uint32_t baud, uint32_t config, int rxPin, int txPin, FlowControl flowControl, bool inverted=false, int rtsPin=-1, int ctsPin=-1)
|
bool CTSStatus ()
|
void deactivate ()
|
void disableSerialPortRX (bool value)
|
void disconnectLocally ()
|
void enableCursor (bool value)
|
void end ()
|
void flowControl (bool enableRX)
|
bool flowControl ()
|
void flush (bool waitVSync)
|
void flush ()
|
int getColumns ()
|
int getRows ()
|
bool isActive ()
|
Keyboard * keyboard ()
|
void loadFont (FontInfo const *font)
|
void localInsert (uint8_t c)
|
void localWrite (uint8_t c)
|
void localWrite (char const *str)
|
int peek ()
|
void pollSerialPort ()
|
int read ()
|
int read (int timeOutMS)
|
bool RTSStatus ()
|
void send (uint8_t c)
|
void send (char const *str)
|
void setBackgroundColor (Color color, bool setAsDefault=true)
|
void setColorForAttribute (CharStyle attribute, Color color, bool maintainStyle)
|
void setColorForAttribute (CharStyle attribute)
|
void setForegroundColor (Color color, bool setAsDefault=true)
|
void setLogStream (Stream &stream)
|
void setRTSStatus (bool value)
|
oid setTerminalType (TermType value)
|
SoundGenerator * soundGenerator ()
|
TermInfo const & terminalType ()
|
void unRead (uint8_t c)
|
bool waitFor (int value, int timeOutMS=-1)
|
size_t write (const uint8_t *buffer, size_t size)
|
size_t write (uint8_t c)
|
bool XOFFStatus ()
|
Public Attributes
Delegate< char const * > onUserSequence
|
Delegate< VirtualKey *, bool > onVirtualKey
|
Delegate< VirtualKeyItem * > onVirtualKeyItem
|
Static Public Attributes
static int inputConsumerTaskStackSize = 2048
|
static int inputQueueSize = 1024
|
static int keyboardReaderTaskStackSize = 2048
|
Detailed Description
ANSI-VT100互換のディスプレイ端末。
非CSIコード(RIS、IND、DECID、DECDHLなど)など、一般的なANSI、VT52、VT100、VT200、VT300、VT420、およびVT500エスケープコードのほとんどを実装します。
CSIコード(プライベートモード、CUP、TBCなど)、CSI-SGRコード(太字、斜体、点滅など)、DCSコード(DECRQSSなど)のように。
PS / 2キーボード仮想キーからANSIまたはVTコード(キーパッド、カーソルキー、ファンクションキーなど)への変換をサポートします。
端末は、シリアルポートから表示するコードを受信することも、アプリケーションから直接制御することもできます。同様に、ターミナルはキーボードコードをシリアルポートまたはアプリケーションに直接送信できます。
デフォルトでは、640x350で80x25または132x25文字をサポートします。ただし、カスタムフォントを指定すると、任意のカスタム解像度とテキストバッファサイズがサポートされます。
カーソルのスタイルには、点滅または非点滅の3つのスタイル(ブロック、下線、バー)があります。
ターミナルはStreamを継承するため、アプリケーションはすべてのStreamおよびPrint入力および出力メソッドを使用できます。
ターミナルは、VTTEST VT100/VT102互換性テストスコアシートの95/110に合格します。
Example1:
fabgl::VGAController VGAController;
fabgl::PS2Controller PS2Controller; fabgl::Terminal Terminal; // Setup 80x25 columns loop-back terminal (send what you type on keyboard to the display) void setup() { PS2Controller.begin(PS2Preset::KeyboardPort0); VGAController.begin(); VGAController.setResolution(VGA_640x350_70HzAlt1); Terminal.begin(&VGAController); Terminal.connectLocally(); // to use Terminal.read(), available(), etc.. Terminal.enableCursor(true); } void loop() { if (Terminal.available()) { char c = Terminal.read(); switch (c) { case 0x7F: // DEL -> backspace + ESC[K Terminal.write("\b\e[K"); break; case 0x0D: // CR -> CR + LF Terminal.write("\r\n"); break; case 32 ... 126: // printable chars Terminal.write(c); break; } } } |
Example2:
fabgl::VGAController VGAController;
fabgl::PS2Controller PS2Controller; fabgl::Terminal Terminal; // Setup 80x25 columns terminal using UART2 to communicate with the server, // VGA to display output and PS2 device as keyboard input void setup() { Serial2.begin(115200); PS2Controller.begin(PS2Preset::KeyboardPort0); VGAController.begin(); VGAController.setResolution(VGA_640x350_70HzAlt1); Terminal.begin(&VGAController); Terminal.connectSerialPort(Serial2); Terminal.enableCursor(true); } void loop() { Terminal.pollSerialPort(); } |
Examples:
- Others/KeyboardScanCodes/KeyboardScanCodes.ino, Others/KeyboardVirtualKeys/KeyboardVirtualKeys.ino, SSD1306_OLED/128x32/SimpleTerminalOut/SimpleTerminalOut.ino, SSD1306_OLED/128x64/NetworkTerminal/NetworkTerminal.ino, SSD1306_OLED/128x64/RTClock/RTClock.ino, SSD1306_OLED/128x64/SimpleTerminalOut/SimpleTerminalOut.ino, ST7789_TFT/240x240/SimpleTerminalOut/SimpleTerminalOut.ino, VGA/Altair8800/Altair8800.ino, VGA/AnsiTerminal/AnsiTerminal.ino, VGA/LoopbackTerminal/LoopbackTerminal.ino, VGA/MultitaskingCPM/MultitaskingCPM.ino, VGA/NetworkTerminal/NetworkTerminal.ino, VGA/SimpleTerminalOut/SimpleTerminalOut.ino, VGA/SimpleTextTerminalOut/SimpleTextTerminalOut.ino, and VGA/Songs/Songs.ino.
Definition at line 953 of file terminal.h.
The documentation for this struct was generated from the following file:
- terminal.h
- terminal.cpp