How to catch multiple keyStroke?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to catch multiple keyStroke?

Phua Khai Fong
Hi,

I am trying to implement some keyboard functions using the keyStroke: method.

How can I catch multiple keyStroke: together?

For example, if the 'w' key is used to move forward and the 'd' key is to strafe right, I would want to press both together and move in a diagonal manner.

Currently, I can only have a single keyStroke: at a time which only the last key pressed is recorded.

Send instant messages to your online friends http://uk.messenger.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: How to catch multiple keyStroke?

Stan Shepherd
This post was updated on .
Phua Khai Fong wrote
Hi,

I am trying to implement some keyboard functions using the keyStroke: method.

How can I catch multiple keyStroke: together?
Hello,

I think the example given by Bert here: http://www.nabble.com/Detecting-keyboard-state---finding-older-fixes-td15779144.html#a15836979

will do what you want.

Note that you will probably have to catch auto repeat keystrokes sent by Windows or Linux- see the rest of the thread.

...Stan
Reply | Threaded
Open this post in threaded view
|

Re: How to catch multiple keyStroke?

Darius Clarke
In reply to this post by Phua Khai Fong
Hi Phua Khai Fong,

I don't have the code in front of me, but usually there is a key stroke "down" even and a key stroke "up" even at a lower level than the getting a character event. To look for keyboard "cord" presses, while looking for those events you would have to look for the 'w' "down" and a 'd' "down" before seeing a 'w' up event.

Cheers,
Darius
______________

On Tue, Jul 15, 2008 at 3:31 AM, Phua Khai Fong <[hidden email]> wrote:
Hi,

I am trying to implement some keyboard functions using the keyStroke: method.

How can I catch multiple keyStroke: together?

For example, if the 'w' key is used to move forward and the 'd' key is to strafe right, I would want to press both together and move in a diagonal manner.

Currently, I can only have a single keyStroke: at a time which only the last key pressed is recorded.

Send instant messages to your online friends http://uk.messenger.yahoo.com

Reply | Threaded
Open this post in threaded view
|

GPGPU in Croquet

hendikon
In reply to this post by Stan Shepherd
I've been playing with chaotic attractors of dynamical systems in Croquet, computed on the GPU. The code is based on David Faught's procedural textures code. Here's a movie of a simple system:

http://au.youtube.com/watch?v=10h2XhP0u0g


The cube is a parameter space for a parameter of the system.

The same code could also be used for other things like physics simulations, but it's not quite ready for public release just yet.