Computer Science Canada

Help with keyboard access

Author:  andyjndm [ Fri Dec 18, 2009 10:43 pm ]
Post subject:  Help with keyboard access

What is it you are trying to achieve?
I'm trying to make Turing press keys, in an auto-talker type manner, such as saying something like "Hello" every 30seconds when I run it.



What is the problem you are having?
I'm not too sure how to make it automatically type.

Describe what you have tried to solve this problem
This is my first step.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:





Please specify what version of Turing you are using
Turing 4.1.1

Author:  Tony [ Sat Dec 19, 2009 1:23 am ]
Post subject:  RE:Help with keyboard access

Are you asking about actually putting key presses into the keyboard buffer (as in keys that another program will read), or is this for something just within your own program?

Author:  apomb [ Sat Dec 19, 2009 4:14 pm ]
Post subject:  RE:Help with keyboard access

you could make a loop and output "hello" with a 30 second delay?

seems completely pointless... but possible.

Author:  andrew. [ Sat Dec 19, 2009 4:29 pm ]
Post subject:  RE:Help with keyboard access

Well if you mean for Turing to output "Hello" every thirty seconds, do something like this:
Turing:
loop
    put "Hello"
    delay (30*1000) % the time is in milliseconds, so you multiply by 1000
end loop


If you want Turing to type in another program, then it's not possible.

Author:  andyjndm [ Sun Dec 20, 2009 3:59 pm ]
Post subject:  Re: RE:Help with keyboard access

Tony @ Sat Dec 19, 2009 1:23 am wrote:
Are you asking about actually putting key presses into the keyboard buffer (as in keys that another program will read), or is this for something just within your own program?


Actually putting key presses into the keyboard buffer.
The actual goal of this is to be a runescape auto-talker, purely for boredom's sake.

Author:  TheGuardian001 [ Sun Dec 20, 2009 4:13 pm ]
Post subject:  Re: Help with keyboard access

In that case you're using the wrong language. Turing has little to no access to anything outside of itself.

Author:  andrew. [ Sun Dec 20, 2009 5:01 pm ]
Post subject:  RE:Help with keyboard access

Try Java. It's not too hard to learn. Once you learn the basics, check out the Robot class. You can do this as well as control the mouse with it.


: