macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

pressure

クリックの圧力を返します(感圧式の入力装置用)

解説

クリックの圧力を返します(感圧式の入力装置用)
感圧性ないデバイスの値は0.0か1.0。
マウスイベントでなければNSInternalInconsistencyExceptionを起こします。

返り値

( float )

圧力0.0-1.0

引数

フレームワーク

ApplicationKit

クラス

NSEvent

Instance Methods

使用可能

10.0

参照

+ mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:

例文

#import "MyScrollView.h"

@implementation MyScrollView
- (void)mouseDown:(NSEvent *)event
{
        NSLog([NSString stringWithFormat:@"pressure=%.1f",[event pressure]]);
}

@end