56 posts
Posted 23 February 2014 - 04:44 PM
Hey guys, I'm trying to design a GUI and I'm wondering how it would be possible to pull both a key press and a mouse click at the same time. If anyone wants the GUI or wants to look at the code, I'll post it here. Thanks in advance for all of the help.
8543 posts
Posted 23 February 2014 - 04:53 PM
Nope. You can only pull one event each time you call os.pullEvent. Unless you mean simply calling os.pullEvent with no filter? That will allow you to pull each event in the computer's queue. If that's what you mean, you simply remove the filter argument and call:
os.pullEvent()
1281 posts
Posted 23 February 2014 - 04:54 PM
os.pullEvent pulls all events, unless you tell it to only get one specific one.
local tEvent = {os.pullEvent()}
if tEvent[1] == "key" then
--key event
elseif tEvent[1] == "mouse_click"
--mouse event
end
56 posts
Posted 23 February 2014 - 05:06 PM
I mean do it without a filter yes, but how would I make it call the cords and the button and a key at the same time, a tArgs?
8543 posts
Posted 23 February 2014 - 05:14 PM
Just throw the return values into a table, like CometWolf's example above, then index what you need out of it.
56 posts
Posted 23 February 2014 - 05:22 PM
okay, thanks all for your help