mouseevent

C# - WPF - Mousemove event on canvas will overload the mouse events so click event is not fired

我的梦境 提交于 2019-12-19 22:12:08
问题 I use Shapes and Canvas, I want to make something like a mapeditor. When the mouse move over the canvas I draw the actually selected object to the canvas at the mouse position on every move, so who use the program can see how it will look like if the object is placed there. And on mouse click I add the current object/position to a list, which contains the placed elements which need to be drawn on the canvas in every update. The problem is if the mouse move handler is active (binded to canvas)

Disable middle mouse click

倾然丶 夕夏残阳落幕 提交于 2019-12-19 10:52:09
问题 I need your help in one question that how to disable the middle mouse click on any link to open a new tab in IE 7,8,9. I have tried many thing like return false; e.cancelBubble = true;e.returnValue = false; But not able to stop that feature of IE to open New tab.But if i am putting alert message e if (event.button == 4) { alert("shashank"); } I am able to stop to open new tab .But I don't want to use alert message. 回答1: You can try with following: $(document).mousedown(function(e){ if(e.which

How to detect the user is using the Trackpad and not the mouse in Java swing?

怎甘沉沦 提交于 2019-12-18 18:58:11
问题 I hava a Java swing application that use a 'pan-able' JComponent to display large data. When the user move the mouse wheel, I listen to these events, and update the content of the JComponent from the scrolled amount. I would like to have a different behavior depending on whether the user is using a classical mouse using a touchpad, as the ones that can be found on modern Mac laptops. How could I detect that the user is using the mouse wheel vs the trackpad to generate the scroll event? I am

Perform a mouse Click event on another Application using C#

久未见 提交于 2019-12-18 18:28:19
问题 what i need to do is that I need to control another application installed on the same machine using my custom application. For example if i needed to use the standard windows calculator I would simply send the input events to the calculator. I have used some code snippets to make this possible and I have now triggered both mouse and keyboard events. but the problem is that i can be sure that the keyboard event will hit the target application because it has the process handle. but i cannot be

as3 mouseEnabled still a problem for me

蹲街弑〆低调 提交于 2019-12-18 15:26:10
问题 A couple years in now, there's still something about mouseEnabled I'm not getting. I have a Sprite (for example here "Sky", that contains many objects, one of them is a Cloud, which I do not want to receive Mouse Events. I overlay this Sky on some other display objects. I want the cloud to be visible, but not to block mouse events. If you see a tree through the clouds you should be able to click on the tree. In the Sky class: mouseEnabled = false; cloud.mouseEnabled = false; cloud

Find control inside Listbox.ItemTemplate (WPF C#)

你离开我真会死。 提交于 2019-12-18 13:39:28
问题 I have some problems finding the right TextBlock control inside a StackPanel . My markup: <ListBox Name="lstTimeline" ItemContainerStyle="{StaticResource TwItemStyle}" MouseDoubleClick="lstTimeline_MouseDoubleClick"> <ListBox.ItemTemplate> <DataTemplate> <DockPanel MaxWidth="{Binding ElementName=lstTimeline, Path=ActualWidth}"> <Border Margin="10" DockPanel.Dock="Left" BorderBrush="White" BorderThickness="1" Height="48" Width="48" HorizontalAlignment="Center"> <Image Source="{Binding

Performing a mouse click without moving cursor

假如想象 提交于 2019-12-18 12:42:43
问题 I couldn't find any solution except moving the cursor by Cursor class, clicking with mouse_event then moving the cursor to its old position. I am playing with SendInput function right now but still no chance for a good solution. Any advice? 回答1: You should use Win32 API. Use pInvoked SendMessage from user32.dll pInvoked Function Then read about mouse events: Mouse Input on msdn And then read about: System events and Mouse Mess....... Also there is lots of info: Info 回答2: Here's an example

identifying double click in java

为君一笑 提交于 2019-12-18 11:40:37
问题 I want to know how can we perform action when mouse is double clicked in a component. 回答1: public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { System.out.println("double clicked"); } } 回答2: Assuming you mean in Swing, assign a MouseListener to your Component: addMouseListener(new MouseAdapter(){ @Override public void mouseClicked(MouseEvent e){ if(e.getClickCount()==2){ // your code here } } }); Reference: Java Tutorial: How to write a Mouse Listener 回答3: The e

Linux, how to capture screen, and simulate mouse movements

谁说我不能喝 提交于 2019-12-18 10:29:43
问题 I need to capture screen (as print screen) in the way so I can access pixel color data, to do some image recognition, after that I will need to generate mouse events on the screen such as left click, drag and drop (moving mouse while button is pressed, and then release it). Once its done, image will be deleted. Note: I need to capture whole screen everything that user can see, and I need to simulate clicks outside window of my program (if it makes any difference) Spec: Linux ubuntu Language:

how to get pygame button to register only one click?

空扰寡人 提交于 2019-12-18 09:41:59
问题 I'm making a game in pygame with a pressable button, but I want it to do only one thing when clicked. The code below prints "button pressed" for as long as you hold it down. What's an elegant way to change this code to make it only print that once per click? import pygame import sys pygame.init() screen = pygame.display.set_mode((640, 480),0,32) clock = pygame.time.Clock() def makeButton(x,y,width,height): if x + width > cur[0] > x and y + height > cur[1] > y: if click == (1,0,0): print