The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by cdoral]

I need help. I wrote a KeyBehavior for reading the cursor keys. I have a cube
moving in a scene with these keys. My problem is that i don't know how to read
keys at same time. Ex: if I press VK_LEFT the cube goes to left, if I press
VK_UP the cube goes ahead, but i can't press VK_LEFT and VK_RIGHT at same time
to go left AND ahead.
can someone help me ?
thanks
import-bot (20211) [Avatar] Offline
#2
Re: reading keys at same time
[Originally posted by author]

In general, only the modifier keys are intended for chording (multiple
simultaneous keys down). That said, some hardware may allow other keys to
chord. In any case, I've tested the keyboard sensor class in the book
software on several PCs and found that the arrow keys chord (for the most
part).

--jon

> I need help. I wrote a KeyBehavior for reading the cursor keys. I have a cube
> moving in a scene with these keys. My problem is that i don't know how to read
> keys at same time. Ex: if I press VK_LEFT the cube goes to left, if I press
> VK_UP the cube goes ahead, but i can't press VK_LEFT and VK_RIGHT at same time
> to go left AND ahead.
> can someone help me ?
> thanks