
-----------------------------------
gohan
Thu Jun 02, 2005 9:14 am

CHARS?
-----------------------------------
I would like to know what the chars for Ctrl and also for Alt???

-----------------------------------
lyam_kaskade
Thu Jun 02, 2005 9:22 am


-----------------------------------
They don't have chars. If you want to use them use Input.KeyDown[/code]

-----------------------------------
[Gandalf]
Thu Jun 02, 2005 11:44 pm


-----------------------------------
Use KEY_CTRL and KEY_ALT when using Input.Keydown.

if keys (KEY_CTRL) then
put "Ctrl has been presssed"[/code]

-----------------------------------
gohan
Fri Jun 03, 2005 8:31 am


-----------------------------------
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?

-----------------------------------
lyam_kaskade
Fri Jun 03, 2005 9:42 am


-----------------------------------
yes.


Input.KeyDown (keys)
    if keys (KEY_SHIFT) and keys (KEY_DOWN_ARROW) then
        put "yes"
    end if


I don't think theres a key for spacebar, but I could be wrong.[/code]

-----------------------------------
StarGateSG-1
Fri Jun 03, 2005 9:54 am


-----------------------------------
Yes there is a space but it is :

ORD_SPACE

-----------------------------------
gohan
Fri Jun 03, 2005 10:36 am


-----------------------------------
Hey, how would I use the space though...because It is different then... Input.KeyDown (chars)
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!!

var x, y : int
x := 4
y := 4
var bc : int := black
var chars : array char of boolean
loop
    Input.KeyDown (chars)
    drawfilloval (x, y, 4, 4, brightred)                    % IT's the character
    delay (10)
    cls
    colourback (black)
    if chars (KEY_UP_ARROW) then                            % MOVE UP
        y := y + 3
    end if
    if chars (KEY_RIGHT_ARROW) then                         % MOVE RIGHT
        x := x + 3
    end if
    if chars (KEY_LEFT_ARROW) then                          % MOVE LEFT
        x := x - 3
    end if
    if chars (KEY_DOWN_ARROW) then                          % MOVE DOWN
        y := y - 3
    end if
    if chars (KEY_ENTER) then                               % TELEPORT BACK TO START POINT
        x := 4
        y := 4
    end if
    if chars (KEY_SHIFT) then                                % TURN INVISIBLE
        for q : 1 .. 10
            drawoval (x, y, 4 + q, 4 + q, bc)
            delay (50)
        end for
    end if
    if chars (KEY_ALT) then                                 % SPECIAL FEATURE (not decided yet)
        for w : 1 .. 10
            drawoval (x, y, 4 + w, 4 + w, white)
            delay (50)
        end for
    end if
    if chars (KEY_CTRL) then                               % SPECIAL FEATURE (not decided yet)
        for e : 1 .. 10
            drawoval (x, y, 4 + e, 4 + e, white)
            delay (50)
        end for
    end if
end loop
It would be kind if some pplz would help me and all of my problems...Plzz and Thnxx

-----------------------------------
StarGateSG-1
Fri Jun 03, 2005 11:10 am


-----------------------------------
I told you how to use space bar:

ORD_SPACE

for the shift do it like this:

if chars = (KEY_SHIFT) then
if invisiblity  = false
invisiblity := true
elsif invisiblity = true then
invisiblity := false
end if

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.

-----------------------------------
gohan
Fri Jun 03, 2005 1:01 pm


-----------------------------------
what would the variable be called for ORD_SPACE
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!!

-----------------------------------
lyam_kaskade
Fri Jun 03, 2005 1:20 pm


-----------------------------------
Check to make sure the radius of the circle (4) is not outside the boundaries of the screen (maxx and maxy)
ie. 

x+4 maxx
y+4 maxy


If it is outside the screen boundaries then just keep x or y from increasing.

-----------------------------------
[Gandalf]
Fri Jun 03, 2005 3:21 pm


-----------------------------------
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:
if keys (' ') then
   put "Space Bar has been presssed"
The '' signs mean that the character inside is what will be detected, if the key does have a character.  Like so:
if keys ('a') then
   put "a has been pressed"
elsif keys (KEY_CTRL) then
   put "The ctrl key has been pressed."
end if

-----------------------------------
syphon4
Fri Jun 03, 2005 3:44 pm

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

-----------------------------------
Bacchus
Sat Jun 04, 2005 12:38 am


-----------------------------------
Bloody Hell, if you really want a good Luigi, just learn how to use Pictures!

|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.

loop
  Input.KeyDown(chars)

  if chars(KEY_SHIFT) then
    invis:=true
  else
    invis:=false
  end if

  if ~invis then
    draw.character
  end if
end loop
|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.

-----------------------------------
gohan
Mon Jun 06, 2005 8:53 am


-----------------------------------
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)

-----------------------------------
Bacchus
Mon Jun 06, 2005 3:09 pm


-----------------------------------
lol That was for syphon4, not you. 

Here like this:
setscreen ("graphics,offscreenonly")
var x, y : int := 20
var invis : boolean := false
var chars : array char of boolean

loop
    cls
    Input.KeyDown (chars)

    invis := false

    if chars (' ') then
        invis := true
    end if

    if chars (KEY_RIGHT_ARROW) & x + 5 = 0 then
        x -= 5
    end if

    if chars (KEY_UP_ARROW) & y + 5 = 0 then
        y -= 5
    end if

    if ~invis then
        drawfilloval (x, y, 5, 5, 2)
    end if
    View.Update
    delay (10)
end loop

-----------------------------------
gohan
Tue Jun 07, 2005 8:16 am


-----------------------------------
Wow, Bacchus...ty very much....i like the code very well....tht solved all my problems man..ty again!!!
