mouse

Which drivers are used by usb mouse in linux kernel?

 ̄綄美尐妖づ 提交于 2019-11-28 19:41:57
I read from LDD3 chapter 14 about hotplug drivers.I need to write a usb mouse driver which load when I plug the hardware. Now, doing some experiment I come to know that there is a driver named "hid-generic" which is called when plug-unplug. [ 6654.232046] usb 3-1: new low-speed USB device number 3 using uhci_hcd [ 6654.462061] usb 3-1: New USB device found, idVendor=093a, idProduct=2510 [ 6654.462067] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 6654.462071] usb 3-1: Product: USB OPTICAL MOUSE [ 6654.462074] usb 3-1: Manufacturer: PIXART [ 6654.489316] input: PIXART USB

How to create MS Paint clone with Python and pygame

偶尔善良 提交于 2019-11-28 18:27:01
As I see it, there are two ways to handle mouse events to draw a picture. The first is to detect when the mouse moves and draw a line to where the mouse is, shown here . However, the problem with this is that with a large brush size, many gaps appear between each "line" that is not straight since it is using the line's stroke size to create thick lines. The other way is to draw circles when the mouse moves as is shown here . The problem with this is that gaps appear between each circle if the mouse moves faster than the computer detects mouse input. Here's a screenshot with my issues with both

How to control mouse movement in linux?

≡放荡痞女 提交于 2019-11-28 18:26:56
I try to control the mouse in Linux. Xlib seems to works, but when I try to use it with OpenCV, it keeps returning: Resource temporarily unavailable So I decide to write "/dev/psaux". The code is as following: #include <unistd.h> #include <string.h> #include <stdio.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int main() { unsigned char a[5]={0, 0xff, 0, 0x28, 0xff}; int fp = open ("/dev/psaux", O_WRONLY); if(!fp)printf("open error:%s\n", strerror(errno)); for(int i = 0; i < 10; i++) printf("write:%d\t\t%s\n", write(fp, a, 5), strerror(errno)); close(fp)

Handle all mouse events in Android

核能气质少年 提交于 2019-11-28 18:24:10
Well, the question is rather simple - how can i handle left/right/middle click, wheel and (!)hover move in android 2/3/4. I've been digging on this topic and found the following in api 14 we can handle almost anything with fancy new MotionEvent we also have Open Accessory that seems to be ok with USB mouse since api 12 (still missing bluetooth) (UPD OA backported to 2.3.4) mouse actually works well on tablets with ICS and Honeycomb and cyanogen 2.3.7, but act like just single touch on every button.I wonder is there a way to intercept mouse messages. Help me please to understand how i can

Copying stuff from vim running in putty

久未见 提交于 2019-11-28 17:56:27
I am running Vim 6.3 through putty and putty connection manager. I have the mouse option set (set mouse = a). I am able to paste things from the (windows) clipboard to vim by but selecting text in vim isn't copying anything to the clipboard. Does anyone know how do I do this? Note: I can't update Vim to a newer version. You can select some text with the mouse and then type: "*y to yank the selected text to the clipboard, then you should be able to use the clipboard content in another application. if "*y is to cumbersome to type, you can put the following in host .vimrc :noremap y "*y Hold down

Control mouse by writing to /dev/input/mice

自古美人都是妖i 提交于 2019-11-28 17:14:42
I am using Ubuntu 12.04. For one of my applications I require to control the mouse in software using a script. I understand that the mouse device is /dev/input/mice . If I do a cat /dev/input/mice and then move my mouse, I see a lot of output being dumped to the screen. Now I wish to remove the mouse, and have a script which writes to /dev/input/mice in order to control the mouse pointer Please help me with commands for the following: (1) Perform a left click (2) Perform a right click (3) Move the mouse from one location to another. Kindly note that I am looking for a shell script solution,

Copying text outside of Vim with set mouse=a enabled

允我心安 提交于 2019-11-28 14:56:56
After enabling set mouse=a , text copied inside of Vim will not paste outside of Vim. Does anybody know of a way to fix this? Here, selecting text with the mouse turns on visual mode and disables the Copy option in the popup menu: François Press shift while selecting with the mouse. This will make mouse selection behave as if mouse=a was not enabled. Note: this trick also applies to "middle button paste": if you want to paste in vim text that was selected outside, press shift while clicking the middle button. Just make sure that insert mode is activated when you do that (you may also want to

How to get Touchscreen to use Mouse Events instead of Touch Events in C# app

时光毁灭记忆、已成空白 提交于 2019-11-28 14:12:24
I have developed a C# app that overrides the PreviewMouseUp, PreviewMouseMove, and PreviewMouseDown events in some custom controls to allow scrolling a scroll viewer by clicking and dragging. This custom code works great on non-touch screens when the mouse is used to drag and scroll, but when I use it on a real touch screen monitor it fails to work because the PreviewMouseUp does not get fired when the monitor is touched and dragged with a finger. I want to be able to use my existing code with minimal changes. This would allow me to use the mouse to click/drag while debugging on my laptop, and

How to Set mouse cursor position to a specified point on screen in C#?

和自甴很熟 提交于 2019-11-28 13:53:27
How to Set mouse cursor position to a specified point on screen in C#? am i must hacke the motherboard buffer that receive the mouse and keyboard coordinates and presses ??? is there another one to do clicks or i am imagine ??? The following will set the mouse position and perform a click: public static void ClickSomePoint() { // Set the cursor position System.Windows.Forms.Cursor.Position = new Point(20, 35); DoClickMouse(0x2); // Left mouse button down DoClickMouse(0x4); // Left mouse button up } static void DoClickMouse(int mouseButton) { var input = new INPUT() { dwType = 0, // Mouse input

Adding a custom cursor in XNA/C#?

浪尽此生 提交于 2019-11-28 13:51:00
I am currently developing a game in XNA. I would like to add a cursor (not the standard Windows one)to the game. I have already added the sprite to my contents folder. I have a method for finding the position of the mouse, but I don't know how I should go about displaying the cursor in the window. Here is the method I am using to find the position of the mouse (I instantiated a "MouseState" class in the beginning of the Game1 class): public int[] getCursorPos() { cursorX = mouseState.X; cursorY = mouseState.Y; int[] mousePos = new int[] {cursorX, cursorY}; return mousePos; } Load a Texture2D