We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
OSC Key Mapping (Read 1485 times)
OSC Key Mapping
Jul 13th, 2009, 11:11pm
 
im new to processing, and i was wondering how i would map OSC messages to keyboard keys. I can do it so easily in OSCulator, but thats on my mac. no pc equevelent, and i dont want to use pure data or Max/msp
i would only be mapping a few osc signals, like /up to the up key on the keyboard and so on...
this is for an ipod touch media center remote, if anyone cares
Re: OSC Key Mapping
Reply #1 - Jul 18th, 2009, 12:26pm
 
may like this.

import oscP5.*;
import netP5.*;

OscP5 osc;
NetAddress sendAdr;

void setup() {

osc = new OscP5(this,12000);
sendAdr = new NetAddress("192.168.2.100",12000);
}

void draw() {

}

void keyPressed() {
switch(key) {
case 'a':
    OscMessage m = new OscMessage("/any");
   m.add(10);
 osc.send(m,sendAdr);
 println("msg send");
}
}

but it only works as long you have the applet focused
Page Index Toggle Pages: 1