mouse

C# - Moving a control to the mouse's position

人走茶凉 提交于 2019-12-07 14:27:02
问题 I am trying to get a control to follow the cursor when the user clicks and drag the control. The problem is that 1.) the control doesn't go to the mouse's position, and 2.) the control flickers and flies all over the place. I've tried a few different methods of doing this, but all so far have failed. I've tried: protected override void OnMouseDown(MouseEventArgs e) { while (e.Button == System.Windows.Forms.MouseButtons.Left) { this.Location = e.Location; } } and protected override void

Ogre3D, Multiple Monitors, and the Mouse Cursor

柔情痞子 提交于 2019-12-07 11:26:55
问题 I am developing an application that requires multihead rendering in OpenGL. Right now, I can render to multiple screens, but the travel of my mouse cursor is limited to a single screen. However, I'd like to be able to use the mouse cursor on all of the rendered screens. Has anyone run into this same issue, and if so, how did you go about resolving it? 回答1: I found a working solution for this. First, I had to instantiate my Ogre::RenderWindow objects in windowed mode rather than full-screen

Windows virtual mouse driver

五迷三道 提交于 2019-12-07 10:23:23
问题 I am developing a KMDF virtual mouse driver. The general idea is a KMDF root enumerated non-filter driver which will be able to send output reports to the mouse and keyboard driver stacks. My driver is already working and sending requests to other driver stacks, but with no result. Report types and packet formats are pretty undocumented on Microsoft resources. There are no information about which data and to which device I need to send in order to move the mouse pointer, simulate clicks (with

How to using mouse to change size of grid layout cells using Qt?

帅比萌擦擦* 提交于 2019-12-07 10:15:57
问题 I use grid layout (horizontal and vertical too). I like the fact that when resizing the window fills the entire window contents. but this extension is poorly managed. I often want to change the size of only one column in grid layout without changing the size of the window. such as in Windows Explorer. there are two columns - the left list of directories and their contents to the left to the right. and i can always press mouse button therebetween and pulling change the mutual sizes of columns

JS special mouse buttons

帅比萌擦擦* 提交于 2019-12-07 10:01:38
问题 My mouse has two buttons on the side, whose default behaviour are "Back" and "Forward". What I'd like to know is whether or not it's possible to detect clicks of these mouse buttons in JavaScript, or if these are "special" buttons akin to the keyboard's "Play", "Volume Up" and "Wireless on/off" buttons. 回答1: I am not aware of any specific mouse events. You can, however, easily find out yourself by inspecting the event object of the mousedown event. Fullscreen fiddle: http://jsfiddle.net/dWfDL

Pop-up menu using mouse rightclick in JUNG

时光总嘲笑我的痴心妄想 提交于 2019-12-07 07:36:15
问题 I want to create a pop-up menu, which will appear if i right clicked on the canvas . How can I do this? which function should i modify? Any help would be appreciated. 回答1: Following code will create a popup menu when right-clicking either on the vertex or on the canvas... /** * a GraphMousePlugin that offers popup * menu support */ protected class PopupGraphMousePlugin extends AbstractPopupGraphMousePlugin implements MouseListener { public PopupGraphMousePlugin() { this(MouseEvent.BUTTON3

How to detect mouse and keyboard inactivity in linux

二次信任 提交于 2019-12-07 07:32:50
问题 I am developing an app on python which will check for user inactivity. Is there a way to check for key press and mouse move events in linux? 回答1: You could monitor the /dev/input/* files, when a key is pressed/the mouse is moved it is written to one of those files. Try this for example: fh = file('/dev/input/mice') while True: fh.read(3) print 'Mouse moved!' Now that I think of it, it might be better to use something like xidle to detect inactivity. 来源: https://stackoverflow.com/questions

Sending a Mouse Click to a Specific Position without Moving the Mouse

不打扰是莪最后的温柔 提交于 2019-12-07 07:10:24
问题 I'm looking to send a mouse click to a specific position on a screen without affecting the mouse cursor's location. I've scoured and have tried everything under the sun with mouse_event (which is supposed to do this) mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0); However this ends up only sending a mouse click to wherever the position of the mouse is. So I end up having to move the mouse to get it to work. Cursor.Position = new Point(X, Y); Anyone have any idea how I can

Letting the mouse pass through Windows C++

為{幸葍}努か 提交于 2019-12-07 05:53:55
问题 I am working on an Win32 C++ application where I want to ignore the mouse events and let is pass through to the window beneath my window. Basically the window below mine will handle the mouse event. I would prefer not to send the mouse message using SendMessage to the window beneath mine or use SetCapture. Is there a way basically to ignore the mouse event and let it pass through with Windows APIs or with styles? Note that my window is not transparent. Thanks in advance for the help. 回答1: So

Check if Mouse LButton is down?

我的未来我决定 提交于 2019-12-07 05:30:46
问题 How do I check if the Left button of my mouse is currently pressed down/dragging something(I preffer the first possibility). I tried Mouse.IsDraging,but no result. NOTE: I handle mouse messages in my application so its no problem if its a WM,just share a way to accomplish my task. 回答1: There is a Windows API function GetAsyncKeyState(), which despite its name is also usable to get the state of the mouse buttons. The linked documentation directly contains the answer to your question: The