Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this.
-
Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
-
Contact:
Post
by Robin »
Przemator wrote:with unicode, the backspace might be tricky...
Actually, UTF-8 makes that really easy:
Code: Select all
if key == "backspace" then
local last
repeat
last = line:sub(-1):byte()
line = line:sub(1, -2)
until line == "" or last < 0x80 or last >= 0xc0
end
Users browsing this forum: Google [Bot] and 3 guests