redirect and ggui have both been updated to work in this world of of stackless term.redirect behavior. I think. The sample programs seem to work again, in any case. Report any further issues with those two here.
goroutines and ctrlkeys... I've moved away from. The former, I've just moved away from that style of coroutine-heavy programming in CC, and ctrlkeys, I have heard said, had some platform-specific flaws in it's basic approach, and did not work consistently across different operating systems. I'm leaving them up, for now, but they won't be updated and, indeed, I've not even tested to see if they still work or not, so use at your own risk. As before, all of these APIs are wtfpl, meaning you can do whatever you want with them. Wanna use a modified version in your OS? Feel free! Got someone willing to give you cash money in exchange for a compeltely unaltered copy? Go ahead, take that sucker's money. I honestly don't care! Just do wtf you want!
Symmetryc, on 22 November 2013 - 11:03 PM, said:
Ctrl Keys seems a bit overly complex, couldn't you just do something like this?
Or am I just missing something?
Edit: I've updated the code, but I can see that it has some problems; You can't pull events more than about 6 or 7 times a second, otherwise it may mistake ctrl_keys as normal keys :/.
local pullEvent = function(_filter) local t = {} while t[1] ~= (_filter or t[1] or 0) do t = {os.pullEvent()} t[1] = t[1] == "key" and (os.startTimer(0) == ({os.pullEvent()})[2] and "ctrl_key" or os.pullEvent() and t[1]) or t[1] end return unpack(t) end
Or am I just missing something?
Edit: I've updated the code, but I can see that it has some problems; You can't pull events more than about 6 or 7 times a second, otherwise it may mistake ctrl_keys as normal keys :/.
yes. Yes, it could be much simpler. If I were writing it now, knowing all I've learned since then (ctrlkeys was one of my first apis posted on the forums), I would have made a version that didn't queue events or use timers at all.
Edited by GopherAtl, 14 March 2015 - 01:58 AM.