mail-archives/mono-osx/2012-September/005086.html

123 строки
7.2 KiB
HTML
Исходник Постоянная ссылка Обычный вид История

2019-06-06 22:05:17 +03:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE> [Mono-osx] Porting windows specific functionality to mac
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-osx%40lists.ximian.com?Subject=Re%3A%20%5BMono-osx%5D%20Porting%20windows%20specific%20functionality%20to%20mac&In-Reply-To=%3CCAMfhp5GuAfsBD3hOgL21J9oDQp8r%3DA%3DtuXBpx_0XNP%2BsPh5eCg%40mail.gmail.com%3E">
<META NAME="robots" CONTENT="index,nofollow">
<style type="text/css">
pre {
white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
}
</style>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="005085.html">
<LINK REL="Next" HREF="005087.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-osx] Porting windows specific functionality to mac</H1>
<B>Duane Wandless</B>
<A HREF="mailto:mono-osx%40lists.ximian.com?Subject=Re%3A%20%5BMono-osx%5D%20Porting%20windows%20specific%20functionality%20to%20mac&In-Reply-To=%3CCAMfhp5GuAfsBD3hOgL21J9oDQp8r%3DA%3DtuXBpx_0XNP%2BsPh5eCg%40mail.gmail.com%3E"
TITLE="[Mono-osx] Porting windows specific functionality to mac">duane at wandless.net
</A><BR>
<I>Mon Sep 17 19:03:23 UTC 2012</I>
<P><UL>
<LI>Previous message: <A HREF="005085.html">[Mono-osx] Porting windows specific functionality to mac
</A></li>
<LI>Next message: <A HREF="005087.html">[Mono-osx] Porting windows specific functionality to mac
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#5086">[ date ]</a>
<a href="thread.html#5086">[ thread ]</a>
<a href="subject.html#5086">[ subject ]</a>
<a href="author.html#5086">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>It looks like CGEventCreateMouseEvent is in the ApplicationServices
framework.
<A HREF="http://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html">http://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html</A>
Your DllImport would be something like:
[System.Runtime.InteropServices.DllImport(&quot;/System/Library/Frameworks/ApplicationServices.framework/ApplicationServices&quot;)]
--- the signature
For a high resolution timer maybe this will point you in the correct
direction:
<A HREF="http://stackoverflow.com/questions/3540234/high-resolution-timer-for-iphone">http://stackoverflow.com/questions/3540234/high-resolution-timer-for-iphone</A>
Duane
On Mon, Sep 17, 2012 at 2:34 PM, George &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">mcnamaragio at gmail.com</A>&gt; wrote:
&gt;<i> Thanks for your reply. Yes, I am using MonoMac. I was unable to find
</I>&gt;<i> anything related to CGEventCreateMouseEvent in MonoMac docs. Which library
</I>&gt;<i> should I PInvoke? Any thoughts about high precision timer?
</I>&gt;<i>
</I>&gt;<i> Duane Wandless wrote
</I>&gt;<i> I cannot tell from your questions whether or not you have found MonoMac.
</I>&gt;<i> If you have great. If not: <A HREF="http://www.mono-project.com/MonoMac">http://www.mono-project.com/MonoMac</A>
</I>&gt;<i> <A HREF="http://tirania.org/monomac/">http://tirania.org/monomac/</A> If MonoMac does not provide bindings for
</I>&gt;<i> CGEventCreateMouseEvent then yes you can add them using PInvoke. Duane On
</I>&gt;<i> Mon, Sep 17, 2012 at 8:57 AM, Giorgi Dalakishvili &lt;[hidden email]&lt;<A HREF="http://user/SendEmail.jtp?type=node&amp;node=4656666&amp;i=0">http://user/SendEmail.jtp?type=node&amp;node=4656666&amp;i=0</A>&gt;&gt;wrote:
</I>&gt;<i> &gt; Hello, &gt; &gt; &gt; &gt; I am porting a Winforms application to Mac and need some
</I>&gt;<i> help with porting &gt; windows specific functionality. &gt; &gt; &gt; &gt; I am using
</I>&gt;<i> multimedia timers to execute a callback method repeatedly. Is &gt; there
</I>&gt;<i> anything similar on Mac OS x and how do I use it from Mono? I am &gt; aware of
</I>&gt;<i> NSTimer but it does not have the precision I am looking for. &gt; &gt; &gt; &gt; Also,
</I>&gt;<i> I am using mouse hooks to track mouse and SendInput to simulate &gt; mouse
</I>&gt;<i> events. I am able to get track mouse with NSEvent but I&#8217;m not sure &gt; how to
</I>&gt;<i> simulate mouse clicks. I found that it is possible with &gt;
</I>&gt;<i> CGEventCreateMouseEvent and CGEventPost but how do I call these from Mono?
</I>&gt;<i> &gt; Do I need to use PInvoke? &gt; &gt; &gt; &gt; Thank you in advance. &gt; &gt;
</I>&gt;<i> _______________________________________________ &gt; Mono-osx mailing list &gt; [hidden
</I>&gt;<i> email] &lt;<A HREF="http://user/SendEmail.jtp?type=node&amp;node=4656666&amp;i=1">http://user/SendEmail.jtp?type=node&amp;node=4656666&amp;i=1</A>&gt; &gt;
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">http://lists.ximian.com/mailman/listinfo/mono-osx</A> &gt; &gt;
</I>&gt;<i> _______________________________________________ Mono-osx mailing list [hidden
</I>&gt;<i> email] &lt;<A HREF="http://user/SendEmail.jtp?type=node&amp;node=4656666&amp;i=2">http://user/SendEmail.jtp?type=node&amp;node=4656666&amp;i=2</A>&gt;
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">http://lists.ximian.com/mailman/listinfo/mono-osx</A>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> ------------------------------
</I>&gt;<i> View this message in context: Re: Porting windows specific functionality
</I>&gt;<i> to mac&lt;<A HREF="http://mono.1490590.n4.nabble.com/Porting-windows-specific-functionality-to-mac-tp4656663p4656666.html">http://mono.1490590.n4.nabble.com/Porting-windows-specific-functionality-to-mac-tp4656663p4656666.html</A>&gt;
</I>&gt;<i> Sent from the Mono - OSX mailing list archive&lt;<A HREF="http://mono.1490590.n4.nabble.com/Mono-OSX-f1546893.html">http://mono.1490590.n4.nabble.com/Mono-OSX-f1546893.html</A>&gt;at Nabble.com.
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> Mono-osx mailing list
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">Mono-osx at lists.ximian.com</A>
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">http://lists.ximian.com/mailman/listinfo/mono-osx</A>
</I>&gt;<i>
</I>&gt;<i>
</I>-------------- next part --------------
An HTML attachment was scrubbed...
URL: &lt;<A HREF="http://lists.ximian.com/pipermail/mono-osx/attachments/20120917/5a50eade/attachment.html">http://lists.ximian.com/pipermail/mono-osx/attachments/20120917/5a50eade/attachment.html</A>&gt;
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="005085.html">[Mono-osx] Porting windows specific functionality to mac
</A></li>
<LI>Next message: <A HREF="005087.html">[Mono-osx] Porting windows specific functionality to mac
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#5086">[ date ]</a>
<a href="thread.html#5086">[ thread ]</a>
<a href="subject.html#5086">[ subject ]</a>
<a href="author.html#5086">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-osx">More information about the Mono-osx
mailing list</a><br>
</body></html>