mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-10 04:40:25 +01:00
Add KEY_MAP constant
This commit is contained in:
parent
10eb791fea
commit
0a1ba5abcd
2 changed files with 7 additions and 29 deletions
|
@ -1,37 +1,12 @@
|
||||||
|
// SPDX-FileCopyrightText: 2021, 2024 Leroy Hopson <godot-xterm@leroy.nix.nz>
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
|
||||||
#include <xkbcommon/xkbcommon-keysyms.h>
|
#include <xkbcommon/xkbcommon-keysyms.h>
|
||||||
|
|
||||||
using namespace godot;
|
using namespace godot;
|
||||||
|
|
||||||
const std::map<const char *, const char *> Terminal::FONTS = {
|
|
||||||
{"normal_font", "res://addons/godot_xterm/fonts/normal.ttf"},
|
|
||||||
{"bold_font", "res://addons/godot_xterm/fonts/bold.ttf"},
|
|
||||||
{"italics_font", "res://addons/godot_xterm/fonts/italics.ttf"},
|
|
||||||
{"bold_italics_font", "res://addons/godot_xterm/fonts/bold_italics.ttf"},
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO: Ensure it is default Xterm dark theme.
|
|
||||||
const Terminal::ColorMap Terminal::COLORS = {
|
|
||||||
{"ansi_0_color", {"#000000", TSM_COLOR_BLACK}},
|
|
||||||
{"ansi_1_color", {"#CD0000", TSM_COLOR_RED}},
|
|
||||||
{"ansi_2_color", {"#00CD00", TSM_COLOR_GREEN}},
|
|
||||||
{"ansi_3_color", {"#CDCD00", TSM_COLOR_YELLOW}},
|
|
||||||
{"ansi_4_color", {"#0000EE", TSM_COLOR_BLUE}},
|
|
||||||
{"ansi_5_color", {"#CD00CD", TSM_COLOR_MAGENTA}},
|
|
||||||
{"ansi_6_color", {"#00CDCD", TSM_COLOR_CYAN}},
|
|
||||||
{"ansi_7_color", {"#E5E5E5", TSM_COLOR_LIGHT_GREY}},
|
|
||||||
{"ansi_8_color", {"#7F7F7F", TSM_COLOR_DARK_GREY}},
|
|
||||||
{"ansi_9_color", {"#FF0000", TSM_COLOR_LIGHT_RED}},
|
|
||||||
{"ansi_10_color", {"#00FF00", TSM_COLOR_LIGHT_GREEN}},
|
|
||||||
{"ansi_11_color", {"#FFFF00", TSM_COLOR_LIGHT_YELLOW}},
|
|
||||||
{"ansi_12_color", {"#0000FC", TSM_COLOR_LIGHT_BLUE}},
|
|
||||||
{"ansi_13_color", {"#FF00FF", TSM_COLOR_LIGHT_MAGENTA}},
|
|
||||||
{"ansi_14_color", {"#00FFFF", TSM_COLOR_LIGHT_CYAN}},
|
|
||||||
{"ansi_15_color", {"#FFFFFF", TSM_COLOR_WHITE}},
|
|
||||||
{"foreground_color", {"#FFFFFF", TSM_COLOR_FOREGROUND}},
|
|
||||||
{"background_color", {"#000000", TSM_COLOR_BACKGROUND}},
|
|
||||||
};
|
|
||||||
|
|
||||||
const Terminal::KeyMap Terminal::KEY_MAP = {
|
const Terminal::KeyMap Terminal::KEY_MAP = {
|
||||||
// Godot does not have seperate scancodes for keypad keys when NumLock is
|
// Godot does not have seperate scancodes for keypad keys when NumLock is
|
||||||
// off. We can check the unicode value to determine whether it is off and
|
// off. We can check the unicode value to determine whether it is off and
|
|
@ -37,6 +37,9 @@ namespace godot
|
||||||
BOLD_ITALICS,
|
BOLD_ITALICS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef std::map<std::pair<Key, char32_t>, uint32_t> KeyMap;
|
||||||
|
|
||||||
|
static const KeyMap KEY_MAP;
|
||||||
public:
|
public:
|
||||||
enum AttrFlag
|
enum AttrFlag
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue