From b4d4cd47f59fb9e445e499e0619095de4407c1a3 Mon Sep 17 00:00:00 2001 From: Glenn Date: Mon, 3 Nov 2025 13:45:11 +0000 Subject: [PATCH] Add Event_otherEventWithType https://developer.apple.com/documentation/appkit/nsevent/otherevent(with:location:modifierflags:timestamp:windownumber:context:subtype:data1:data2:) --- core/sys/darwin/Foundation/NSEvent.odin | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/core/sys/darwin/Foundation/NSEvent.odin b/core/sys/darwin/Foundation/NSEvent.odin index 548c5c172..c7968423c 100644 --- a/core/sys/darwin/Foundation/NSEvent.odin +++ b/core/sys/darwin/Foundation/NSEvent.odin @@ -250,6 +250,35 @@ kVK :: enum { ISO_Section = 0x0A, } +/* class methods for creating events */ + +@(objc_type=Event, objc_name="otherEventWithType", objc_is_class_method=true) +Event_otherEventWithType :: proc "c" ( + type: EventType, + location: Point, + flags: EventModifierFlags, + time: TimeInterval, + window_number: Integer, + ctx: id, + subtype: i16, + data1: Integer, + data2: Integer +) -> ^Event { + return msgSend( + ^Event, + Event, + "otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:", + type, + location, + flags, + time, + window_number, + ctx, + subtype, + data1, + data2 + ) +} /* these messages are valid for all events */