diff --git a/include/ui.bm b/include/ui.bm index d6f67b5..3116103 100644 --- a/include/ui.bm +++ b/include/ui.bm @@ -1,7 +1,6 @@ FUNCTION textinput$ (x AS INTEGER, y AS INTEGER, w AS INTEGER, h AS INTEGER, __text AS STRING) DIM text AS STRING, keyin AS STRING DIM cursor AS INTEGER, done AS INTEGER - DIM pasteData AS STRING text = __text ' Initial Hover Check IF NOT (_MOUSEX > x AND _MOUSEY > y AND _MOUSEX < x + w AND _MOUSEY < y + h) THEN @@ -36,9 +35,7 @@ FUNCTION textinput$ (x AS INTEGER, y AS INTEGER, w AS INTEGER, h AS INTEGER, __t ELSEIF LEN(keyin) = 1 THEN SELECT CASE ASC(keyin) CASE 22 ' Ctrl + V (Paste) - ' Note: _CLIPBOARD$ is standard in modern BASIC like QB64 - pasteData = _CLIPBOARD$ - text = LEFT$(text, cursor - 1) + pasteData + MID$(text, cursor) + text = LEFT$(text, cursor - 1) + _CLIPBOARD$ + MID$(text, cursor) cursor = cursor + LEN(pasteData) CASE 32 TO 126 ' Regular Typing text = LEFT$(text, cursor - 1) + keyin + MID$(text, cursor)