Master_MTA Posted August 28, 2017 Share Posted August 28, 2017 how i can get the clipboard text ? Link to comment
John Smith Posted August 28, 2017 Share Posted August 28, 2017 (edited) You can't due to privacy reasons. Edited August 28, 2017 by John Smith 1 Link to comment
Master_MTA Posted August 28, 2017 Author Share Posted August 28, 2017 2 minutes ago, John Smith said: You can't due to privacy reasons. hmmm so that mean i can't create edit box dx like gui? Link to comment
Ahmed Ly Posted August 28, 2017 Share Posted August 28, 2017 txt = "" function setClipboard (texts) txt = texts end function isClipboard () if txt ~= "" then return true else return false end end function getClipboard () return txt end -- Example addCommandHandler("qq", function (cmd,...) if arg ~= "" then local w = table.concat({...}, " ") setClipboard(w) outputChatBox("Done "..w.."") end end ) addCommandHandler("dd", function () if isClipboard () then outputChatBox(""..getClipboard().."") else outputChatBox("error") end end ) Link to comment
Master_MTA Posted August 28, 2017 Author Share Posted August 28, 2017 51 minutes ago, Ahmed Ly said: txt = "" function setClipboard (texts) txt = texts end function isClipboard () if txt ~= "" then return true else return false end end function getClipboard () return txt end -- Example addCommandHandler("qq", function (cmd,...) if arg ~= "" then local w = table.concat({...}, " ") setClipboard(w) outputChatBox("Done "..w.."") end end ) addCommandHandler("dd", function () if isClipboard () then outputChatBox(""..getClipboard().."") else outputChatBox("error") end end ) that wasn't my mean i mean if player was browser he is pc normal then he was copy any text then i need to get this copied text not only in mta Link to comment
Moderators IIYAMA Posted August 28, 2017 Moderators Share Posted August 28, 2017 You can't 'get' it ingame. Only 'set' it, which you can use in any other application. Clear? 2 Link to comment
Master_MTA Posted August 28, 2017 Author Share Posted August 28, 2017 45 minutes ago, IIYAMA said: You can't 'get' it ingame. Only 'set' it, which you can use in any other application. Clear? thx Link to comment
Master_MTA Posted August 29, 2017 Author Share Posted August 29, 2017 19 hours ago, IIYAMA said: You can't 'get' it ingame. Only 'set' it, which you can use in any other application. Clear? no thing is possible for Master_MTA small usfel function u can use it with dx edit box like i was want with small example --------------------------useful function function getClipboard() if (getKeyState('rctrl')==true or getKeyState('lctrl')==true) and getKeyState('v')==true then local edit= guiCreateEdit ( 0,0,0,0, '',false,nil ) guiSetAlpha(edit,0) guiEditSetCaretIndex ( edit, 0 ) local text=guiGetText(edit) destroyElement(edit) return text end return false end -------------------------------------------- GUIEditor = { edit = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(542, 304, 403, 102, "", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.edit[1] = guiCreateEdit(62, 39, 279, 24, "", false, GUIEditor.window[1]) end ) addEventHandler('onClientKey',root,function(btn,st) if st then guiSetText(GUIEditor.edit[1],getClipboard() or '') end end) 1 1 Link to comment
Moderators IIYAMA Posted August 29, 2017 Moderators Share Posted August 29, 2017 It isn't the same as what getClipboard would do, because ctrl + v is required. But it is definitely useful. 1 Link to comment
Master_MTA Posted August 29, 2017 Author Share Posted August 29, 2017 32 minutes ago, IIYAMA said: It isn't the same as what getClipboard would do, because ctrl + v is required. But it is definitely useful. 2 hours ago, Master_MTA said: small usfel function u can use it with dx edit box like i was want that i was said any way that will help us when we want to set Dx edit box text 1 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