
-----------------------------------
JSBN
Fri Jun 20, 2003 3:11 pm

Input.KeyDown
-----------------------------------
For Input.KeyDown, how do i detect an uppercase letter (ie. A)
i know to detect shift it is (KEY_SHIFT) and for a it is ('a').
Itried puting the 2 togeather, that d'dn't work, and i tried ('A'), but that didn't work either.
:/

-----------------------------------
Tony
Fri Jun 20, 2003 9:35 pm


-----------------------------------
you check for both at same time.

if chars(Key_SHIFT) and chars('a') then
...

-----------------------------------
JSBN
Sat Jun 21, 2003 12:05 am


-----------------------------------
i already tried that :/

-----------------------------------
Blade
Sat Jun 21, 2003 9:16 am


-----------------------------------
tony is right.... if you go to the help file, then...
 The array returned is a list of all the characters. A key is currently pressed if the array element with the corresponding character is true. For example, the a key is pressed is chars ('a') is true. Note that each key is individually represented, so if the user has pressed Shift+a to get a 'A', then Input.KeyDown would register Shift and 'a' as pressed, but not 'A'. 
and this works for me
var chars : array char of boolean
loop
    Input.KeyDown (chars)
    if chars ('a') & chars (KEY_SHIFT) then
        put "hi"
    else
        put "bye"
    end if
    locate (1, 1)
end loop

-----------------------------------
JSBN
Sun Jun 22, 2003 12:43 pm


-----------------------------------
ok, i figured out my problem, i had it set up wrong.
i had:
if chars ('a') then
...
elsif chars ('a') and chars (KEY_SHIFT) then
...
what u need is :
if chars ('a') and chars (KEY_SHIFT) then
...
elsif chars ('a') then
...
THe upper case letter MUST go b4 the lowercase letter
THx for your help, and esspecially to blade for makingme relize this.

-----------------------------------
JSBN
Mon Jun 23, 2003 6:23 pm


-----------------------------------
another question, I was wondering what Caps lock was.

-----------------------------------
Homer_simpson
Mon Jun 23, 2003 6:28 pm


-----------------------------------
i dont think that input keydown supports capslock =/

-----------------------------------
Asok
Mon Jun 23, 2003 6:40 pm


-----------------------------------
if ANYONE knows how to detect caps lock via Input.Keydown they'll get 25 bits. (must provide source code)

-----------------------------------
Homer_simpson
Mon Jun 23, 2003 8:08 pm


-----------------------------------
lol if anyone finds out how to do that using turing... he'll get 100 bits...(knowing that it's impossible...)

-----------------------------------
Andy
Mon Jun 23, 2003 8:23 pm


-----------------------------------
ya it is impossible... can you even detect if shift is pressed?

-----------------------------------
Catalyst
Mon Jun 23, 2003 8:26 pm


-----------------------------------
u people...

var chars : array char of boolean
var key : string (1) := "!"
fcn capTest (k : string (1)) : boolean
    if ord (k) >= 65 and ord (k) 