From becaf946056110775101d3f5a4260226f6853924 Mon Sep 17 00:00:00 2001 From: ZeroInternalReflection <89038572+ZeroInternalReflection@users.noreply.github.com> Date: Tue, 21 Jun 2022 20:58:59 -0400 Subject: [PATCH 1/7] Switch string_input_popup descriptions to scrolling_text_view --- src/crafting_gui.cpp | 1 - src/string_input_popup.cpp | 85 ++++++++++++++++++++++++-------------- src/string_input_popup.h | 9 +++- 3 files changed, 60 insertions(+), 35 deletions(-) diff --git a/src/crafting_gui.cpp b/src/crafting_gui.cpp index b741cbea8bc20..77ef9a0e53e3a 100644 --- a/src/crafting_gui.cpp +++ b/src/crafting_gui.cpp @@ -1481,7 +1481,6 @@ const recipe *select_crafting_recipe( int &batch_size_out, const recipe_id goto_ description += _( "\nUse up/down arrow to go through your search history." ); - description += "\n\n\n"; string_input_popup popup; popup diff --git a/src/string_input_popup.cpp b/src/string_input_popup.cpp index 15d6f0192797f..6cabd046738cc 100644 --- a/src/string_input_popup.cpp +++ b/src/string_input_popup.cpp @@ -63,14 +63,18 @@ void string_input_popup::create_window() break; } } - w_height += static_cast( title_split.size() ) - 1; + title_height = static_cast( title_split.size() ) - 1; + w_height += title_height; } - descformatted.clear(); if( !_description.empty() ) { const int twidth = std::min( utf8_width( remove_color_tags( _description ) ), w_width - 4 ); - descformatted = foldstring( _description, twidth ); - w_height += descformatted.size(); + description_height = foldstring( _description, twidth ).size(); + w_height += description_height; + if( w_height > TERMY ) { + description_height = TERMY - 2 - title_height - 1; + w_height = TERMY; + } } // length of title + border (left) + space _startx = titlesize + 2; @@ -82,9 +86,15 @@ void string_input_popup::create_window() const int w_y = ( TERMY - w_height ) / 2; const int w_x = std::max( ( TERMX - w_width ) / 2, 0 ); - w = catacurses::newwin( w_height, w_width, point( w_x, w_y ) ); - _starty = w_height - 2; // The ____ looks better at the bottom right when the title folds + w_full = catacurses::newwin( w_height, w_width, point( w_x, w_y ) ); + if( !_description.empty() ) { + w_description = catacurses::newwin( description_height, w_width - 1, point( w_x, + w_y + 1 ) ); + desc_view_ptr = std::make_unique( w_description ); + description_view = desc_view_ptr.get(); + description_view->set_text( _description ); + } custom_window = false; } @@ -111,6 +121,8 @@ void string_input_popup::create_context() #endif ctxt->register_action( "TEXT.INPUT_FROM_FILE" ); ctxt->register_action( "HELP_KEYBINDINGS" ); + ctxt->register_action( "SCROLL_INFOBOX_UP" ); + ctxt->register_action( "SCROLL_INFOBOX_DOWN" ); ctxt->register_action( "ANY_INPUT" ); } @@ -137,17 +149,17 @@ void string_input_popup::show_history( utf8_wrapper &ret ) hmenu.w_height_setup = [&]() -> int { // number of lines that make up the menu window: 2*border+entries int height = 2 + hmenu.entries.size(); - if( getbegy( w ) < height ) + if( getbegy( w_full ) < height ) { - height = std::max( getbegy( w ), 4 ); + height = std::max( getbegy( w_full ), 4 ); } return height; }; hmenu.w_x_setup = [&]( int ) -> int { - return getbegx( w ); + return getbegx( w_full ); }; hmenu.w_y_setup = [&]( const int height ) -> int { - return std::max( getbegy( w ) - height, 0 ); + return std::max( getbegy( w_full ) - height, 0 ); }; bool finished = false; @@ -228,17 +240,14 @@ void string_input_popup::update_input_history( utf8_wrapper &ret, bool up ) void string_input_popup::draw( const utf8_wrapper &ret, const utf8_wrapper &edit ) const { if( !custom_window ) { - werase( w ); - draw_border( w ); + werase( w_full ); + draw_border( w_full ); - for( size_t i = 0; i < descformatted.size(); ++i ) { - trim_and_print( w, point( 1, 1 + i ), w_width - 2, _desc_color, descformatted[i] ); - } - int pos_y = descformatted.size() + 1; + int pos_y = description_height + 1; for( int i = 0; i < static_cast( title_split.size() ) - 1; i++ ) { - mvwprintz( w, point( i + 1, pos_y++ ), _title_color, title_split[i] ); + mvwprintz( w_full, point( i + 1, pos_y++ ), _title_color, title_split[i] ); } - right_print( w, pos_y, w_width - titlesize - 1, _title_color, title_split.back() ); + trim_and_print( w_full, point( 1, pos_y ), titlesize, _title_color, title_split.back() ); } const int scrmax = _endx - _startx; @@ -246,9 +255,9 @@ void string_input_popup::draw( const utf8_wrapper &ret, const utf8_wrapper &edit const utf8_wrapper ds( ret.substr_display( shift, scrmax ) ); int start_x_edit = _startx; // Clear the line - mvwprintw( w, point( _startx, _starty ), std::string( std::max( 0, scrmax ), ' ' ) ); + mvwprintw( w_full, point( _startx, _starty ), std::string( std::max( 0, scrmax ), ' ' ) ); // Print the whole input string in default color - mvwprintz( w, point( _startx, _starty ), _string_color, "%s", ds.c_str() ); + mvwprintz( w_full, point( _startx, _starty ), _string_color, "%s", ds.c_str() ); size_t sx = ds.display_width(); // Print the cursor in its own color point cursor_pos; @@ -263,17 +272,17 @@ void string_input_popup::draw( const utf8_wrapper &ret, const utf8_wrapper &edit } const size_t left_over = ret.substr( 0, a ).display_width() - shift; cursor_pos = point( _startx + left_over, _starty ); - mvwprintz( w, cursor_pos, _cursor_color, "%s", cursor.c_str() ); + mvwprintz( w_full, cursor_pos, _cursor_color, "%s", cursor.c_str() ); start_x_edit += left_over; } else if( _max_length > 0 && ret.display_width() >= static_cast( _max_length ) ) { cursor_pos = point( _startx + sx, _starty ); - mvwprintz( w, cursor_pos, _cursor_color, " " ); + mvwprintz( w_full, cursor_pos, _cursor_color, " " ); start_x_edit += sx; sx++; // don't override trailing ' ' } else { cursor_pos = point( _startx + sx, _starty ); - mvwprintz( w, cursor_pos, _cursor_color, "_" ); + mvwprintz( w_full, cursor_pos, _cursor_color, "_" ); start_x_edit += sx; sx++; // don't override trailing '_' } @@ -291,16 +300,22 @@ void string_input_popup::draw( const utf8_wrapper &ret, const utf8_wrapper &edit } } if( l > 0 ) { - mvwprintz( w, point( _startx + sx, _starty ), _underscore_color, std::string( l, '_' ) ); + mvwprintz( w_full, point( _startx + sx, _starty ), _underscore_color, std::string( l, '_' ) ); } } if( !edit.empty() ) { - mvwprintz( w, point( start_x_edit, _starty ), _cursor_color, "%s", edit.c_str() ); + mvwprintz( w_full, point( start_x_edit, _starty ), _cursor_color, "%s", edit.c_str() ); } // Move curses cursor to text cursor for screen readers and IME preview positioning - wmove( w, cursor_pos ); - wnoutrefresh( w ); + wmove( w_full, cursor_pos ); + wnoutrefresh( w_full ); + + //Draw scrolling description + if( !custom_window && !_description.empty() ) { + description_view->draw( _desc_color ); + wnoutrefresh( w_description ); + } } void string_input_popup::query( const bool loop, const bool draw_only ) @@ -337,7 +352,7 @@ int64_t string_input_popup::query_int64_t( const bool loop, const bool draw_only const std::string &string_input_popup::query_string( const bool loop, const bool draw_only ) { - if( !custom_window && !w ) { + if( !custom_window && !w_full ) { create_window(); _position = -1; } @@ -355,10 +370,10 @@ const std::string &string_input_popup::query_string( const bool loop, const bool std::unique_ptr ui; if( !draw_only && !custom_window ) { ui = std::make_unique(); - ui->position_from_window( w ); + ui->position_from_window( w_full ); ui->on_screen_resize( [this]( ui_adaptor & ui ) { create_window(); - ui.position_from_window( w ); + ui.position_from_window( w_full ); } ); ui->on_redraw( [&]( const ui_adaptor & ) { draw( ret, edit ); @@ -490,6 +505,12 @@ const std::string &string_input_popup::query_string( const bool loop, const bool if( _position < static_cast( ret.size() ) ) { ret.erase( _position, 1 ); } + } else if( action == "HELP_KEYBINDINGS" ) { + ctxt->display_menu(); + } else if( action == "SCROLL_INFOBOX_UP" ) { + description_view->scroll_up(); + } else if( action == "SCROLL_INFOBOX_DOWN" ) { + description_view->scroll_down(); } else if( action == "TEXT.PASTE" || action == "TEXT.INPUT_FROM_FILE" || ( action == "ANY_INPUT" && !ev.text.empty() ) ) { // paste, input from file, or text input @@ -551,11 +572,11 @@ const std::string &string_input_popup::query_string( const bool loop, const bool string_input_popup &string_input_popup::window( const catacurses::window &w, const point &start, int endx ) { - if( !custom_window && this->w ) { + if( !custom_window && this->w_full ) { // default window already created return *this; } - this->w = w; + this->w_full = w; _startx = start.x; _starty = start.y; _endx = endx; diff --git a/src/string_input_popup.h b/src/string_input_popup.h index c67d11c4c536a..41fe827eb98bf 100644 --- a/src/string_input_popup.h +++ b/src/string_input_popup.h @@ -14,6 +14,7 @@ #include "cursesdef.h" class input_context; +class scrolling_text_view; class utf8_wrapper; struct point; @@ -73,12 +74,16 @@ class string_input_popup // NOLINT(cata-xy) // Cache when using the default window int w_width = 0; int w_height = 0; - std::vector descformatted; + int title_height = 0; + int description_height = 0; std::vector title_split; int titlesize = 0; bool custom_window = false; - catacurses::window w; + catacurses::window w_full; + catacurses::window w_description; + std::unique_ptr desc_view_ptr; + scrolling_text_view *description_view = nullptr; std::unique_ptr ctxt_ptr; input_context *ctxt = nullptr; From f1673c53ae3e3c1602d413d6711f851087f1b0c2 Mon Sep 17 00:00:00 2001 From: ZeroInternalReflection <89038572+ZeroInternalReflection@users.noreply.github.com> Date: Wed, 22 Jun 2022 09:31:25 -0400 Subject: [PATCH 2/7] Remove a superfluous HELP_KEYBINDINGS check from string_input_popup --- src/string_input_popup.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/string_input_popup.cpp b/src/string_input_popup.cpp index 6cabd046738cc..dcf9ee31bd640 100644 --- a/src/string_input_popup.cpp +++ b/src/string_input_popup.cpp @@ -505,8 +505,6 @@ const std::string &string_input_popup::query_string( const bool loop, const bool if( _position < static_cast( ret.size() ) ) { ret.erase( _position, 1 ); } - } else if( action == "HELP_KEYBINDINGS" ) { - ctxt->display_menu(); } else if( action == "SCROLL_INFOBOX_UP" ) { description_view->scroll_up(); } else if( action == "SCROLL_INFOBOX_DOWN" ) { From d8b32e00289292c381139ddca79e418a1a8f1af0 Mon Sep 17 00:00:00 2001 From: ZeroInternalReflection <89038572+ZeroInternalReflection@users.noreply.github.com> Date: Wed, 22 Jun 2022 09:40:08 -0400 Subject: [PATCH 3/7] Check pointer is not null before scrolling in string_input_popup --- src/string_input_popup.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/string_input_popup.cpp b/src/string_input_popup.cpp index dcf9ee31bd640..ecb7624a59a7e 100644 --- a/src/string_input_popup.cpp +++ b/src/string_input_popup.cpp @@ -506,9 +506,13 @@ const std::string &string_input_popup::query_string( const bool loop, const bool ret.erase( _position, 1 ); } } else if( action == "SCROLL_INFOBOX_UP" ) { - description_view->scroll_up(); + if( description_view ) { + description_view->scroll_up(); + } } else if( action == "SCROLL_INFOBOX_DOWN" ) { - description_view->scroll_down(); + if( description_view ) { + description_view->scroll_down(); + } } else if( action == "TEXT.PASTE" || action == "TEXT.INPUT_FROM_FILE" || ( action == "ANY_INPUT" && !ev.text.empty() ) ) { // paste, input from file, or text input From ef4bbb44c49aedd6a2113ab3dd8f89fbeab2f87d Mon Sep 17 00:00:00 2001 From: ZeroInternalReflection <89038572+ZeroInternalReflection@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:06:16 -0400 Subject: [PATCH 4/7] Move to only using a unique_ptr for string_input_popup descriptions --- src/string_input_popup.cpp | 15 +++++++-------- src/string_input_popup.h | 1 - 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/string_input_popup.cpp b/src/string_input_popup.cpp index ecb7624a59a7e..c4b0628aa35cd 100644 --- a/src/string_input_popup.cpp +++ b/src/string_input_popup.cpp @@ -92,8 +92,7 @@ void string_input_popup::create_window() w_description = catacurses::newwin( description_height, w_width - 1, point( w_x, w_y + 1 ) ); desc_view_ptr = std::make_unique( w_description ); - description_view = desc_view_ptr.get(); - description_view->set_text( _description ); + desc_view_ptr->set_text( _description ); } custom_window = false; @@ -312,8 +311,8 @@ void string_input_popup::draw( const utf8_wrapper &ret, const utf8_wrapper &edit wnoutrefresh( w_full ); //Draw scrolling description - if( !custom_window && !_description.empty() ) { - description_view->draw( _desc_color ); + if( !custom_window && desc_view_ptr ) { + desc_view_ptr->draw( _desc_color ); wnoutrefresh( w_description ); } } @@ -506,12 +505,12 @@ const std::string &string_input_popup::query_string( const bool loop, const bool ret.erase( _position, 1 ); } } else if( action == "SCROLL_INFOBOX_UP" ) { - if( description_view ) { - description_view->scroll_up(); + if( desc_view_ptr ) { + desc_view_ptr->scroll_up(); } } else if( action == "SCROLL_INFOBOX_DOWN" ) { - if( description_view ) { - description_view->scroll_down(); + if( desc_view_ptr ) { + desc_view_ptr->scroll_down(); } } else if( action == "TEXT.PASTE" || action == "TEXT.INPUT_FROM_FILE" || ( action == "ANY_INPUT" && !ev.text.empty() ) ) { diff --git a/src/string_input_popup.h b/src/string_input_popup.h index 41fe827eb98bf..7c84b67ef2b56 100644 --- a/src/string_input_popup.h +++ b/src/string_input_popup.h @@ -83,7 +83,6 @@ class string_input_popup // NOLINT(cata-xy) catacurses::window w_full; catacurses::window w_description; std::unique_ptr desc_view_ptr; - scrolling_text_view *description_view = nullptr; std::unique_ptr ctxt_ptr; input_context *ctxt = nullptr; From dc566a072a7ad7cf21a82c549b48aa3d8edb5905 Mon Sep 17 00:00:00 2001 From: ZeroInternalReflection <89038572+ZeroInternalReflection@users.noreply.github.com> Date: Wed, 22 Jun 2022 11:10:54 -0400 Subject: [PATCH 5/7] Move title and text entry in string_input_popup to a separate window --- src/string_input_popup.cpp | 38 +++++++++++++++++++++----------------- src/string_input_popup.h | 1 + 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/string_input_popup.cpp b/src/string_input_popup.cpp index c4b0628aa35cd..1bc4f4cdf8bed 100644 --- a/src/string_input_popup.cpp +++ b/src/string_input_popup.cpp @@ -77,7 +77,7 @@ void string_input_popup::create_window() } } // length of title + border (left) + space - _startx = titlesize + 2; + _startx = titlesize + 1; if( _max_length <= 0 ) { _max_length = 1024; @@ -86,7 +86,7 @@ void string_input_popup::create_window() const int w_y = ( TERMY - w_height ) / 2; const int w_x = std::max( ( TERMX - w_width ) / 2, 0 ); - _starty = w_height - 2; // The ____ looks better at the bottom right when the title folds + _starty = title_height; w_full = catacurses::newwin( w_height, w_width, point( w_x, w_y ) ); if( !_description.empty() ) { w_description = catacurses::newwin( description_height, w_width - 1, point( w_x, @@ -94,6 +94,8 @@ void string_input_popup::create_window() desc_view_ptr = std::make_unique( w_description ); desc_view_ptr->set_text( _description ); } + w_title_and_entry = catacurses::newwin( w_height - description_height - 2, w_width - 2, + point( w_x + 1, w_y + 1 + description_height ) ); custom_window = false; } @@ -241,12 +243,13 @@ void string_input_popup::draw( const utf8_wrapper &ret, const utf8_wrapper &edit if( !custom_window ) { werase( w_full ); draw_border( w_full ); + wnoutrefresh( w_full ); - int pos_y = description_height + 1; + int pos_y = 0; for( int i = 0; i < static_cast( title_split.size() ) - 1; i++ ) { - mvwprintz( w_full, point( i + 1, pos_y++ ), _title_color, title_split[i] ); + mvwprintz( w_title_and_entry, point( i, pos_y++ ), _title_color, title_split[i] ); } - trim_and_print( w_full, point( 1, pos_y ), titlesize, _title_color, title_split.back() ); + trim_and_print( w_title_and_entry, point( 0, pos_y ), titlesize, _title_color, title_split.back() ); } const int scrmax = _endx - _startx; @@ -254,9 +257,10 @@ void string_input_popup::draw( const utf8_wrapper &ret, const utf8_wrapper &edit const utf8_wrapper ds( ret.substr_display( shift, scrmax ) ); int start_x_edit = _startx; // Clear the line - mvwprintw( w_full, point( _startx, _starty ), std::string( std::max( 0, scrmax ), ' ' ) ); + mvwprintw( w_title_and_entry, point( _startx, _starty ), std::string( std::max( 0, scrmax ), + ' ' ) ); // Print the whole input string in default color - mvwprintz( w_full, point( _startx, _starty ), _string_color, "%s", ds.c_str() ); + mvwprintz( w_title_and_entry, point( _startx, _starty ), _string_color, "%s", ds.c_str() ); size_t sx = ds.display_width(); // Print the cursor in its own color point cursor_pos; @@ -271,17 +275,17 @@ void string_input_popup::draw( const utf8_wrapper &ret, const utf8_wrapper &edit } const size_t left_over = ret.substr( 0, a ).display_width() - shift; cursor_pos = point( _startx + left_over, _starty ); - mvwprintz( w_full, cursor_pos, _cursor_color, "%s", cursor.c_str() ); + mvwprintz( w_title_and_entry, cursor_pos, _cursor_color, "%s", cursor.c_str() ); start_x_edit += left_over; } else if( _max_length > 0 && ret.display_width() >= static_cast( _max_length ) ) { cursor_pos = point( _startx + sx, _starty ); - mvwprintz( w_full, cursor_pos, _cursor_color, " " ); + mvwprintz( w_title_and_entry, cursor_pos, _cursor_color, " " ); start_x_edit += sx; sx++; // don't override trailing ' ' } else { cursor_pos = point( _startx + sx, _starty ); - mvwprintz( w_full, cursor_pos, _cursor_color, "_" ); + mvwprintz( w_title_and_entry, cursor_pos, _cursor_color, "_" ); start_x_edit += sx; sx++; // don't override trailing '_' } @@ -299,22 +303,22 @@ void string_input_popup::draw( const utf8_wrapper &ret, const utf8_wrapper &edit } } if( l > 0 ) { - mvwprintz( w_full, point( _startx + sx, _starty ), _underscore_color, std::string( l, '_' ) ); + mvwprintz( w_title_and_entry, point( _startx + sx, _starty ), _underscore_color, std::string( l, + '_' ) ); } } if( !edit.empty() ) { - mvwprintz( w_full, point( start_x_edit, _starty ), _cursor_color, "%s", edit.c_str() ); + mvwprintz( w_title_and_entry, point( start_x_edit, _starty ), _cursor_color, "%s", edit.c_str() ); } - // Move curses cursor to text cursor for screen readers and IME preview positioning - wmove( w_full, cursor_pos ); - wnoutrefresh( w_full ); - //Draw scrolling description if( !custom_window && desc_view_ptr ) { desc_view_ptr->draw( _desc_color ); wnoutrefresh( w_description ); } + // Move curses cursor to text cursor for screen readers and IME preview positioning + wmove( w_title_and_entry, cursor_pos ); + wnoutrefresh( w_title_and_entry ); } void string_input_popup::query( const bool loop, const bool draw_only ) @@ -577,7 +581,7 @@ string_input_popup &string_input_popup::window( const catacurses::window &w, con // default window already created return *this; } - this->w_full = w; + this->w_title_and_entry = w; _startx = start.x; _starty = start.y; _endx = endx; diff --git a/src/string_input_popup.h b/src/string_input_popup.h index 7c84b67ef2b56..0fa9299fd9eed 100644 --- a/src/string_input_popup.h +++ b/src/string_input_popup.h @@ -82,6 +82,7 @@ class string_input_popup // NOLINT(cata-xy) bool custom_window = false; catacurses::window w_full; catacurses::window w_description; + catacurses::window w_title_and_entry; std::unique_ptr desc_view_ptr; std::unique_ptr ctxt_ptr; From 02265b45d84887f0e69555fed515259e20c3101d Mon Sep 17 00:00:00 2001 From: ZeroInternalReflection <89038572+ZeroInternalReflection@users.noreply.github.com> Date: Wed, 22 Jun 2022 21:38:11 -0400 Subject: [PATCH 6/7] Move to page up/page down and mousewheel for description scrolling --- src/string_input_popup.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/string_input_popup.cpp b/src/string_input_popup.cpp index 1bc4f4cdf8bed..9e3f2cd32d209 100644 --- a/src/string_input_popup.cpp +++ b/src/string_input_popup.cpp @@ -122,8 +122,10 @@ void string_input_popup::create_context() #endif ctxt->register_action( "TEXT.INPUT_FROM_FILE" ); ctxt->register_action( "HELP_KEYBINDINGS" ); - ctxt->register_action( "SCROLL_INFOBOX_UP" ); - ctxt->register_action( "SCROLL_INFOBOX_DOWN" ); + ctxt->register_action( "PAGE_UP" ); + ctxt->register_action( "PAGE_DOWN" ); + ctxt->register_action( "SCROLL_UP" ); + ctxt->register_action( "SCROLL_DOWN" ); ctxt->register_action( "ANY_INPUT" ); } @@ -508,11 +510,13 @@ const std::string &string_input_popup::query_string( const bool loop, const bool if( _position < static_cast( ret.size() ) ) { ret.erase( _position, 1 ); } - } else if( action == "SCROLL_INFOBOX_UP" ) { + /*Note: SCROLL_UP/SCROLL_DOWN should by default only trigger on mousewheel, + * since up/down arrow were handled above */ + } else if( action == "PAGE_UP" || action == "SCROLL_UP" ) { if( desc_view_ptr ) { desc_view_ptr->scroll_up(); } - } else if( action == "SCROLL_INFOBOX_DOWN" ) { + } else if( action == "PAGE_DOWN" || action == "SCROLL_DOWN" ) { if( desc_view_ptr ) { desc_view_ptr->scroll_down(); } From e92a380c4c451a961ec0df90997b48aa75020836 Mon Sep 17 00:00:00 2001 From: ZeroInternalReflection <89038572+ZeroInternalReflection@users.noreply.github.com> Date: Thu, 23 Jun 2022 10:19:45 -0400 Subject: [PATCH 7/7] Switch to paging up/down for PPAGE/NPAGE, leave mousewheel scroll --- src/string_input_popup.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/string_input_popup.cpp b/src/string_input_popup.cpp index 9e3f2cd32d209..dc954b375dad7 100644 --- a/src/string_input_popup.cpp +++ b/src/string_input_popup.cpp @@ -512,14 +512,22 @@ const std::string &string_input_popup::query_string( const bool loop, const bool } /*Note: SCROLL_UP/SCROLL_DOWN should by default only trigger on mousewheel, * since up/down arrow were handled above */ - } else if( action == "PAGE_UP" || action == "SCROLL_UP" ) { + } else if( action == "SCROLL_UP" ) { if( desc_view_ptr ) { desc_view_ptr->scroll_up(); } - } else if( action == "PAGE_DOWN" || action == "SCROLL_DOWN" ) { + } else if( action == "SCROLL_DOWN" ) { if( desc_view_ptr ) { desc_view_ptr->scroll_down(); } + } else if( action == "PAGE_UP" ) { + if( desc_view_ptr ) { + desc_view_ptr->page_up(); + } + } else if( action == "PAGE_DOWN" ) { + if( desc_view_ptr ) { + desc_view_ptr->page_down(); + } } else if( action == "TEXT.PASTE" || action == "TEXT.INPUT_FROM_FILE" || ( action == "ANY_INPUT" && !ev.text.empty() ) ) { // paste, input from file, or text input