You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4436636
Browse filesBrowse the repository at this point in the historyBrowse files
constbool cursor = mCfgC.showConsole && consoleTime >= mConfig.internal.consoleDelay && std::fmod(consoleTime - mConfig.internal.consoleDelay, 1.0) < 0.5; // Only when fully open, blinking, the timer runs while the console is open
virtualvoidGLPrintText(constchar* s, float x, float y, float* color, float scale, uint32_t nCharacters) = 0; // nCharacters > 0: at most that many characters, otherwise until the terminating 0
105
-
virtualvoidGLDrawQuad(constfloat (&corners)[4][2], const float* color) = 0; // Filled quad with the corners counterclockwise, in pixels with y from the bottom, drawn with the text (SOLID_GLYPH)
voidGLDrawConsole(float verticalFraction, std::span<const std::string> previous, const std::string& current, int32_t cursorPos); // Console over the top verticalFraction of the window: current text in the lowest line, previous ones above (last one lowest), cursor _ at cursorPos (< 0: none)
104
+
virtualvoidGLPrintText(constchar* s, float x, float y, float* color, float scale, uint32_t nCharacters) = 0; // nCharacters > 0: at most that many characters, otherwise until the terminating 0
105
+
virtualvoidGLDrawQuad(constfloat (&corners)[4][2], const float* color) = 0; // Filled quad with the corners counterclockwise, in pixels with y from the bottom, drawn with the text (SOLID_GLYPH)
uint32_tGLDrawConsole(float verticalFraction, std::span<const std::string> previous, const std::string& current, int32_t cursorPos, uint32_t scroll); // Console over the top verticalFraction of the window: current text in the lowest line, previous ones above (last one lowest, the last scroll ones skipped), cursor underline at cursorPos (< 0: none); returns the number of previous lines that fit
auto autoType = [](const std::string& text, bool plain) -> consoleArg { // int64_t for [+-]digits, double for other decimal numbers (also with exponent, as saveSettings writes them), string otherwise or if plain text
Copy file name to clipboardExpand all lines: GPU/GPUTracking/display/frontend/GPUDisplayConsole.h
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,8 @@ class GPUDisplayConsole : public GPUDisplayFrontendKeyVars // Text console of th
41
41
};
42
42
GPUDisplayConsole(const std::string& title); // First history entry, not selectable
43
43
44
-
voidhandleConsoleKey(uint8_t key); // Key typed while the console is shown
44
+
voidhandleConsoleKey(uint8_t key, bool shift); // Key typed while the console is shown
45
+
voidscroll(int32_t lines); // Scrolls the history up (> 0) or down, limited to its lines
45
46
voidhandleConsoleCommand(std::string_view cmd); // Runs the command named by the first token, error if unknown
46
47
voidrunScript(std::string_view script); // Queues the lines (separated by \n / \r) as console commands before the remaining script lines, runs them up to a wait
47
48
voidrunScriptFile(const std::string& filename); // runScript with the content of the file
@@ -76,6 +77,8 @@ class GPUDisplayConsole : public GPUDisplayFrontendKeyVars // Text console of th
76
77
std::vector<std::string> mConsoleHistory; // Title, then commands entered in the console and their output (indented)
77
78
std::string mConsoleText; // Text being typed in the console
78
79
uint32_tmConsoleTextCurrent = 0; // Entry of mConsoleHistory shown in the console (selected with up / down, the title entry 0 is not selectable), 0 for mConsoleText
80
+
uint32_tmScroll = 0; // History lines scrolled up (the lowest ones not shown), reset by enter
81
+
uint32_tmVisibleLines = 1; // History lines fitting into the console, set when it is drawn
79
82
uint32_tmConsoleTextPos = 0; // Cursor position in the shown text (left / right), the character there is the current one
GPUInfo("%zu options with RTTI, %u of them with a key, %u in the Qt GUI, %zu bound keys, %zu available keys", rtti.rttiEntries.size(), nOptionsWithKey, nOptionsInGUI, boundKeys.size(), availableKeys.size());
634
+
GPUInfo("%zu options with RTTI, %u of them with a key, %u in the Qt GUI, %zu bound keys, %zu available keys, %zu console commands", rtti.rttiEntries.size(), nOptionsWithKey, nOptionsInGUI, boundKeys.size(), availableKeys.size(), mConsole->mConsoleCommands.size());
if (mCfgC.showConsole && !bypassConsole && mFrontend->mConfiguration->keyRTTIIndex(key) != mFrontend->mConfiguration->getRTTIIndex(*this, &GPUDisplayControl::showConsole)) { // All keys except the one toggling the console go to the console
if (action == GLFW_PRESS || action == GLFW_REPEAT) { // Repeat as the other frontends (e.g. backspace in the console), characters are repeated by char_callback
174
-
me->mKeys[keyPress] = !me->consoleShown();
173
+
if (action == GLFW_PRESS || action == GLFW_REPEAT) { // Repeat as the other frontends (e.g. backspace in the console), characters are repeated by char_callback
174
+
me->mKeys[keyPress] = keyPress == KEY_SHIFT || !me->consoleShown();// Held keys only without console, SHIFT also with it (scrolling)
0 commit comments