入出力 (OSX: Xcode)

cocoa_standard_in
標準入力:キーボード/マウス //key responce enable
- (BOOL) acceptsFirstResponder
{
 return YES;
}

- (BOOL)acceptsFirstResponder
{
return YES;
}
- (void)mouseDragged:(NSEvent *)event
{
 NSPoint eventLocation= [event locationInWindow];
 NSLog(@"x=%f,y=%f",eventLocation.x,eventLocation.y);
}

- (void)keyDown:(NSEvent*)event
{
 unsigned short buf=[event keyCode];
 NSLog(@"keycode=%d",buf);
 switch(buf)
 {
 case 18://1
 break;
 }
}

     

serialClass

シリアル通信用クラス

このクラスではシリアルデバイスのパスは決め打ちになっている。
メソッド OpenSerialPort  にデバイスのパスを示す文字列:
例えばこんなの
"/dev/cu.USA19QI1b1P1.1"

探し方は、ターミナルを立ち上げて
cd /dev/
ls
と打つとデバイスのリストが出るので、シリアルコンバータ等を接続後にリストして探してください。
実装して初期化のプロセスでこんな風にcallします。
[_serial OpenSerialPort:"/dev/cu.USA19QI1b1P1.1"];

メソッドread と writeを改造して作品に適用してください。
[_serial read];
[_serial write:"hello":5];
cocoaGLservo
OpenGL描画とサーボコントローラ(MINI SSC)を組合わせたもの  

MIDIClass

MIDI

とりあえずMIDI portに流れてくるパケットを読み込み
Run Logに出力する。
このクラスを使用する際には、
CoreMIDI.frameworkをリンクすること。 ?