Posted 23 August 2013 - 09:10 AM
Hi,
I'm currently writing the submission program for my app store (see signature for more info). I'm at a stage where I'd like to take screenshots of the computer screen. I know I can't directly access the 'pixels', but I'll be changing term.write to also write to a table. My problem is, however, trying to capture a key press to fire the screenshot, yet run the shell and another program at the same time. I need to be able to use the shell because some of the programs may be shell based and I'd rather not fake it using read() or a similar process. When ever I try something such as the following only 'Test fired!' is displayed. This may be due to the coroutine.yeild() that is being called. I may not be explaining myself amazingly well, but essentially I'm trying to capture key presses while the shell is running. If you can think of a better way of doing it let me know. Thanks :)/>
I'm currently writing the submission program for my app store (see signature for more info). I'm at a stage where I'd like to take screenshots of the computer screen. I know I can't directly access the 'pixels', but I'll be changing term.write to also write to a table. My problem is, however, trying to capture a key press to fire the screenshot, yet run the shell and another program at the same time. I need to be able to use the shell because some of the programs may be shell based and I'd rather not fake it using read() or a similar process. When ever I try something such as the following only 'Test fired!' is displayed. This may be due to the coroutine.yeild() that is being called. I may not be explaining myself amazingly well, but essentially I'm trying to capture key presses while the shell is running. If you can think of a better way of doing it let me know. Thanks :)/>
function pull()
while true do
event = os.pullEvent()
print(event .. ' was fired!')
end
end
function test()
print('Test fired!')
end
parallel.waitForAny(pull, test)