Advertisement
Stiepen

cc implementation for home, end and del in read()

Sep 11th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1.  
  2.             elseif param == keys.home then
  3.                 -- Home
  4.                 nPos = 0
  5.                 redraw()
  6.                
  7.             elseif param == keys.delete then
  8.                 if nPos < string.len(sLine) then
  9.                     sLine = string.sub( sLine, 1, nPos ) .. string.sub( sLine, nPos + 2 )              
  10.                     redraw()
  11.                 end
  12.             elseif param == keys['end'] then
  13.                 -- End
  14.                 nPos = string.len(sLine)
  15.                 redraw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement