Advertisement
Robonado

Caixa de Texto

Apr 30th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. mt, s, t= setmetatable, "", {'Robonado', false}; -- string_Texto, {string_Usuario, boolean_Capslock};
  2. f= mt({
  3.        [8]=function(x) return x:sub(1,#x-1) end,[9]=function(x) return s..'\n' end,[16]= function(x) t[2]= not t[2] return s end},
  4.       {__index= function(a,i,v) return function(str) return s..string[t[2] and 'upper' or 'lower'](tostring(i):char()) end end});
  5.  
  6. main= table.foreach(f, function(id) system.bindKeyboard(t[1],id,true,true) end) or system.bindKeyboard(t[1],32,true,true);
  7.  
  8. for keys = 65, 90 do
  9.     tfm.exec.bindKeyboard(t[1],keys,true,true)
  10. end
  11.  
  12. function eventKeyboard(p,id)                                      -- Shift (Capslock), Tab (Quebra de linha), Backspace (Backspace) --
  13.     s= f[id](s);
  14.     ui.addTextArea(0, s, nil, 50, 50, 300)
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement