mouse

Mouse left button up event and openfiledialog

孤人 提交于 2019-12-22 09:49:30
问题 I have few images in a grid, then when i click a button, a "open file dialog" comes up.(of course, over the images) Microsoft.Win32.OpenFileDialog dlgOpenFiles = new Microsoft.Win32.OpenFileDialog(); dlgOpenFile.DoModal(); The images have a LeftButtonUp event attached. The problem is that if i select a file by double clicking it, the open file dialog closes(which is good), but besides that, the image behind the clicked file is receiving a LeftButtonUp message which is not good at all. I am

Monitor mouse coordinates in real-time in Linux

旧城冷巷雨未停 提交于 2019-12-22 09:38:45
问题 I need a python coding to monitor mouse coordinates in real-time in Linux. I found below coding and it works well, but the mouse coordinates information will be shown in a pops up GUI window. Now I don't need it show in a GUI window, just need save the mouse coordinates information to a text file(Log file). Does anyone can help me that? Thanks! Plus, it would be great if it can save mouse coordinates information by hourly. #!/usr/bin/env python """ Corrected, the thread stops now. """ import

Firemonkey MouseToCell equivalent

与世无争的帅哥 提交于 2019-12-22 08:08:16
问题 In Delphi VCL if I wanted to see which cell (column and row) of a TStringGrid my mouse was hovering over I'd use MouseToCell. This method is no longer in Delphi (XE2) for FireMonkey apps. Does anyone know how I can determine the cell my mouse is over? OnMouseMove has X & Y values but these are screen coordinates and not cell coordinates. Many thanks. 回答1: There's actually a MouseToCell method in TCustomGrid , which the StringGrid descends, but it's private. Looking at its source, it makes use

Call to TMouse.GetCursorPos sometimes fails with “A call to an OS function failed”

我的梦境 提交于 2019-12-22 05:57:30
问题 On occasion my application gets the error below. Normally this happens when the user steps away from their desk leaving my program open. When they come back this error has appeared. TMouse.GetCursorPostion does not do anything except make the Windows API call to GetCursorPosition. Then it checks the return value and calls GetLastError if it failed. "A call to an OS function failed" is not very helpful in tracking down the cause of this. Could a screen saver or sleep mode be kicking in causing

Calculate correct cursor position with pan and zoom

不打扰是莪最后的温柔 提交于 2019-12-21 23:14:30
问题 I've been messing around with this problem for about an hour now. I have a viewport which supports panning and zooming, the panning is handled by storing an offset for the X and Y axis. The zoom is just a float going from 0.2 to 14. My problem is that I need to be able to place stuff where the user clicks in the viewport but when I zoom and pan the mouse coordinates are not correct. I haven't been able to figure out how to properly calculate the mouse coordinates. Here's an image showing what

can't get the mouse move event from /dev/input/event*

旧巷老猫 提交于 2019-12-21 16:37:23
问题 I can't get the mouse move event when using the evtest tools to test the input events . I just get three mouse events: left click event: type = EV_KEY, code = 272 (LeftBtn), value=1/0 right click event: type = EV_KEY, code = 273 (RightBtn), value = 1/0 mouse wheel event: type = EV_REL, code = 8 (Wheel), value = -1 No mouse move event . So where my mouse move event and how to capture it? ps: Tested on Ubuntu 11.04 and Gentoo in VirtualBox-4 with virtualBox-addition installed. 回答1: If not on an

Apple Events to Control Mouse Remotely

你。 提交于 2019-12-21 12:44:14
问题 I'm not even sure where to begin with this question... I want to be able to send mouse-click events to another machine, as if the user had clicked on that machine. I can do it on the same machine via: CGEventSourceRef source = CGEventSourceCreate(NULL); CGEventType eventType = kCGEventLeftMouseDragged; CGPoint mouseCursorPosition; mouseCursorPosition.x = point.x; mouseCursorPosition.y = point.y; CGMouseButton mouseButton = kCGMouseButtonLeft; CGEventRef mouseEvent = CGEventCreateMouseEvent (

generating a MouseEvent in JavaFX

霸气de小男生 提交于 2019-12-21 11:02:44
问题 I'm in need of simulating a MouseEvent.MOUSE_CLICKED . I want to use the fireEvent method of a particular Node in order to dispatch an event of the aforementioned type. However, I am struggling with generating one. It appears that javafx.scene.input.MouseEvent has no valid constructor, but old java.awt.event.MouseEvent objects can be instantiated this way. Still, I haven't found any working solution for conversion. How do I go around this? Thanks. 回答1: You can generate a MouseEvent using the

When a mousedown and mouseup event don't equal a click

筅森魡賤 提交于 2019-12-21 09:17:45
问题 I've been using some buttons for a while now that have a depressed effect as they are clicked using position relative and a top: 1px in the :active pseudo-class. I had problems with click events not firing and it turned out to be due to the mousedown and mouseup events not firing on the same element. I did a bit of fiddling to make sure the inner-most element covered the whole button and discovered that the issue remained. If I click right at the top of the text then the link jumps down

How to perform a Virtual Mouse click C# without using a mouse

自作多情 提交于 2019-12-21 05:42:10
问题 I'd like to perform a click in a windows application, without using the real mouse (so I can minimize it). Much like a bot would behave. How would I do this? 回答1: I think the function you're looking for is PostMessage [DllImport("user32.dll", SetLastError = true)] public static extern bool PostMessage(int hWnd, uint Msg, int wParam, int lParam); You can read more about it here on codeproject, and download a demo project, which sends keystrokes. This method posts messages directly on the input