Skip to content

Commit

Permalink
Use Ctrl-V instead of Tab to paste in input boxes.
Browse files Browse the repository at this point in the history
Closes #2830.
  • Loading branch information
cybersphinx committed Jul 27, 2011
1 parent fcec0a3 commit d2f4b5a
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/widget/editbox.c
Expand Up @@ -555,10 +555,6 @@ void editBoxRun(W_EDITBOX *psWidget, W_CONTEXT *psContext)
debug(LOG_INPUT, "EditBox cursor backspace");
break;
case INPBUF_TAB :
putSelection(&pBuffer, &pBufferAllocated, &pos);

/* Update the printable text */
fitStringEnd(pBuffer, psWidget->width, &printStart, &printChars, &printWidth);
debug(LOG_INPUT, "EditBox cursor tab");
break;
case INPBUF_CR :
Expand All @@ -574,6 +570,22 @@ void editBoxRun(W_EDITBOX *psWidget, W_CONTEXT *psContext)
break;

default:
if (keyDown(KEY_LCTRL) || keyDown(KEY_RCTRL))
{
switch (key)
{
case KEY_V:
putSelection(&pBuffer, &pBufferAllocated, &pos);

/* Update the printable text */
fitStringEnd(pBuffer, psWidget->width, &printStart, &printChars, &printWidth);
debug(LOG_INPUT, "EditBox paste");
break;
default:
break;
}
break;
}
/* Dealt with everything else this must be a printable character */
if (editState == WEDBS_INSERT)
{
Expand Down

0 comments on commit d2f4b5a

Please sign in to comment.