
-----------------------------------
Flea
Mon Nov 22, 2004 3:21 pm

Avoiding Keydown Reset
-----------------------------------
    
Input.KeyDown (chars)
if chars (KEY_ENTER) then
     boolean1 := true
end if

In a case like this, boolean1 becomes false as soon as enter is released.   there any way to avoid this, so the keydown works similar to a getch in the way that it actually gets the information "permanantly"?

-----------------------------------
Cervantes
Mon Nov 22, 2004 4:05 pm

Re: Avoiding Keydown Reset
-----------------------------------
    
Input.KeyDown (chars)
if chars (KEY_ENTER) then
     boolean1 := true
end if

In a case like this, boolean1 becomes false as soon as enter is released.  
oh?


var chars : array char of boolean
var boolean1 := false
loop
    Input.KeyDown (chars)
    if chars (KEY_ENTER) then
        boolean1 := true
    end if
    locate (1, 1)
    put boolean1
end loop


-----------------------------------
Tony
Mon Nov 22, 2004 4:41 pm


-----------------------------------
chars array keeps its values untill you call Input.KeyDown again, at which point values get reset.

-----------------------------------
Flea
Mon Nov 22, 2004 8:53 pm


-----------------------------------
Oops... i dont know what i was thinking.  For some reason i had always thought that as soon as the key was released the variable reset..

anyway thx good to know exactly whats goin on there, and i found what was wrong with my code.
