|
| 1 | +// |
| 2 | +// BearLibTerminal+constants.swift |
| 3 | +// RLSandbox |
| 4 | +// |
| 5 | +// Created by Steve Johnson on 1/5/18. |
| 6 | +// Copyright © 2018 Steve Johnson. All rights reserved. |
| 7 | +// |
| 8 | + |
| 9 | +import CBearLibTerminal |
| 10 | + |
| 11 | + |
| 12 | +public struct RKConstant { |
| 13 | + // Keyboard scancodes for events/states. |
| 14 | + public static let A = TK_A |
| 15 | + public static let B = TK_B |
| 16 | + public static let C = TK_C |
| 17 | + public static let D = TK_D |
| 18 | + public static let E = TK_E |
| 19 | + public static let F = TK_F |
| 20 | + public static let G = TK_G |
| 21 | + public static let H = TK_H |
| 22 | + public static let I = TK_I |
| 23 | + public static let J = TK_J |
| 24 | + public static let K = TK_K |
| 25 | + public static let L = TK_L |
| 26 | + public static let M = TK_M |
| 27 | + public static let N = TK_N |
| 28 | + public static let O = TK_O |
| 29 | + public static let P = TK_P |
| 30 | + public static let Q = TK_Q |
| 31 | + public static let R = TK_R |
| 32 | + public static let S = TK_S |
| 33 | + public static let T = TK_T |
| 34 | + public static let U = TK_U |
| 35 | + public static let V = TK_V |
| 36 | + public static let W = TK_W |
| 37 | + public static let X = TK_X |
| 38 | + public static let Y = TK_Y |
| 39 | + public static let Z = TK_Z |
| 40 | + public static let _1 = TK_1 |
| 41 | + public static let _2 = TK_2 |
| 42 | + public static let _3 = TK_3 |
| 43 | + public static let _4 = TK_4 |
| 44 | + public static let _5 = TK_5 |
| 45 | + public static let _6 = TK_6 |
| 46 | + public static let _7 = TK_7 |
| 47 | + public static let _8 = TK_8 |
| 48 | + public static let _9 = TK_9 |
| 49 | + public static let _0 = TK_0 |
| 50 | + public static let RETURN = TK_RETURN |
| 51 | + public static let ENTER = TK_ENTER |
| 52 | + public static let ESCAPE = TK_ESCAPE |
| 53 | + public static let BACKSPACE = TK_BACKSPACE |
| 54 | + public static let TAB = TK_TAB |
| 55 | + public static let SPACE = TK_SPACE |
| 56 | + public static let MINUS = TK_MINUS |
| 57 | + public static let EQUALS = TK_EQUALS |
| 58 | + public static let LBRACKET = TK_LBRACKET |
| 59 | + public static let RBRACKET = TK_RBRACKET |
| 60 | + public static let BACKSLASH = TK_BACKSLASH |
| 61 | + public static let SEMICOLON = TK_SEMICOLON |
| 62 | + public static let APOSTROPHE = TK_APOSTROPHE |
| 63 | + public static let GRAVE = TK_GRAVE |
| 64 | + public static let COMMA = TK_COMMA |
| 65 | + public static let PERIOD = TK_PERIOD |
| 66 | + public static let SLASH = TK_SLASH |
| 67 | + public static let F1 = TK_F1 |
| 68 | + public static let F2 = TK_F2 |
| 69 | + public static let F3 = TK_F3 |
| 70 | + public static let F4 = TK_F4 |
| 71 | + public static let F5 = TK_F5 |
| 72 | + public static let F6 = TK_F6 |
| 73 | + public static let F7 = TK_F7 |
| 74 | + public static let F8 = TK_F8 |
| 75 | + public static let F9 = TK_F9 |
| 76 | + public static let F10 = TK_F10 |
| 77 | + public static let F11 = TK_F11 |
| 78 | + public static let F12 = TK_F12 |
| 79 | + public static let PAUSE = TK_PAUSE |
| 80 | + public static let INSERT = TK_INSERT |
| 81 | + public static let HOME = TK_HOME |
| 82 | + public static let PAGEUP = TK_PAGEUP |
| 83 | + public static let DELETE = TK_DELETE |
| 84 | + public static let END = TK_END |
| 85 | + public static let PAGEDOWN = TK_PAGEDOWN |
| 86 | + public static let RIGHT = TK_RIGHT |
| 87 | + public static let LEFT = TK_LEFT |
| 88 | + public static let DOWN = TK_DOWN |
| 89 | + public static let UP = TK_UP |
| 90 | + public static let KP_DIVIDE = TK_KP_DIVIDE |
| 91 | + public static let KP_MULTIPLY = TK_KP_MULTIPLY |
| 92 | + public static let KP_MINUS = TK_KP_MINUS |
| 93 | + public static let KP_PLUS = TK_KP_PLUS |
| 94 | + public static let KP_ENTER = TK_KP_ENTER |
| 95 | + public static let KP_1 = TK_KP_1 |
| 96 | + public static let KP_2 = TK_KP_2 |
| 97 | + public static let KP_3 = TK_KP_3 |
| 98 | + public static let KP_4 = TK_KP_4 |
| 99 | + public static let KP_5 = TK_KP_5 |
| 100 | + public static let KP_6 = TK_KP_6 |
| 101 | + public static let KP_7 = TK_KP_7 |
| 102 | + public static let KP_8 = TK_KP_8 |
| 103 | + public static let KP_9 = TK_KP_9 |
| 104 | + public static let KP_0 = TK_KP_0 |
| 105 | + public static let KP_PERIOD = TK_KP_PERIOD |
| 106 | + public static let SHIFT = TK_SHIFT |
| 107 | + public static let CONTROL = TK_CONTROL |
| 108 | + public static let ALT = TK_ALT |
| 109 | + |
| 110 | + // Mouse events/states |
| 111 | + public static let MOUSE_LEFT = TK_MOUSE_LEFT |
| 112 | + public static let MOUSE_RIGHT = TK_MOUSE_RIGHT |
| 113 | + public static let MOUSE_MIDDLE = TK_MOUSE_MIDDLE |
| 114 | + public static let MOUSE_X1 = TK_MOUSE_X1 |
| 115 | + public static let MOUSE_X2 = TK_MOUSE_X2 |
| 116 | + public static let MOUSE_MOVE = TK_MOUSE_MOVE |
| 117 | + public static let MOUSE_SCROLL = TK_MOUSE_SCROLL |
| 118 | + public static let MOUSE_X = TK_MOUSE_X |
| 119 | + public static let MOUSE_Y = TK_MOUSE_Y |
| 120 | + public static let MOUSE_PIXEL_X = TK_MOUSE_PIXEL_X |
| 121 | + public static let MOUSE_PIXEL_Y = TK_MOUSE_PIXEL_Y |
| 122 | + public static let MOUSE_WHEEL = TK_MOUSE_WHEEL |
| 123 | + public static let MOUSE_CLICKS = TK_MOUSE_CLICKS |
| 124 | + |
| 125 | + // If key was released instead of pressed, it's code will be OR'ed with VK_KEY_RELEASED. |
| 126 | + public static let KEY_RELEASED = TK_KEY_RELEASED |
| 127 | + |
| 128 | + // Virtual key-codes for internal terminal states/variables. |
| 129 | + // These can be accessed via terminal_state function. |
| 130 | + public static let WIDTH = TK_WIDTH |
| 131 | + public static let HEIGHT = TK_HEIGHT |
| 132 | + public static let CELL_WIDTH = TK_CELL_WIDTH |
| 133 | + public static let CELL_HEIGHT = TK_CELL_HEIGHT |
| 134 | + public static let COLOR = TK_COLOR |
| 135 | + public static let BKCOLOR = TK_BKCOLOR |
| 136 | + public static let LAYER = TK_LAYER |
| 137 | + public static let COMPOSITION = TK_COMPOSITION |
| 138 | + public static let CHAR = TK_CHAR |
| 139 | + public static let WCHAR = TK_WCHAR |
| 140 | + public static let EVENT = TK_EVENT |
| 141 | + public static let FULLSCREEN = TK_FULLSCREEN |
| 142 | + |
| 143 | + // Other events. |
| 144 | + public static let CLOSE = TK_CLOSE |
| 145 | + public static let RESIZED = TK_RESIZED |
| 146 | + |
| 147 | + // Generic mode enum. Used in Terminal.composition call only. |
| 148 | + public static let OFF = TK_OFF |
| 149 | + public static let ON = TK_ON |
| 150 | + |
| 151 | + // Input result codes for terminal_read_str function. |
| 152 | + public static let INPUT_NONE = TK_INPUT_NONE |
| 153 | + public static let INPUT_CANCELLED = TK_INPUT_CANCELLED |
| 154 | + |
| 155 | + // Text printing alignment. |
| 156 | + public static let ALIGN_DEFAULT = TK_ALIGN_DEFAULT |
| 157 | + public static let ALIGN_LEFT = TK_ALIGN_LEFT |
| 158 | + public static let ALIGN_RIGHT = TK_ALIGN_RIGHT |
| 159 | + public static let ALIGN_CENTER = TK_ALIGN_CENTER |
| 160 | + public static let ALIGN_TOP = TK_ALIGN_TOP |
| 161 | + public static let ALIGN_BOTTOM = TK_ALIGN_BOTTOM |
| 162 | + public static let ALIGN_MIDDLE = TK_ALIGN_MIDDLE |
| 163 | +} |
0 commit comments