MonobjcMonobjc Documented Class Library
KeyEventWithTypeLocationModifierFlagsTimestampWindowNumberContextCharactersCharactersIgnoringModifiersIsARepeatKeyCode Method (type, location, flags, time, windowNum, context, characters, unmodCharacters, repeatKey, code)
NamespacesMonobjc.AppKitNSEventKeyEventWithTypeLocationModifierFlagsTimestampWindowNumberContextCharactersCharactersIgnoringModifiersIsARepeatKeyCode(NSEventType, NSPoint, NSUInteger, Double, NSInteger, NSGraphicsContext, NSString, NSString, Boolean, UInt16)

Returns a new NSEvent object describing a key event.

Original signature is '+ (NSEvent *)keyEventWithType:(NSEventType)type location:(NSPoint)location modifierFlags:(NSUInteger)flags timestamp:(NSTimeInterval)time windowNumber:(NSInteger)windowNum context:(NSGraphicsContext *)context characters:(NSString *)characters charactersIgnoringModifiers:(NSString *)unmodCharacters isARepeat:(BOOL)repeatKey keyCode:(unsigned short)code'

Available in Mac OS X v10.0 and later.

Declaration Syntax
C#Visual BasicVisual C++
public static NSEvent KeyEventWithTypeLocationModifierFlagsTimestampWindowNumberContextCharactersCharactersIgnoringModifiersIsARepeatKeyCode(
	NSEventType type,
	NSPoint location,
	NSUInteger flags,
	double time,
	NSInteger windowNum,
	NSGraphicsContext context,
	NSString characters,
	NSString unmodCharacters,
	bool repeatKey,
	ushort code
)
Public Shared Function KeyEventWithTypeLocationModifierFlagsTimestampWindowNumberContextCharactersCharactersIgnoringModifiersIsARepeatKeyCode ( _
	type As NSEventType, _
	location As NSPoint, _
	flags As NSUInteger, _
	time As Double, _
	windowNum As NSInteger, _
	context As NSGraphicsContext, _
	characters As NSString, _
	unmodCharacters As NSString, _
	repeatKey As Boolean, _
	code As UShort _
) As NSEvent
public:
static NSEvent^ KeyEventWithTypeLocationModifierFlagsTimestampWindowNumberContextCharactersCharactersIgnoringModifiersIsARepeatKeyCode(
	NSEventType type, 
	NSPoint location, 
	NSUInteger flags, 
	double time, 
	NSInteger windowNum, 
	NSGraphicsContext^ context, 
	NSString^ characters, 
	NSString^ unmodCharacters, 
	bool repeatKey, 
	unsigned short code
)
Parameters
type (NSEventType)
One of the following event-type constants: NSKeyDown, NSKeyUp, NSFlagsChanged. If anything else is specified, an NSInternalInconsistencyException is raised.
location (NSPoint)
The cursor location in the base coordinate system of the window specified by windowNum.
flags (NSUInteger)
An integer bit field containing any of the modifier key masks described in “Constants,” combined using the C bitwise OR operator.
time (Double)
The time the event occurred in seconds since system startup.
windowNum (NSInteger)
An integer that identifies the window device associated with the event, which is associated with the NSWindow that will receive the event.
context (NSGraphicsContext)
The display graphics context of the event.
characters (NSString)
A string of characters associated with the key event. Though most key events contain only one character, it is possible for a single keypress to generate a series of characters.
unmodCharacters (NSString)
The string of characters generated by the key event as if no modifier key had been pressed (except for Shift). This argument is useful for getting the “basic” key value in a hardware-independent manner.
repeatKey (Boolean)
YES if the key event is a repeat caused by the user holding the key down, NO if the key event is new.
code (UInt16)
A number that identifies the keyboard key associated with the key event. Its value is hardware-independent.
Return Value
The created NSEvent instance or nil if the instance could not be created.
Version Information
  • Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)

Assembly: Monobjc.AppKit (Module: Monobjc.AppKit)