Piorun Posted April 7, 2014 Share Posted April 7, 2014 Hi i have code for id , element in ipairs ( login.edit ) do addEventHandler ( "onClientGUIFocus" , element , function ( ) CURRENT_EDIT = id end, false ) end addEventHandler( "onClientGUIBlur", root, function() CURRENT_EDIT = 0 end ) addEventHandler( "onClientKey", root, function ( btn , pressed ) if btn == "tab" and pressed == false then if CURRENT_EDIT > 0 then CURRENT_EDIT = CURRENT_EDIT % 2 + 1 local text = guiGetText ( login.edit [ CURRENT_EDIT ] ) local textLength = 0 if string.len ( text ) == 0 then textLength = 1 else textLength = string.len ( text ) end outputChatBox(getElementType(login.edit[CURRENT_EDIT]) .. CURRENT_EDIT) outputChatBox(textLength) guiEditSetCaretIndex( login.edit [ CURRENT_EDIT ], textLength ) end end end ) And it doesnt switch caret to another edit (there are 2 edits in table). Btw. why Lua tag doesnt work ?? Yea well ok i know why Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now