Text box now supports moving between words
This commit is contained in:
parent
738708d28e
commit
f130d495c8
1 changed files with 2 additions and 3 deletions
|
|
@ -110,11 +110,10 @@ bool TextBoxEditTool::edit_update(const std::shared_ptr<DrawComponent>& comp) {
|
||||||
movedHeld = true;
|
movedHeld = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(input.key(InputManager::KEY_TEXT_LEFT).repeat)
|
if(input.key(InputManager::KEY_TEXT_LEFT).repeat)
|
||||||
cur.pos = cur.selectionBeginPos = textbox.move(CollabTextBox::Movement::kLeft, cur.selectionBeginPos);
|
cur.pos = cur.selectionBeginPos = textbox.move(input.key(InputManager::KEY_TEXT_CTRL).held ? CollabTextBox::Movement::kWordLeft : CollabTextBox::Movement::kLeft, cur.selectionBeginPos);
|
||||||
if(input.key(InputManager::KEY_TEXT_RIGHT).repeat)
|
if(input.key(InputManager::KEY_TEXT_RIGHT).repeat)
|
||||||
cur.pos = cur.selectionBeginPos = textbox.move(CollabTextBox::Movement::kRight, cur.selectionBeginPos);
|
cur.pos = cur.selectionBeginPos = textbox.move(input.key(InputManager::KEY_TEXT_CTRL).held ? CollabTextBox::Movement::kWordRight : CollabTextBox::Movement::kRight, cur.selectionBeginPos);
|
||||||
if(input.key(InputManager::KEY_TEXT_UP).repeat)
|
if(input.key(InputManager::KEY_TEXT_UP).repeat)
|
||||||
cur.pos = cur.selectionBeginPos = textbox.move(CollabTextBox::Movement::kUp, cur.selectionBeginPos);
|
cur.pos = cur.selectionBeginPos = textbox.move(CollabTextBox::Movement::kUp, cur.selectionBeginPos);
|
||||||
if(input.key(InputManager::KEY_TEXT_DOWN).repeat)
|
if(input.key(InputManager::KEY_TEXT_DOWN).repeat)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue