feat: 'CTRL + Up/Down' in multiline textbox
This commit is contained in:
parent
06943525c4
commit
1f47f38256
@ -699,6 +699,10 @@ std::shared_ptr<UINode> TextBox::getAt(
|
|||||||
void TextBox::setOnUpPressed(const runnable &callback) {
|
void TextBox::setOnUpPressed(const runnable &callback) {
|
||||||
if (callback == nullptr) {
|
if (callback == nullptr) {
|
||||||
onUpPressed = [this]() {
|
onUpPressed = [this]() {
|
||||||
|
if (Events::pressed(keycode::LEFT_CONTROL)) {
|
||||||
|
scrolled(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
bool shiftPressed = Events::pressed(keycode::LEFT_SHIFT);
|
bool shiftPressed = Events::pressed(keycode::LEFT_SHIFT);
|
||||||
bool breakSelection = getSelectionLength() != 0 && !shiftPressed;
|
bool breakSelection = getSelectionLength() != 0 && !shiftPressed;
|
||||||
stepDefaultUp(shiftPressed, breakSelection);
|
stepDefaultUp(shiftPressed, breakSelection);
|
||||||
@ -711,6 +715,10 @@ void TextBox::setOnUpPressed(const runnable &callback) {
|
|||||||
void TextBox::setOnDownPressed(const runnable &callback) {
|
void TextBox::setOnDownPressed(const runnable &callback) {
|
||||||
if (callback == nullptr) {
|
if (callback == nullptr) {
|
||||||
onDownPressed = [this]() {
|
onDownPressed = [this]() {
|
||||||
|
if (Events::pressed(keycode::LEFT_CONTROL)) {
|
||||||
|
scrolled(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
bool shiftPressed = Events::pressed(keycode::LEFT_SHIFT);
|
bool shiftPressed = Events::pressed(keycode::LEFT_SHIFT);
|
||||||
bool breakSelection = getSelectionLength() != 0 && !shiftPressed;
|
bool breakSelection = getSelectionLength() != 0 && !shiftPressed;
|
||||||
stepDefaultDown(shiftPressed, breakSelection);
|
stepDefaultDown(shiftPressed, breakSelection);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user