Computer Science Canada hotkeys |
Author: | hackman [ Thu Sep 25, 2003 3:35 pm ] |
Post subject: | hotkeys |
First of all, im new here and new to programing. I started programing with turing about 4 weeks ago. Well anyway, i was wondering if anyone could tell me how to set a hotkey(ex. in a slotmachine game, how to make it so i just have to press space bar to pull the lever instead of typing Y +enter). Well thats all ive got to say for now. Thanks. |
Author: | Dan [ Thu Sep 25, 2003 5:04 pm ] | ||||
Post subject: | |||||
for this you whould whont to use the getch comand. getch(string(1)) - note that string(1) is a string with only one letter or a charticher. ex.
now that is how you get input with out needing enter to be hit but you will need to use if's to check what button was hit. also getch puts the ACII char in the string(1) or char and not it's value so you will need to conver it. ex.
this will stop the progaming from ruing while it weghts for input just like get but dose not need enter. if you whont an non-blocking way of doing it you wil have to use hasch or input.keydown (truing 4.x only)[/code] |
Author: | Tony [ Thu Sep 25, 2003 6:52 pm ] |
Post subject: | |
heh, Dan - are you forgetting Input.KeyDown? hackman - if you're using WinOOT 4.x , you're better off using Input.KeyDown - it generates a boolean array of all the keys pressed (well, as much as your hardware supports (which is usually 3 characters + 3 system). There's a tutorial on that somewhere under Turing -> Tutorials. |
Author: | hackman [ Thu Sep 25, 2003 9:16 pm ] |
Post subject: | |
Thank you so much! Everything is up and runing smooth now. p.s. im using version 3.1 somthin |