ShiVa3D
how to detect keyboard
Windows DX9/OpenGL 2 Standalone Appshow to detect keyboard
by followshiva » 09 Aug 2011, 09:55
hi,
how to detect any click on keyboard?
if i catch the kKeyCode like "log.message ( kKeyCode )",
log message will display numeric(1,2,3...) not alphabet(A,B,C...)
or
may i transform numeric to alphabet like (0 > a, 1 > b)
thanks.
how to detect any click on keyboard?
if i catch the kKeyCode like "log.message ( kKeyCode )",
log message will display numeric(1,2,3...) not alphabet(A,B,C...)
or
may i transform numeric to alphabet like (0 > a, 1 > b)
thanks.
- followshiva
- Fresh Boarder

- Posts: 9
Re: how to detect keyboard
by RedQueen » 09 Aug 2011, 17:40
You have to have the game main script to send a message to the AIMODEL that you want to respond to a keydown event.
IE:
First you need the MAIN BRAIN that controls every script that will be in your program. As in the image the MAIN BRAIN is what process the keydown events and send it to the PLAYER_AI script like this.



Hope that explains it clear and many apologizes for any typo was making this while chasing two little ones around the house.
But Shiva operates for example how our bodies operate we have our brain the send messages to each part of our body and that is what the main script in Shiva is for it is the brain and send all the necessary messages to where they need to be sent. Well that is how I understand it and it helped me get further with my study of programming for it.
IE:
First you need the MAIN BRAIN that controls every script that will be in your program. As in the image the MAIN BRAIN is what process the keydown events and send it to the PLAYER_AI script like this.



Hope that explains it clear and many apologizes for any typo was making this while chasing two little ones around the house.
But Shiva operates for example how our bodies operate we have our brain the send messages to each part of our body and that is what the main script in Shiva is for it is the brain and send all the necessary messages to where they need to be sent. Well that is how I understand it and it helped me get further with my study of programming for it.
- RedQueen
- Platinum Boarder

- Posts: 333
2 posts
• Page 1 of 1