Computer Science Canada CHARS? |
Author: | gohan [ Thu Jun 02, 2005 9:14 am ] |
Post subject: | CHARS? |
I would like to know what the chars for Ctrl and also for Alt??? |
Author: | lyam_kaskade [ Thu Jun 02, 2005 9:22 am ] |
Post subject: | |
They don't have chars. If you want to use them use Input.KeyDown[/code] |
Author: | [Gandalf] [ Thu Jun 02, 2005 11:44 pm ] | ||
Post subject: | |||
Use KEY_CTRL and KEY_ALT when using Input.Keydown.
|
Author: | gohan [ Fri Jun 03, 2005 8:31 am ] |
Post subject: | |
Oh yeah...I forgot that I put this down....but it's here now soo...how would i use the space bar? And can I use the shift button and use the arrow keys at the same time? |
Author: | lyam_kaskade [ Fri Jun 03, 2005 9:42 am ] | ||
Post subject: | |||
yes.
I don't think theres a key for spacebar, but I could be wrong.[/code] |
Author: | StarGateSG-1 [ Fri Jun 03, 2005 9:54 am ] | ||
Post subject: | |||
Yes there is a space but it is :
|
Author: | gohan [ Fri Jun 03, 2005 10:36 am ] | ||||
Post subject: | |||||
Hey, how would I use the space though...because It is different then...
This code that im going to put down is for my RPG Final Project....I need help on a few things!!! I got some of the code from a tutorial...I got a little help from it!! ![]() |1| I would like to know how to use the space bar |2| I would like to know if I can hold my SHIFT button down(Stay invisible until I let go) |3| I would like to know if I can hold SHIFT + Arrow Keys (Move,While Inivisible) |4| and last, and prolly not lease... I would like to keep the circle to stay on the screen!!
It would be kind if some pplz would help me and all of my problems...Plzz and Thnxx |
Author: | StarGateSG-1 [ Fri Jun 03, 2005 11:10 am ] | ||||
Post subject: | |||||
I told you how to use space bar:
for the shift do it like this:
if you do the invisiblity like that then you can move. For the circle to stya on the screen just check if the cirlce radius is outsdie of the screen if it is don't let them move in that direction any more. |
Author: | gohan [ Fri Jun 03, 2005 1:01 pm ] | ||
Post subject: | |||
what would the variable be called for
Quote: For the circle to stya on the screen just check if the cirlce radius is outsdie of the screen if it is don't let them move in that direction any more.
I not sure what you mean??? ![]() but thnx for the invisibility tip!! |
Author: | lyam_kaskade [ Fri Jun 03, 2005 1:20 pm ] | ||
Post subject: | |||
Check to make sure the radius of the circle (4) is not outside the boundaries of the screen (maxx and maxy) ie.
If it is outside the screen boundaries then just keep x or y from increasing. |
Author: | [Gandalf] [ Fri Jun 03, 2005 3:21 pm ] | ||||
Post subject: | |||||
Ahh, I was going to post this in my example code, but I was feeling lazy... The easiest way of detecting the spacebar key is:
The '' signs mean that the character inside is what will be detected, if the key does have a character. Like so:
|
Author: | syphon4 [ Fri Jun 03, 2005 3:44 pm ] |
Post subject: | chars |
here man this program tells you all the chars var keys : array 0 .. * of record character : char name : string end record := init ( init (chr (27), "Escape key"), init (chr (187), "F1 key"), init (chr (188), "F2 key"), init (chr (189), "F3 key"), init (chr (190), "F4 key"), init (chr (191), "F5 key"), init (chr (192), "F6 key"), init (chr (193), "F7 key"), init (chr (194), "F8 key"), init (chr (195), "F9 key"), init (chr (196), "F10 key"), init (chr (133), "F11 key"), init (chr (134), "F12 key"), init (chr (10), "Enter key"), init (chr (180), "Shift key"), init (chr (181), "Control key"), init (chr (182), "Alt key"), init (chr (8), "Backspace key"), init (chr (9), "Tab key"), init (chr (203), "Left Arrow"), init (chr (200), "Up Arrow"), init (chr (205), "Right Arrow"), init (chr (208), "Down Arrow"), init (chr (199), "Home"), init (chr (201), "Page Up"), init (chr (207), "End"), init (chr (209), "Page Down"), init (chr (210), "Insert"), init (chr (211), "Delete"), init (chr (183), "Keypad 5"), init ('`', "Left apostrophe key"), init ('1', "1 key"), init ('2', "2 key"), init ('3', "3 key"), init ('4', "4 key"), init ('5', "5 key"), init ('6', "6 key"), init ('7', "7 key"), init ('8', "8 key"), init ('9', "9 key"), init ('0', "0 key"), init ('-', "- key"), init ('=', "= key"), init ('a', "a key"), init ('b', "b key"), init ('c', "c key"), init ('d', "d key"), init ('e', "e key"), init ('f', "f key"), init ('g', "g key"), init ('h', "h key"), init ('i', "i key"), init ('j', "j key"), init ('k', "k key"), init ('l', "l key"), init ('m', "m key"), init ('n', "n key"), init ('o', "o key"), init ('p', "p key"), init ('q', "q key"), init ('r', "r key"), init ('s', "s key"), init ('t', "t key"), init ('u', "u key"), init ('v', "v key"), init ('w', "w key"), init ('x', "x key"), init ('y', "y key"), init ('z', "z key"), init ('[', "[ key"), init (']', "] key"), init ('\\', "\\ key"), init (';', "; key"), init ('\'', "' key"), init (',', ", key"), init ('.', ". key"), init ('/', "/ key"), init (' ', "Space key"), init ('*', "* key (Keypad)"), init ('+', "+ key (Keypad)") ) var a : array char of boolean setscreen ("noecho") loop Input.KeyDown (a) locate (1, 1) for key : 0 .. upper (keys) if a (keys (key).character) then put ord (keys (key).character), ": ", keys (key).name, " " .. end if end for put "" end loop ..............and culd anyone make me a good luigi character and give me the code plz and thank you |
Author: | Bacchus [ Sat Jun 04, 2005 12:38 am ] | ||
Post subject: | |||
Bloody Hell, if you really want a good Luigi, just learn how to use Pictures! gohan wrote: |1| I would like to know how to use the space bar
|2| I would like to know if I can hold my SHIFT button down(Stay invisible until I let go) |3| I would like to know if I can hold SHIFT + Arrow Keys (Move,While Inivisible) |4| and last, and prolly not lease... I would like to keep the circle to stay on the screen!! |1| Gandalf had it right its just ' ', like any other key that returns a character. |2| In your main loop just have a check to see if the key is down.
|3| Stick the Keys in different If statments, it will get them all. |4| 2 ways, Either when you draw the cirlce check to see if it would be below 0 or above the maxx/maxy and draw it inside. Or do a check when they press a button and don't change the x/y if it would go out. |
Author: | gohan [ Mon Jun 06, 2005 8:53 am ] |
Post subject: | |
Quote: Bloody Hell, if you really want a good Luigi, just learn how to use Pictures!
What the heck is that?? |1| check |2| no check (what kind of var would be invis?) |3| no check (I can't get the circle to move, while invisible) |4| no check (I still don't get how to keep my circle to stay on the screen) |
Author: | Bacchus [ Mon Jun 06, 2005 3:09 pm ] | ||
Post subject: | |||
lol That was for syphon4, not you. Here like this:
|
Author: | gohan [ Tue Jun 07, 2005 8:16 am ] |
Post subject: | |
Wow, Bacchus...ty very much....i like the code very well....tht solved all my problems man..ty again!!! |