mouse

jQuery handing both focus and click on an element

醉酒当歌 提交于 2019-11-28 08:34:04
I'm trying to determine workflow to fine-tune a data entry web application. Picture several address forms on a single web page: 1. Name___________ Street_________ Phone__________ 2. Name___________ Street_________ Phone__________ [...many more...] Now I'd like to know if the user is using the tab key to get to the second "Name" field (or anywhere within that record), or if they're using the mouse to click on it. (Or shift-tab to move in reverse.) I've set a handler on both focus and click for the input fields: $('input').click(function() { TabulateClick(this) }); $('input').focus(function() {

Getting MouseMoveEvents in Qt

…衆ロ難τιáo~ 提交于 2019-11-28 08:04:15
In my program, I'd like to have mouseMoveEvent(QMouseEvent* event) called whenever the mouse moves (even when it's over another window). Right now, in my mainwindow.cpp file, I have: void MainWindow::mouseMoveEvent(QMouseEvent* event) { qDebug() << QString::number(event->pos().x()); qDebug() << QString::number(event->pos().y()); } But this seems to only be called when I click and drag the mouse while over the window of the program itself. I've tried calling setMouseTracking(true); in MainWindow's constructor, but this doesn't seem to do anything differently (mouseMoveEvent still is only called

How to override maximum 32x32 mouse size in Windows like this program can

主宰稳场 提交于 2019-11-28 07:35:12
I'd like for my program to be able to override the maximum imposed mouse size of 32x32 much like the program in the picture attached does, the cursor pictured is 72x72. This is a capture from ProcMon showing what's going on when the cursors change. However, if I try to change the registry values for the cursor files myself and then push the changes using SystemParametersInfo(SPI.SPI_SETCURSORS, 0, IntPtr.Zero, SPIF.SPIF_SENDCHANGE); then the cursor will change, but it's still limited to the 32x32 maximum size. How was this program able to get around that restriction? Also, the cursors remain

JavaFX Moving 3D objects with mouse on a virtual plane

爱⌒轻易说出口 提交于 2019-11-28 07:03:41
As I was creating my first 3D game in JavaFX - where you would be able to assemble ships from parts using the mouse. This presents a problem since JAVAFX seems to have no native metods that work for converting PerspectiveCamera screen 2D coordinates into the scene's 3D space. Here is a representation of what I'm trying to acheive. A block moved by the mouse should move on an imaginary plane that is always rotated 90 in relation to the camera: I've tried to solve the problem with trigonometry without much success. I've not attached a code snippet as I'm looking for a more generic mathematical

Cocoa: Getting the current mouse position on the screen

江枫思渺然 提交于 2019-11-28 06:48:43
I need to get the mouse position on the screen on a Mac using Xcode. I have some code that supposedly does that but i always returns x and y as 0: void queryPointer() { NSPoint mouseLoc; mouseLoc = [NSEvent mouseLocation]; //get current mouse position NSLog(@"Mouse location:"); NSLog(@"x = %d", mouseLoc.x); NSLog(@"y = %d", mouseLoc.y); } What am I doing wrong? How do you get the current position on the screen? Also, ultimately that position (saved in a NSPoint) needs to be copied into a CGPoint to be used with another function so i need to get this either as x,y coordinates or translate this.

any way to detect ctrl + click in javascript for osx browsers? no jQuery

与世无争的帅哥 提交于 2019-11-28 06:27:24
问题 using vanilla js. Any way to grab the "right-click" (option-click) from OSX? function clickey(e) { if(event.button==2 || /*how you'd do it in Java=)*/ e.getButton() == MouseButton.BUTTON3 ) ... } but in js, how do eeet? 回答1: You need to listen to the contextmenu event. This is triggered when the context menu should be shown. So either if the right mouse butten or or ctrl + mouse . If it is not supported then you can try to check the mousedown event where button is 2 and ctrlKey is true if it

How i can simulate a double mouse click on window ( i khow handle) on x, y coordinate, using SendInput?

点点圈 提交于 2019-11-28 06:05:01
How i can simulate a double mouse click on window ( i know handle of this window) on x, y coordinate, using SendInput? void DoubleClick(int x, int y) { const double XSCALEFACTOR = 65535 / (GetSystemMetrics(SM_CXSCREEN) - 1); const double YSCALEFACTOR = 65535 / (GetSystemMetrics(SM_CYSCREEN) - 1); POINT cursorPos; GetCursorPos(&cursorPos); double cx = cursorPos.x * XSCALEFACTOR; double cy = cursorPos.y * YSCALEFACTOR; double nx = x * XSCALEFACTOR; double ny = y * YSCALEFACTOR; INPUT Input={0}; Input.type = INPUT_MOUSE; Input.mi.dx = (LONG)nx; Input.mi.dy = (LONG)ny; Input.mi.dwFlags =

云顶之弈换中立python脚本

耗尽温柔 提交于 2019-11-28 05:34:36
import pynput keyboard = pynput.keyboard.Controller() mouse = pynput.mouse.Controller() def on_release(key): try: if key == pynput.keyboard.Key.backspace: mouse.press(pynput.mouse.Button.left) mouse.release(pynput.mouse.Button.left) print('按了一下鼠标') keyboard.press('E') keyboard.release('E') print('按了一下E') if key == pynput.keyboard.Key.esc: print('退出') return False except AttributeError: print('special key {0} pressed'.format( key)) def on_press(key): print('按了一下{0}'.format(key)) print('正在启动程序....请稍等几秒.单击英雄之后按backspace替换成野怪.按ESC之后退出') with pynput.keyboard.Listener( on_press=on_press, on_release

How does CommandManager.RequerySuggested work?

丶灬走出姿态 提交于 2019-11-28 04:53:48
The MSDN only states that Occurs when the CommandManager detects conditions that might change the ability of a command to execute. However I can't seem to find any traces of how this works, what I should be aware of / avoid etc... Does it just listen for input? (i.e.: mouse moves, keys pressed and so on) gehho I cannot tell you exactly what events the CommandManager listens to. However, I can tell you that you should be careful when using the CommandManager in connection with asynchronous operations . I had the following problem when I used the CommandManager in my ICommand implementations: I

How do I drag and drop a row in a JTable?

爱⌒轻易说出口 提交于 2019-11-28 04:31:20
How do you setup a JTable to be able to drag a row to a different index in the table. For example if I have 5 rows and I want to drag the 4th row to the 2nd position? Check out the drag and drop section of the Java Tutorial. There are some examples on how to implement this for JTable . Aaron Davidson The following allows JTable re-ordering of a single dragged row: table.setDragEnabled(true); table.setDropMode(DropMode.INSERT_ROWS); table.setTransferHandler(new TableRowTransferHandler(table)); Your TableModel should implement the following to allow for re-ordering: public interface Reorderable