| Home 目次>ApplicationKit>NSApplication | |
currentEvent
現在のイベントを返します
-(NSEvent *) currentEvent
【返り値】 | |
| NSEvent * | イベント |
【解説】
現在のイベントを返します。
【例文】
#import "Controller.h"
@implementation Controller
- ( IBAction )pushButton:( id )sender
{
NSEvent *event = [[NSApplication sharedApplication] currentEvent];
switch ([event type]) {
case NSKeyDown:
NSLog( @"%d" ,[event keyCode]);
break ;
case NSLeftMouseUp:
case NSRightMouseUp:
NSLog( @"%d" ,[event clickCount]);
default :
break ;
}
}
@end
![]() | |
この記事を評価してください。
| Home 目次>ApplicationKit>NSApplication | 修正日2007.12.21 |