aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGlenn <terids@gmail.com>2025-11-03 13:45:11 +0000
committerGlenn <terids@gmail.com>2025-11-03 14:29:58 +0000
commitb4d4cd47f59fb9e445e499e0619095de4407c1a3 (patch)
tree0240d9351db9dea23b2fe5f7b8da0f1d24ed66d5 /core
parent8c6120f414bf32d1f0d2c25ff795bf7a9793872c (diff)
Add Event_otherEventWithType
https://developer.apple.com/documentation/appkit/nsevent/otherevent(with:location:modifierflags:timestamp:windownumber:context:subtype:data1:data2:)
Diffstat (limited to 'core')
-rw-r--r--core/sys/darwin/Foundation/NSEvent.odin29
1 files changed, 29 insertions, 0 deletions
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 */