Author |
Message |
isaiahk9
![](http://compsci.ca/v3/uploads/user_avatars/1465120414488e669e1f83a.jpg)
|
Posted: Sun May 11, 2008 2:41 pm Post subject: ID for keys in number pad |
|
|
I want to make some controls in my game (Number pad 1 - 6), but when I go
elsif key (KEY_KEYPAD_5) then
where key is a variable for the key being pressed, this only works for the number pad 5, not any others. So what is the ID of the keys Numberpad 1, 2, 3, 4, 6? I would use it in a
Input.KeyDown (key)
type of format.
Does any one know?
Thanx. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun May 11, 2008 2:45 pm Post subject: RE:ID for keys in number pad |
|
|
you should probably check the same page of documentation as where you found KEY_KEYPAD_5
If you check the value of the constant, it would probably give you a clue as to what the others are as well.
A fairly good guess would be that characters '1', '2', '3', etc. would work. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
isaiahk9
![](http://compsci.ca/v3/uploads/user_avatars/1465120414488e669e1f83a.jpg)
|
Posted: Sun May 11, 2008 3:07 pm Post subject: RE:ID for keys in number pad |
|
|
No Tony, I checked the page and it gives no clues as to what the other number-pads are. As well, I tried KEY_KEYPAD_1, etc. Doesn't work. |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun May 11, 2008 4:18 pm Post subject: RE:ID for keys in number pad |
|
|
what's the value of KEY_KEYPAD_5 ? (actually I honestly don't know)
and what about trying Input.KeyDown('1') ? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
jinjin
|
|
|
|
![](images/spacer.gif) |
isaiahk9
![](http://compsci.ca/v3/uploads/user_avatars/1465120414488e669e1f83a.jpg)
|
Posted: Sun May 11, 2008 5:11 pm Post subject: RE:ID for keys in number pad |
|
|
To Tony : My game is a two-player fighter, and one player has WASD, YUIHJK for controls. PLayer two has the arrows and Num Pad 1, 2, 3, 4, 5, 6.
To jinjin : what do these IDs help with Input.KeyDown? |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun May 11, 2008 5:22 pm Post subject: RE:ID for keys in number pad |
|
|
that doesn't answer either of my questions. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
isaiahk9
![](http://compsci.ca/v3/uploads/user_avatars/1465120414488e669e1f83a.jpg)
|
Posted: Sun May 11, 2008 5:43 pm Post subject: RE:ID for keys in number pad |
|
|
To Tony :
"what's the value of KEY_KEYPAD_5 ? (actually I honestly don't know) "
I thought you meant what was the point of having that as a key in my game.
"put KEY_KEYPAD_5 "
It just outputs a period.
"and what about trying Input.KeyDown('1')"
I just get this error : Non variable passed to 'var' formal |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
S_Grimm
![](http://compsci.ca/v3/uploads/user_avatars/18926424384e6d86e5cf4d6.jpg)
|
Posted: Mon May 12, 2008 11:30 am Post subject: RE:ID for keys in number pad |
|
|
is your numlock on or off? try it with both. |
|
|
|
|
![](images/spacer.gif) |
isaiahk9
![](http://compsci.ca/v3/uploads/user_avatars/1465120414488e669e1f83a.jpg)
|
Posted: Mon May 12, 2008 12:45 pm Post subject: RE:ID for keys in number pad |
|
|
Still no luck |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Mon May 12, 2008 12:54 pm Post subject: Re: RE:ID for keys in number pad |
|
|
isaiahk9 @ Sun May 11, 2008 5:43 pm wrote: I just get this error : Non variable passed to 'var' formal
I'm pretty sure that's not how Input.KeyDown works
Turing: |
var chars : array char of boolean
loop
Input.KeyDown (chars )
if chars ('1') then
put "omg, it's 1!"
delay(5000)
end if
end loop
|
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
isaiahk9
![](http://compsci.ca/v3/uploads/user_avatars/1465120414488e669e1f83a.jpg)
|
Posted: Mon May 12, 2008 1:21 pm Post subject: RE:ID for keys in number pad |
|
|
nice, tony. thanx, everybody. What tony said was right - ('1'), and all the others. My buddy pointed that out two minutes after I read Ton'y post. Now, so long as the other player doesn't cheat by pressing number lock or any of the keys above their controls . . . |
|
|
|
|
![](images/spacer.gif) |
|