Use Ctrl-V instead of Tab to paste in input boxes.

Closes #2830.
master
cybersphinx 2011-07-20 19:24:37 +02:00
parent b827f9e918
commit 08d2bae4e5
1 changed files with 20 additions and 8 deletions

View File

@ -391,14 +391,6 @@ void W_EDITBOX::run(W_CONTEXT *psContext)
debug(LOG_INPUT, "EditBox cursor backspace"); debug(LOG_INPUT, "EditBox cursor backspace");
break; break;
case INPBUF_TAB : case INPBUF_TAB :
{
QClipboard *clipboard = QApplication::clipboard();
aText = clipboard->text(QClipboard::Selection); // try X11 specific buffer first
if (aText.isEmpty()) aText = clipboard->text(QClipboard::Clipboard); // if not, try generic clipboard
}
insPos = aText.length();
/* Update the printable text */
fitStringEnd();
debug(LOG_INPUT, "EditBox cursor tab"); debug(LOG_INPUT, "EditBox cursor tab");
break; break;
case INPBUF_CR : case INPBUF_CR :
@ -414,6 +406,26 @@ void W_EDITBOX::run(W_CONTEXT *psContext)
break; break;
default: default:
if (keyDown(KEY_LCTRL) || keyDown(KEY_RCTRL))
{
switch (key)
{
case KEY_V:
{
QClipboard *clipboard = QApplication::clipboard();
aText = clipboard->text(QClipboard::Selection); // try X11 specific buffer first
if (aText.isEmpty()) aText = clipboard->text(QClipboard::Clipboard); // if not, try generic clipboard
}
insPos = aText.length();
/* Update the printable text */
fitStringEnd();
debug(LOG_INPUT, "EditBox paste");
break;
default:
break;
}
break;
}
/* Dealt with everything else this must be a printable character */ /* Dealt with everything else this must be a printable character */
if (editState == WEDBS_INSERT) if (editState == WEDBS_INSERT)
{ {