mouse

How to determine if mouse is moving clockwise or counterclockwise?

≡放荡痞女 提交于 2019-12-05 04:56:32
问题 I have an MFC appplication where the user have to move the mouse around a circle circonference with a dragging mouvement. I need to retrieve the number of degrees during this mouse drag "rotation" and I need to know if it's clockwise or counterclockwise. At first, to determine the rotation direction, I was comparing x-coordinnate between the current mouse position and the mouse position where the user clicked to initiate the dragging. That works well until the user rotate over 180 degrees.

Synthetic click doesn't switch application's menu bar (Mac OS X)

一世执手 提交于 2019-12-05 04:43:21
问题 I'm developing some sort of air mouse application for iPhone platform. This applications connects to one computer service which generates mouse events on Mac OS X. I'm generating this events with CGEventCreateMouseEvent() and CGEventPost(). But I've encountered one problem. Let's say you are using Safari and then you click on free desktop space. If you do this with regular mouse it will hide Safari's top menu bar and show Finder menu bar. But on these synthetic events it doesn't act like that

Send mouse clicks to X Y coordinate of another application

◇◆丶佛笑我妖孽 提交于 2019-12-05 03:14:02
问题 I am trying to send a simulated mouse click to another application. I understand how to actually send the key click, this is not the issue. I need to send the mouse click to the very center of the other application. I can simply test it once and find out the coordinate and send the click to that XY location, but there is an issue... When I move the window, or resize this window the XY coordinates will obviously not be the same. So I need to find out how to get the size of the window, and its

c# wpf overlapping controls not receiving mouse events

僤鯓⒐⒋嵵緔 提交于 2019-12-05 00:16:37
问题 I am building a canvas control. This root canvas has several overlapping children (canvas as well). This is done so each child can handle its own drawing and I can then compose the final result with any combination of children to get the desired behavior. This is working very well as far as rendering is concerned. This does not work so well with mouse events however. The way mouse events works are as follow (using previewmousemove as an example): 1- If root canvas is under mouse, fire event 2

How do I get rid of the mouse cursor in full-screen exclusive mode?

為{幸葍}努か 提交于 2019-12-05 00:10:01
问题 I'm working on a simple 2D game engine in Java, and having no trouble with FSEM, buffer strategies, and so on; my issue is with the mouse cursor. In windowed mode, I can hide the mouse cursor, no problem, by using setCursor() from my JFrame to set a wholly-transparent cursor. However, after a call to device.setFullScreenWindow(this) to go into FSEM, the mouse cursor comes back, and subsequent calls to setCursor() to set it back to my blank cursor have no effect. Calling device

WPF Mousedown => No MouseLeave Event

时光毁灭记忆、已成空白 提交于 2019-12-04 23:52:51
I'm building a Windows Presentation Foundation control with Microsoft Blend. When I leave my control by pressing the left-mouse-button, the MouseLeave-Event is not raised. Why not? This is intended behaviour: When you are doing mousedown on a control and leaving the control, the control STILL retains its "capture" on the mouse, meaning the control won't fire the MouseLeave-Event . The Mouse-Leave Event instead will be fired, once the Mousebutton is released outside of the control. To avoid this, you can simple tell your control NOT to capture the mouse at all: private void ControlMouseDown

C# Winforms - change cursor icon of mouse

故事扮演 提交于 2019-12-04 22:29:08
How to change cursor icon to the 'busy icon' usually shown on the desktop? How can i set Animated files (.gif,.ani) instead of cursor ? CARLOS LOTH Try to do the following: System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; More information is available at Cursors Class documentation Cursor class doesn't support GIF files or animated cursors (.ANI). You can load a custom cursor doing Cursor.Current = new Cursor("C:\\ic.cur"); Maybe you can convert yout GIF file to cursor format using a tool like Microangelo . In addition, there is another thread related to it. How

Curve mouse movement

五迷三道 提交于 2019-12-04 21:03:22
I'm trying to make the mouse cursor move from one point to another. Not in a straight line but in a curve. Here is an illustrative video . Here is code that moves mouse based on the locations: Func smoothmove($coords, $j, $firstms);make mouse move to the note Dim $currcoord[3] Dim $diff[3] Dim $pixelsptms[3] If $j > 1 Then If Mod($coords[$j - 1][7][1], 2) = 0 Then $currcoord[1] = $coords[$j - 1][1][1] $currcoord[2] = $coords[$j - 1][2][1] Else $currcoord[1] = $coords[$j - 1][1][$coords[$j - 1][1][0]] $currcoord[2] = $coords[$j - 1][2][$coords[$j - 1][2][0]] EndIf Else $currcoord[1] =

object picking from small three.js viewport

一笑奈何 提交于 2019-12-04 20:55:51
I can display a full page view of graphical objects with three.js and use mouse click on object to select an object. But if I try to display three.js graphics in a small viewport within an html page I get problems. To compute viewport coordinates of mouse click position from screen coordinates requires me to know value of pixel offsets of the viewport left border and viewport top border. Then I can use a coordinate conversion algorithm such as ( modified from http://stemkoski.github.com/Three.js/Mouse-Tooltip.html ) :- mouse.x = ( (event.clientX - viewport_OffsetLeft_X) / viewport_Width) * 2 -

Windows: send Mouse/Keyboard event to background window?

寵の児 提交于 2019-12-04 19:45:06
My application is a fullscreen window which is rendering a designated other window (from dwm), for example Google Chrome. I would like to know if it's possible to send events (such as mouse keyboard events) to the specified window. Of course the designated window has to stay in background, and my current application on the foreground. My application is written in C++. I'm working on Windows 7/8. AnotherUser Just to put it into an answer. Based on this question Does any program/language/library that interacts with windows do it via the WIN32 API? you should be able to use the windows API to