From d9f9d8c345ef4b4a5ef09bd49c49feb465f9733d Mon Sep 17 00:00:00 2001
From: cybersphinx <chr.ohm@gmx.net>
Date: Wed, 20 Jul 2011 19:34:45 +0200
Subject: [PATCH 2/2] Use Ctrl-V instead of Tab to paste in input boxes.

---
 lib/widget/editbox.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/lib/widget/editbox.c b/lib/widget/editbox.c
index f0e9ad4..69fffd3 100644
--- a/lib/widget/editbox.c
+++ b/lib/widget/editbox.c
@@ -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 :
@@ -574,6 +570,21 @@ 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);
+						break;
+					default:
+						break;
+				}
+				break;
+			}
 			/* Dealt with everything else this must be a printable character */
 			if (editState == WEDBS_INSERT)
 			{
-- 
1.7.5.4


