mouse

How to record mouse and keyboard movement simultaneously with Python?

 ̄綄美尐妖づ 提交于 2019-12-24 16:08:52
问题 I want to create a function that records both mouse and keyboard events until a specific key is pressed and then replays them together. I think that this can be achieved with the keyboard and mouse modules. In an earlier question, I asked how to record the mouse movement until a key is pressed, and I got the following code: import mouse import keyboard events = [] #This is the list where all the events will be stored mouse.hook(events.append) #starting the mouse recording keyboard.wait("a")

How to simulate mouse click in a Directx game

早过忘川 提交于 2019-12-24 13:26:23
问题 I have a game written in Directx (not mine it's mmo game). The game window isn't active (not minimized, just it's behind other windows but if is possible it can be minimized also). I want to simulate mouse click on x, y position. Spy++ doesn't show anything in message when i'm clicking in game. For now i did just that: private void start_Click(object sender, EventArgs e) { IntPtr ActualWindow = GetActiveWindow(); ShowWindow(hWnd, ShowWindowCommands.Restore); //show game window Thread.Sleep(50

How can the mouse be moved programatically in Common Lisp?

送分小仙女□ 提交于 2019-12-24 12:25:55
问题 The code should run on Windows 10. I tried asking on Reddit, but the ideas are Unix/Linux only. There's also CFFI, but I didn't understand how to use it for this problem (the main usability part of the documentation I found is just an elaborate example not related to this problem). I also looked through the SetCursorPos of Python, and found that it calls ctypes.windll.user32.SetCursorPos(x, y), but I have no clue what that would look like in CL. And finally, there's CommonQt, but while there

How do I create/handle IsMouseOverChanged

僤鯓⒐⒋嵵緔 提交于 2019-12-24 11:15:56
问题 I like the functionality of IsMouseDirectlyOverChanged, but it only works for the topmost elements. What I really want to do is monitor the IsMouseOver property of a control, regardless of its z-index, and receive notification when IsMouseOver is modified. If I owned this property, I could do INotifyPropertyChanged, but unfortunately it's owned by UIElement. Still learning the ropes of WPF, so maybe this is easy, but I'm not familiar with how to monitor properties that belong to parent

Using SendMessage for Simulating User Mouse Clicks

家住魔仙堡 提交于 2019-12-24 11:06:05
问题 I need to use SendMessage fro simulating user clicks in a target program as SendMessage blocks until the event that it triggers is finished processing. The reason for this is that this blocking gives opportunity to detect if any dialogs have opened up as a result of the clicking. My problem currently is that although I can get the click to work using WM_LBUTTONDOWN and WM_LBUTTONUP messages consecutivly on a button in a mocked up form which opens a model dialog, I cannot get it to work on

VC# Multiple Mouse

吃可爱长大的小学妹 提交于 2019-12-24 08:23:19
问题 How can i seperately get x,y coordinates and events of multiple mouse attached to the system and identify the mouse uniquely in winforms. What about muliple keyboards as well NOTE: i am not taking about multiple cursors... all i am taking about is some hook which tells me that i have mouse 1 & moise 2 attached to the system and will be able to tell mouse 1 changed its position (x,y) to (x-1,y+1) and mouse 2 changed position (x,y) to (x,y-1) 回答1: Try the Microsoft MultiPoint SDK which allows

Java Mouse Listener

别等时光非礼了梦想. 提交于 2019-12-24 07:05:11
问题 This probably sounds simple and stupid, but for the life of me I cannot find a way to have a mouse listener which does mousePressed without having to be on a component. void mousePressed(){} doesn't seem to work the way I want it to. Essentially I am making a java program which aims to work without graphics, and does things in the background. So if you click in chrome for example it still will effect the program. What I was trying was this, which I realize is horribly incorrect. class

Locking mouse pointer using xGrabPointer in Linux

允我心安 提交于 2019-12-24 06:45:08
问题 I am using X11 to get mouse position when the mouse button is pressed in a application which runs on terminal without any window. Getting Mouse Position : Display *dpy; Window root, child; int rootX, rootY, winX, winY; unsigned int mask; dpy = XOpenDisplay(NULL); XQueryPointer(dpy,DefaultRootWindow(dpy),&root,&child, &rootX,&rootY,&winX,&winY,&mask); Now I want to use XGrabPointer() to lock the mouse so that it does not interact with objects(windows , icons and docks ) present on desktop .

Hide mouse cursor in OpenCV

試著忘記壹切 提交于 2019-12-24 02:07:46
问题 I need to hide the cross-shaped cursor that OpenCV shows when moving the mouse over an image window. Does anybody know if it is possible? I wanted to add a screenshot, but unfortunately the mouse cursor is not shown in screenshots. Thanks! 回答1: I don't think it's possible with only OpenCV, you have to use OS API or eventually you may use QT(http://www.codeprogress.com/cpp/libraries/qt/QtHideMouseCursor.php#.UjGpZD-rGoE) - it's quite easy to use it with OpenCV. 来源: https://stackoverflow.com

How to interrupt a Hover's handlerOut

橙三吉。 提交于 2019-12-24 01:57:18
问题 I have the following situation: I have an object, lets call it "Button". When you mouese over Button it make another object "Info" slide down. Of course, when your mouse leaves Button, Info slides up and dissapear. But, Info has a link and the user might want to click it. I can delay the Info's slide up but I can't stop it after I reach Info. This is the code I'm using. $("#button").hover(function(){ $("#info").slideDown("fast"); }, function(){ //the handlerOut $("#info").delay(1000).slideUp(