mouse

How to scroll WPF ScrollViewer's content to specific location

若如初见. 提交于 2019-11-29 05:35:40
I am writing my custom WPF ItemsControl to display a list of item. The items are shown embedded inside a ScrollViewer: <Style TargetType="MyCustomItemsControl"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="MyCustomItemsControl"> <ScrollViewer x:Name="PART_MyScrollViewer" > <ItemsPresenter/> </ScrollViewer> </ControlTemplate> </Setter.Value> </Setter> </Style> I want to make sure that when I move the mouse into the control, a particular item (marked as selected) will be scrolled into the mouse position. In my OnMouseEnter method I am able to find the item but I don't

How do I change the style of the cursor with JQuery?

做~自己de王妃 提交于 2019-11-29 05:28:17
I want to change the style of the cursor as if it were going over a link. How do I do this? Modify the CSS cursor value by using the css() method $('#selector').css('cursor', 'pointer'); Demo : http://jsfiddle.net/jomanlk/H6Nta/ you can play around with this $('#divid').css('cursor','default'); for pointer $('#divid').css('cursor','pointer'); api http://api.jquery.com/css/ using css http://www.echoecho.com/csscursors.htm read here for different cursor styles and apply it $('#selector').css('cursor', 'value'); Cursors are handled by CSS. You need something like $('#elementid').css('cursor',

Detect both left and right mouse click at the same time?

♀尐吖头ヾ 提交于 2019-11-29 04:44:19
I'm remaking windows Minesweeper (from XP) and something they had included was that if you click a number with as many flags as it's number with the left and right mouse button at the same time, it reveals every other hidden tile around that number. I'm having a hard time telling when both the Left and Right mouse buttons are pressed at the exact same time... I'm using a pair of bools, one for each button with the OnMouseDown and OnMouseUp events but if the 2 buttons are clicked at the exact same time (or really close), then only one MouseDown event goes off and the other does not... If you

How to read low level mouse click position in linux .

允我心安 提交于 2019-11-29 02:49:05
问题 I am using this code to read mouse events from the dev/input/event* in linux . #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <linux/input.h> #include <fcntl.h> #define MOUSEFILE "/dev/input/event4" int main() { int fd; struct input_event ie; if((fd = open(MOUSEFILE, O_RDONLY)) == -1) { perror("opening device"); exit(EXIT_FAILURE); } while(read(fd, &ie, sizeof(struct input_event))) { printf("time %ld.%06ld\ttype %d\tcode %d\tvalue %d\n", ie.time.tv_sec, ie.time.tv_usec,

Emacs, unicode, xterm mouse escape sequences, and wide terminals

杀马特。学长 韩版系。学妹 提交于 2019-11-29 02:46:34
问题 Short version: When using emacs' xterm-mouse-mode, Somebody (emacs? bash? xterm?) intercepts xterm's control sequences and replaces them with \0. This is a pain on wide monitors because only the first 223 columns have mouse. What is the culprit, and how can I work around it? From what I can tell this has something to do with Unicode/UTF-8 support, because it wasn't a problem 5-6 years ago when I last had a big monitor. Gory details follow... Thanks! Emacs xterm-mouse-mode has a well-known

Create a fully transparent WPF window to capture mouse events

别等时光非礼了梦想. 提交于 2019-11-29 02:41:05
问题 I'm trying to trap mouse events in WPF by using a topmost, transparent non-modal window. I'm finding that this works fine if the opacity of the window is 0.01 or greater and it has a background color, but when the opacity is set to 0 it no longer receives mouse messages. Is there a way make this window look fully transparent and still get mouse input? 回答1: As far as I know, no. When a Control or Window is fully transparent, it can then be clicked through. This is the case if you set your

Capture and send keyboard / mouse input in C#

限于喜欢 提交于 2019-11-29 02:35:46
I am looking for a way to send and receive keyboard information regardless of what app has focus. I remember back in College seeing a presentation about an old Windows API that let you change the cursor position and send right clicks and such. Besides User32.dll is there a way to do this with the .net framework? AFAIK, there's no way to capture the GLOBAL keyboard & mouse events. But there are a few articles on CodeProject which demonstrate the creation of .NET class wrappers for the same. You can check them out here: 1) Processing Global Mouse and Keyboard Hooks in C# 2) Global Mouse and

jquery: get mouse click if inside a div or not

和自甴很熟 提交于 2019-11-29 02:29:32
问题 i have this HTML page <html> <body> <div>a</div> <div>b</div> <div>c</div> <div>d</div> <div id='in_or_out'>e</div> <div>f</div> </body> </html> a,b,c,d,e and f could be divs also not just a plain text. I want to get the mouse click event, but how could i know if it's inside or outside #in_or_out div ? EDIT :: guys, i know how to check if the div is click or not, but i want my event to be fired when the click is outside that div 回答1: $("body > div").click(function() { if ($(this).attr("id") =

Programmatically click and move mouse with VB.NET

徘徊边缘 提交于 2019-11-29 02:28:34
I want to build a program in VB .net that will allow me to control my pc with my laptop. The only question I really have is, how can I programmatically click without using some kind of click event, say if I want to click the start orb and my mouse is at that exact location, I'd like a sub or something that will click on it. Right now I only know how to click within the form. Thanks You can set the Cursor position with the property Cursor.Position . You will need to P/Invoke mouse_event in user32.dll in order to simulate the mouse click. Sample code in C# is here: http://www.gamedev.net

How to disable mouse right click on a web page? [duplicate]

爷,独闯天下 提交于 2019-11-29 02:11:06
问题 This question already has an answer here: How do I disable right click on my web page? 23 answers I want to disable mouse right click on an HTML page. I have a page where user has to enter the details. I don't want the user to see the menu thats get displayed with the mouse right click. Rather I want to display a custom menu. I know there are some plugins available to do that. But my requirement does not need any plugins. 回答1: It's unprofessional, anyway this will work with javascript enabled