mouseevent

How can I simulate mouse clicks by posting events to the Qt event system?

六月ゝ 毕业季﹏ 提交于 2020-01-15 05:32:47
问题 I would like to do a rudimentary automation test of my Qt application. It records mouse events and writes them to a file (f.e. mousepress(300, 400)). When starting the automation, it reads the coordinates from the file, sends the appropriate mouse events and would do a pixel comparison with a previously saved screenshot. Currently, I have an overlay widget that spans the app and has transparent mouse events. All it does is track the coordinates. When reading the data back in, that overlay

Select Collada objects by mouse Click in Three.JS

北慕城南 提交于 2020-01-15 04:15:10
问题 I need to select Collada objects in Three.JS by mouse click. I know that I can select object based on their id and I saw some samples that user can interact with Geometry defined objects (here). But I need to have access to the objects in Collada format. 回答1: Assuming that dae_scene is a COLLADA scene returned from the ColladaLoader, here's what you can do to check for intersection: var toIntersect = []; THREE.SceneUtils.traverseHierarchy(dae_scene, function (child) { if (child instanceof

Angular - How do I parse the objects in inside event.path

微笑、不失礼 提交于 2020-01-14 19:39:07
问题 Now this is a complicated issue to explain, I will try my best. I have a popover from which I want to uniquely identify a click event if it is from inside or outside the popover. My first approach: I enveloped the entire popover with a div with an id , say "unique". So, I bound the click event with a host listener for which I will get an event object. So, if I traverse the event.path --- this contains an array of objects --- inside one of the indexes of these objects lies a field id , which

Python OpenCV: mouse callback for drawing rectangle

淺唱寂寞╮ 提交于 2020-01-14 18:43:50
问题 I want to save an image from the video stream and then draw a rectangle onto the shown image to produce a region of interest. Later, save that ROI in a file. I used opencv python grabcut example to use the setMouseCallback function. But I don't know what I'm doing incorrect as it is not giving the result I expect. I would like to see the green rectangle drawn on the static image shown in mouse input window and the roi being saved to file. Please help debug this code or show a better approach:

Using Java, How to detect keypresses without using GUI components?

 ̄綄美尐妖づ 提交于 2020-01-14 17:51:27
问题 Using Java, is it possible to detect user actions, such as key-presses, mouse-button-presses, and/or mouse's screen location, without the use of GUI elements? If it is, how could I implement it? Otherwise, what are the alternatives? The only StackOverflow source i found on this matter is this question, which is unanswered. And the only sources I found outside StackOverflow on this matter point to an "Invisible GUI" solution, wish is something i really want to avoid. 回答1: It can be implemented

How to get mouse events from outside of program window

瘦欲@ 提交于 2020-01-13 19:16:12
问题 I want to drag this character. Image : so i use this method to get mouse position: WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { ... switch (message){ case WM_LBUTTONDOWN: case WM_MOUSEMOVE: GetCursorPos(&mousePosition); break; } ... } The program seems to be running well, but if the mouse is out of the characters location, it wouldn't follow the mouse cursor anymore. How can I fix this problem? 回答1: See SetCapture on MSDN: Sets the mouse capture to the specified window

MouseEvent movementX property apparently not supported in internet explorer

梦想与她 提交于 2020-01-13 13:53:33
问题 I am developing an application that needs to be compatible on IE 9 and above. I am using the movementX property on a MouseEvent object, however this same MouseEvent object does not have the movementX property in Internet Explorer (9 or 11). I ran through Microsoft's documentation and indeed they claim to support this property on their MouseEvent objects. I have verified this is in fact a MouseEvent object, and it simply doesn't have the property. All the other properties appear to be

MouseEvent movementX property apparently not supported in internet explorer

牧云@^-^@ 提交于 2020-01-13 13:53:17
问题 I am developing an application that needs to be compatible on IE 9 and above. I am using the movementX property on a MouseEvent object, however this same MouseEvent object does not have the movementX property in Internet Explorer (9 or 11). I ran through Microsoft's documentation and indeed they claim to support this property on their MouseEvent objects. I have verified this is in fact a MouseEvent object, and it simply doesn't have the property. All the other properties appear to be

Label not showing on mouse event JavaFx

半腔热情 提交于 2020-01-13 13:05:31
问题 I have a pie chart where i have added a mouse listener using this guide: Oracle guide to pie chart However when i run my program and click on the chart it doesnt do anything. I have tried to System.out.println(caption.getText()); and the text of the label is correct however the label is just not showing up. My code is as following: public void start(Stage stage) { Scene scene = new Scene(new Group()); stage.setTitle("Imported Fruits"); stage.setWidth(500); stage.setHeight(500); ObservableList

WPF: Image click event

巧了我就是萌 提交于 2020-01-12 08:49:52
问题 I can find only MouseDown Event and MouseUp Event on a image in WPF. This causes some problem if I do MouseDown on some Image, Move the mouse and MouseUp event happens on some other image. Is there any other event that I can use to solve this problem. like MouseClick Event for Button element. 回答1: If you really must use an image then there's a couple of things you can do to check for a "click". Check the time between the two events. If it's less than your threshold, then treat the mouse up as