mouseevent

Mouse movement for session timeout in GWT

假如想象 提交于 2019-12-06 07:25:21
I'm working on GWT. In my application I want to add a session time out after 2 minutes when no action is performed (including mouse events). I wrote a class in which I used a GWT session object. public static boolean ValidSession(HttpSession session) { boolean aResult = true; logger.debug("Start of ValidSession"); try { if(session!=null ) { String strUserInf=""; strUserInf=(String)session.getAttribute("userInf"); logger.debug("User Inf in session is: " + strUserInf); if(strUserInf==null || strUserInf.trim().equals("")) { logger.debug("User Info blank"); aResult =false; } } else { logger.debug(

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

NSButton image shadow on mouseEntered event

牧云@^-^@ 提交于 2019-12-06 07:12:35
I have a borderless NSButton that contains an image and is subclassed with my ButtonEffect class to detect mouseEntered and mouseExited events. My goal is to have just the edge of the image glow as the mouse enters the button area. I know I can achieve this by using two different images (one with shadow and another without) but I need to do this with one image. Here's an example of what I hope to achieve for the mouseEntered event: And here's what it should look after the cursor leaves the button area: Here's my attempt by setting the background of the cell but it changes the color of the

Mouse move on two views, how to let both of them handle the `ACTION_MOVE` event

旧巷老猫 提交于 2019-12-06 07:03:54
问题 I have two views, the bigger one is on the bottom, and the smaller one is on the top. Show on following picture: Now I press mouse on view1 (outside view2), then move to view2. I found even if the mouse is inside view2 during the movement, view2 won't get the ACTION_MOVE event. Only view1 can get it. What I want: When the mouse is inside view1 and outside view2, let view1 handle the ACTION_MOVE event. If the mouse move into view2, then let view2 handle the ACTION_MOVE event. How to do it? PS:

canvas get points on mouse events

允我心安 提交于 2019-12-06 06:27:25
问题 I am having the following function to get the mouse click positions(coordinates). $('#myCanvas').on('click', function(e) { event = e; event = event || window.event; var canvas = document.getElementById('myCanvas'), x = event.pageX - canvas.offsetLeft, y = event.pageY - canvas.offsetTop; alert(x + ' ' + y); }); I need to get the mouse point on clicking a position and also secound mouse point position after draging the same. ie., mousedown point and mouseup points. 回答1: Try a little different

Drawing a rectangle on press and release of mouse, opengl

一笑奈何 提交于 2019-12-06 05:52:17
I'm trying to draw a rectangle from user input that collects x1,y1 coordinates from left click, and then specifies x2,y2 from release of the left click. I save the coordinates based on this mouse action successfully (based on cout<< statements confirming the coords are saved) but nothing is displayed after the left button is released. Here is what I've tried: (keep in mind, nothing crashes, so there is a logic error) void display(void) { glClear(GL_COLOR_BUFFER_BIT); glPushMatrix(); glColor3f(1,1,0); glBegin(GL_POLYGON); glVertex2f(clip_start.x_coord,clip_start.y_coord); glVertex2f(clip_finish

Custom NSStatusItem and NSView not reliably receiving NSTrackingEvents

孤街醉人 提交于 2019-12-06 05:33:00
I have a Status-Bar item only app that Iam trying to get to show a panel on mouseOver. I have the custom status item (and associated view) hooked up and working, but the tracking rect is only receiving events on every dozen or so launches. This leads me to believe there is a race condition happening somewhere, but I can't find it. In my custom status bar item view: - (id)initWithStatusItem:(NSStatusItem *)statusItem { CGFloat itemWidth = [statusItem length]; CGFloat itemHeight = [[NSStatusBar systemStatusBar] thickness]; NSRect itemRect = NSMakeRect(0.0, 0.0, itemWidth, itemHeight); NSLog(@

How to detect a Right Click event in Visual studio?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 05:03:16
Okay, so this should be a simple question, but I'm fairly new at programming, and I can't for the life of me figure out how to use a right-click event. All I want to do is call an event that does something when I right-click a picturebox. It's not in the events toolbar, and I feel like a real idiot. Any help would be greatly appreciated. I'm running the 2010 version. You can use the mouse_down event and check if it is a right-click Private Sub PictureBox1_MouseDown(Byval sender As Object, Byval e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown If e.Button = MouseButtons

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

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.)