Et-win Posted August 28, 2014 Posted August 28, 2014 Hello all, I have made a little system in Clan War System which uses 'guiSetInputEnabled'. As soon as you click on an edit-box this code is fired and disables the input key's. When you click on a non-edit-box, then it will enable the input key's. Now comes the bug: As soon as you click and hold your mouse on an edit-box and then move your mouse to select some piece of text, it doesn't work with 'onClientGUIClick'. How to make the click and drag detectable? PS: I tried event 'onClientGUIFocus' and 'onClientGUIBlur', but whenever you close the window with a bind, it doesn't get fired. Putting this code's into the bind-function is not an option too, because I can't do this by, for example, the Admin Panel.
Et-win Posted August 28, 2014 Author Posted August 28, 2014 That's an idea, but the last thing I want to do. Thanks though.
lcd12321 Posted August 28, 2014 Posted August 28, 2014 try to addeventhandler on all client events and see what events will trigger
Et-win Posted August 28, 2014 Author Posted August 28, 2014 Like noted above, I did those. Also 'onClientClick' I tried, but will only get the world elements as far as I understand out of the wiki.
Karuzo Posted August 28, 2014 Posted August 28, 2014 I'm not sure i i understood you right. But maybe this could help: addEventHandler("onClientClick",root, function(btn,state) if btn == "left" and state == "down" and isMouseOverElement(x,y,w,h) then --isMouseOverElement(your gui pos,siz, etc..) --your code. end end ) function isMouseOverElement(psx,psy,pssx,pssy) if isCursorShowing() == false then return false end local x,y = guiGetScreenSize() local cx,cy = getCursorPosition() cx,cy = cx*x,cy*y if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then return true,cx,cy else return false end end
Et-win Posted August 28, 2014 Author Posted August 28, 2014 Thanks for the reply Karuzo, but I didn't mean that. I mean, when you click onto an edit-box I active input with 'guiSetInputEnabled'. As soon as you click outside it, input gets deactivated. But if you close the GUI window (Or open another one) with a bind/command (Without clicking), then events 'onClientGUIFocus+Blur' are not fired. This causes a bug that the input is still enabled. If no one knows it, I will stick to a timer or 'onClientRender' in a 'save way'.
Et-win Posted September 13, 2014 Author Posted September 13, 2014 guiSetInputMode("no_binds_when_editing") That did the job.
Saml1er Posted September 13, 2014 Posted September 13, 2014 guiSetInputMode("no_binds_when_editing") That did the job. Oh thanks, I was looking for something like this for my lobby script because players were able to open F8 console and chat. I had no idea how to disable it, once again thanks.
Et-win Posted September 13, 2014 Author Posted September 13, 2014 guiSetInputMode("no_binds_when_editing") That did the job. Oh thanks, I was looking for something like this for my lobby script because players were able to open F8 console and chat. I had no idea how to disable it, once again thanks. Hehe, then I helped us both out
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