mouse

2 Mice, capturing exclusively one mouse on windows (DirectInput, DDK, Linux, anything)

醉酒当歌 提交于 2019-12-11 09:08:43
问题 I have connected 2 mice to PC and I wish one mouse to work as regular mouse and capture second mouse exclusively. First I was trying DirectInput. It showed 2 devices with word mouse in InstanceName. But only one device had DeviceType.Mouse and it was only really working device. When I was acquiring it was blocking both mice. Second I decided to create driver. I downloaded WinDDK. There is Mouse Filter driver sample. I was able to compile it. But I am not driver programmer. It is complex for

directx mouse click simulation

独自空忆成欢 提交于 2019-12-11 07:49:36
问题 How can I simulate the mouse click in a directx application? mouse_event and PostMessage with WM_LBUTTONDOWN don't work... so it must be something to do with the DirectInput I haven't found out nothing useful with google, so you may be knowing the answer... thanks in advance //update I wrote the text wrongly, what I want is to make the directx app believe that the mouse has just clicked, but without effectively using the mouse and without using SendInput or mouse_event, which need that the

Jquery slider that slides while mouse move

社会主义新天地 提交于 2019-12-11 07:13:12
问题 I'm looking for a jquery slider script that is able to right-left slide while I'm moving my mouse. Anyone knows that kind of script? I want to achieve an effect like this one but it should be scrolled horizontal, not vertical. 回答1: Do you mean something like this. It's a very basic thing that uses the jQuery UI Slider. I attach a handler to the mousemove event that just calculates what the value should be for the slider (based on the value of the mouse coordinates). $(function() { var range =

In XUL or JavaScript, is there a way to move the mouse cursor to specified position?

故事扮演 提交于 2019-12-11 06:36:32
问题 In XUL or JavaScript, is there a way to move the mouse cursor to specified position? 回答1: The only time that Gecko moves the mouse is on Windows for the snap-to-default-button effect. This is used by XUL dialogs and wizards. The backend code doesn't actually check that you're giving it a button; any XUL control works. The mouse is moved to the centre of the element, if that point is on-screen, and the window is active. Normally the code checks that the system cursor snapping is enabled, but

Determine mouse button release in LWJGL

只谈情不闲聊 提交于 2019-12-11 06:31:41
问题 I have a program in LWJGL where I have a series of buttons. I'm trying to use Mouse.getEventButton() and Mouse.getEventButtonState() in order to figure out when the mouse is released , but neither seem to be working. After adding a few print statements for debugging, it seems that getEventButton() always returns 0 regardless of what the mouse is doing, and getEventButtonState() always returns false. All other mouse methods I've used so far have behaved normally. Any idea what might be going

Not drawing at desired position in “Processing”

此生再无相见时 提交于 2019-12-11 06:07:53
问题 I am trying to draw at one place by dragging a mouse (for example, a circle in left upper quadrant) and have the figure appear at 4 places around center of canvas (including one right under the mouse cursor). I have tried following code: int x=0; int y=0; void setup(){ size(400, 400); background(255); translate(width/2, height/2); } void draw() { } void mouseDragged(){ translate(width/2, height/2); for(int i=0; i<4; i++){ rotate(PI/2); x= mouseX ; y=mouseY; line(x, y, mouseX, mouseY); } }

Not drawing under the mouse in “Processing”

我们两清 提交于 2019-12-11 05:46:14
问题 I want to draw at one place by dragging the mouse and have the line drawn at 3 places around the center of canvas, including one under the cursor itself. I am using following code which does draw 3 lines but none of them is under the mouse cursor: void setup(){ size(300, 300); } void draw() { translate(width/2, height/2); if(mousePressed) for(int i=0; i<3; i++){ line(width/2 -mouseX, height/2 -mouseY, width/2 -pmouseX, height/2 -pmouseY); rotate(2*PI/3); }} How can I correct this code so that

How to tell if mouse pointer icon changed

可紊 提交于 2019-12-11 05:43:03
问题 I'm writing a screen recording app for Windows in Delphi 7 and wish to know when the mouse pointer changes in my app (like from a normal pointer to a resize pointer, etc). Currently what I'm doing is painting the mouse pointer onto an in-memory bitmap everytime the mouse moves (and on a timer) and doing a pixel by pixel comparison of it with the last bitmap I painted. Though the comparision is fairly quick (about 2-5ms) because it's happening so often (every mouse move) it adds up. I figure

SDL mouse events are not being handled quick enough

若如初见. 提交于 2019-12-11 05:38:43
问题 I've been playing around with SDL for a few days now, and while I think I got the hang of it, I've run into a small problem with the menu. More specifically, the buttons in the menu. They work flawlessly when the mouse isn't moving that fast, but when I speed it up a bit (moving the cursor between the buttons, constantly making the button redraw from "normal" sprite to "mouse-over sprite"), it lags behind, sometimes doesn't update at all and small bugs start appearing. This is all my code

Adding sound on clicking a image in HTML 5

守給你的承諾、 提交于 2019-12-11 05:28:23
问题 I have a image on my html page and i want it to play a sound effect when i click on it. Here's the image code: <img src="images/button1.png" width="32" height="32" onclick="alert();"> I want to change the alert box into the sound effect that i load in. How do i do it? 回答1: Use SoundManager and will free up from a lot of headaches. Even more it will fallback nicely to flash if audio is not supported natively by browser. However if you don't want to relay on a third party library there is