» KeyboardState & MouseState
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

KeyboardState & MouseState

hola,

here is the thing: until now, when creating modules or plugins that take mouse input you'd always have to cons XY and the mousebuttons together somehow so that you'd not need 5 connections to the node. also with the keyboard it was quite messy to parse the actual keystate only given a keycode. no more. we're introducing a special datatype for those now, and we call them "MouseState" and "KeyboardState".

so now, when creating a module that takes mouse or keyboard input use:

to use the data conveniently inside the module.

plugin writers simply use:

ISpread<MouseState> FMouseState;
ISpread<KeyboardState> FKeyboardState;

to create pins of the respective types.

and as a user you'd notice how the following have turned into modules that return an additional handy Mouse or Keyboard:

internally those modules use:

which of course you can use to simulate mouse/keyboards from any arbitrary input. and note that of course those are spreadable.

nodes that already take that input now include:

so for the developer this provides a standard interface for mouse/keyboard input and for the user it will save some clicks. win/win.

joreg, Wednesday, Jul 25th 2012 Digg | Tweet | Delicious 8 comments  
microdee 25/07/2012 - 17:04

cool! and how to create an output from plugins of the above mentioned datatype if i would like to implement it in DirectInput?

joreg 25/07/2012 - 17:09

same, just create an output of type:

 ISpread<KeyboardState> FKeyboardState;
microdee 25/07/2012 - 17:32

i meant how the structure looks like (i guess it's a structure) what are the variables i can tinker with inside this type?

joreg 25/07/2012 - 17:49

you should see its properties via codecompletion or here: pluginspecs/html/Properties_T_VVVV_Utils_IO_KeyboardState.htm

ventolinmono 25/07/2012 - 19:18

Hey this upgrade matches the new Arduino Leonardo with mouse and keyboard features. > http://arduino.cc/blog/2012/07/23/massimo-introduces-arduino-leonardo/

robotanton 25/07/2012 - 19:39

thank you!

robotanton 28/07/2012 - 14:48

Joreg, i've noticed that... KeyMatch (String) needs Key as an Input, so I plug a Keyboard (System Global) into KeyboardState (System Split) but this guy doesn't output <LEFT><RIGHT> and so on on its Key output pin. Am I missing something?

joreg 31/07/2012 - 23:58

right. please check latest alpha which includes a new KeyMatch with a Keyboard input (and some more fancyness). so you can now connect a Keyboard (System Global) directly. also you don't specify keys in angular brackets anymore, but as a simple comma-separated human-readble list, like eg:

 Left, Right, Back, Return
  • 1

anonymous user login

Shoutbox

~3d ago

joreg: Workshop on 01 08: Augmented Reality using OpenCV, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-augmented-reality-using-opencv-in-vvvv/

~12d ago

joreg: Workshop on 18 07: Fluid simulations in FUSE, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-fluid-simulations-in-fuse/

~12d ago

joreg: Workshop on 17 07: Working with particles in FUSE, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-working-with-particles-in-fuse/

~22d ago

joreg: Here's what happened in June in our little univvvverse: https://visualprogramming.net/blog/2024/vvvvhat-happened-in-june-2024/

~24d ago

joreg: We're starting a new beginner tutorial series. Here's Nr. 1: https://visualprogramming.net/blog/2024/new-vvvv-tutorial-circle-pit/

~25d ago

joreg: Registration is open for LINK - the vvvv Summer Camp 24! Full details and signup are here: https://link-summercamp.de/

~25d ago

joreg: Workshop on 11 07: Compute Shader with FUSE, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-compute-shader-with-fuse/

~1mth ago

joreg: Workshop on 27 06: Rendering Techniques with FUSE, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-rendering-techniques-with-fuse/

~1mth ago

joreg: Workshop on 20 06: All about Raymarching with FUSE, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-all-about-raymarching-with-fuse/

~1mth ago

joreg: vvvv gamma 6.5 is out, see changelog: https://thegraybook.vvvv.org/changelog/6.x.html