How to catch multiple keyStroke?

View: New views
4 Messages — Rating Filter:   Alert me  

How to catch multiple keyStroke?

by Phua Khai Fong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
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

Re: How to catch multiple keyStroke?

by stan shepherd () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: How to catch multiple keyStroke?

by Darius Clarke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <kayef8@...> 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


GPGPU in Croquet

by matthew chadwick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.