mouse

Best practices for creating both mouse and touch-oriented WPF application [closed]

為{幸葍}努か 提交于 2019-12-06 07:49:06
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . There is a need to develop WPF application which will support both mouse and touch input. I'm looking for an approach that will enable maintaining single codebase and minimize pain to implement that. Some framework or build configuration

Getting mouse cursor position and button state on Windows

孤人 提交于 2019-12-06 07:16:11
What is the most appropriate way of getting the mouse cursor position or button state on Windows (Windows 7 and above)? I previously used DirectInput, but I am not longer using it and do not wish to. I saw there is GetCursorPos, however, I do not see anything for getting mouse button states. I have read previously that just reading the window messages (such as WM_LBUTTONUP) was considered "slow" for real time applications, so I do not know of any other option. If you want to poll/query the current cursor position, you can use GetCursorPos . To see the button states, use GetAsyncKeyState . If

Java Robot mouse move: setting speed?

泄露秘密 提交于 2019-12-06 06:43:59
问题 The Java Robot class allows one to move the mouse as if the actual physical mouse was moved. However, how does one move the mouse from Point1 to Point2 in a humane (and thus not instant) manner? Aka, how does one set the speed of movement? If no such speed is possible with the Robot class, thus if the mouse can only be moved instantenously, what kind of "algorithm" should be used to mimic a human's mouse movement? Should it move the mouse pixel by pixel with a certain incrementing speed? 回答1:

Can't see mouse and keyboard device with usbManager android

試著忘記壹切 提交于 2019-12-06 06:37:34
I work on a project where I need get data of keyboard and mouse on a service. I also have to be able to send data to my device hid. To do this, I want use the usb host mode. When I get list of device, I can see a mass storage but no mouse and keyboard. After search, I have seen that usbManager don't return mouse and keyboard device. I have tried to change permissions (on /system/etc/permissions) whitout success). I have run the application USB Device Info and I see mouse and keyboard on linux device and not on android devices. I use android 4.2.2. Is it possible to get hid data of mouse (and

How to make a control “transparent” for the mouse or Route MouseMove event to parent?

谁都会走 提交于 2019-12-06 06:35:17
I want to create a card playing game. I the use mousemove event to drag cards through the window. The problem is if I move the mouse over another card, it is stuck because the card underneath the mouse cursor gets the mouse events, so that the MouseMove event of the window isn't fired. This is what I do: private void RommeeGUI_MouseMove(object sender, MouseEventArgs e) { if (handkarte != null) { handkarte.Location = this.PointToClient(Cursor.Position); } } I tried the following, but there was no difference: SetStyle(ControlStyles.UserMouse,true); SetStyle(ControlStyles.EnableNotifyMessage,

smooth scroll with mousewheel to next or previous div

自作多情 提交于 2019-12-06 06:04:38
问题 I'm trying to get a javascript on my site so when a person scrolls on the website, it automatically scrolls to the next or previous Div with a certain class. I'm working with smoothscroll and scrollto. I also found two codes that I'm trying to combine. But I don't seem to understand the whole scripts... The first script is from http://webdesignerwall.com/tutorials/scrollto-posts-with-jquery. This script makes it possible to navigate between DIV's (with a certain class) by pressing next or

How to trigger a mouseDown:(NSEvent *) programmatically (without using the mouse)?

不想你离开。 提交于 2019-12-06 04:38:41
I am developing a Leap Motion Application where I already move the cursor with it, but I don't know how I can trigger a mouseDown:(NSEvent *) programmatically. This worked well for me in Cocoa Mac : void PostMouseEvent(CGMouseButton button, CGEventType type, const CGPoint point) { CGEventRef theEvent = CGEventCreateMouseEvent(NULL, type, point, button); CGEventSetType(theEvent, type); CGEventPost(kCGHIDEventTap, theEvent); CFRelease(theEvent); } Use this link to find out about the parameters: https://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef

How can you track mouse input using the fewest libraries in c

北战南征 提交于 2019-12-06 04:21:49
问题 I'm not sure where to look to find this information, but I'd like to know how to get mouse input (or any hid input) using the fewest non standard libraries in c. Basically, is there an stdio equivalent for mouse (and other input) input in c? Or is there a library that is minimal and cross compatible on multiple platforms. Just being able to print mouse coordinates to a terminal window would be enough. 回答1: Here is a 0 non-standard library approach. Runs wherever /dev/input/event# exists.

Using Linux virtual mouse driver

匆匆过客 提交于 2019-12-06 04:10:21
问题 I am trying to implement a virtual mouse driver according to the Essential Linux device Drivers book. There is a user space application, which generates coordinates as well as a kernel module. See: Virtual mouse driver and userspace application code and also a step by step on how to use this driver. 1.) I compile the code of the user space application and driver. 2.) Next i checked dmesg output and have, input: Unspecified device as /class/input/input32 Virtual Mouse Driver Initialized 3.)

How can I change the position of the mouse cursor in OpenGL/Glut?

流过昼夜 提交于 2019-12-06 03:58:17
问题 I'm writing a simple game and I'm going to have the mouse control the camera (using GlutPassiveMotionFunc). I'm going to pitch and yaw based off the mouse difference between callbacks, however I think it would be a good idea to "force" the mouse back to the center of the screen every time they tried to move it. This way their cursor won't be at the edge of the screen and they can't move any further in that direction. What Glut / OpenGL command can I use to force the position of the mouse to