Repository: servo/core-foundation-rs (language: rust)

Issue:
add isARepeat method to NSEvent?
This seems like it is probably an oversight; I think this should be implemented alongside `keyCode()`, `characters()`, etc?


Discussion / hints:
Indeed. Would you like to make a pull request?

Fix patch:
diff --git a/cocoa/src/appkit.rs b/cocoa/src/appkit.rs
index 0b1777399..5acd40d5d 100644
--- a/cocoa/src/appkit.rs
+++ b/cocoa/src/appkit.rs
@@ -2354,6 +2354,7 @@ pub trait NSEvent: Sized {
     unsafe fn characters(self) -> id /* (NSString *) */;
     unsafe fn charactersIgnoringModifiers(self) -> id /* (NSString *) */;
     unsafe fn keyCode(self) -> libc::c_ushort;
+    unsafe fn isARepeat(self) -> BOOL;
 
     // Getting Mouse Event Information
     unsafe fn pressedMouseButtons(_: Self) -> NSUInteger;
@@ -2602,6 +2603,10 @@ impl NSEvent for id {
         msg_send![self, keyCode]
     }
 
+    unsafe fn isARepeat(self) -> BOOL {
+        msg_send![self, isARepeat]
+    }
+
     // Getting Mouse Event Information
 
     unsafe fn pressedMouseButtons(_: Self) -> NSUInteger {


Test patch: