remove unnecessary variable
This commit is contained in:
parent
05255b735a
commit
761b667bce
1 changed files with 1 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue