I can capture Gdk::ModifierType. When I do mouse button events the modifier emits
272 for a left click
1040 for a right click
16 for a button release
If I run my program on another computer will it emit the same signals for mouse events?
Related
I'm using GetLastInputInfo to track user idle time in a desktop mixed mode C++ / C# application.
On one user's machine, GetLastInputInfo will advance its time, even when I register no low level keyboard or mouse input via this method.
The user (a coworker so I have access to the machine) runs Windows 10 on a Lenovo Yoga.
Below is sample output from my program to poll on GetLastInputInfo and display low level mouse and keyboard events:
Mouse: 57 wParam:512 flags:0 pt:1366,57 14750640 12:06:37.0864968
Mouse: 58 wParam:512 flags:0 pt:1366,60 14750656 12:06:37.0964981
Mouse: 59 wParam:512 flags:0 pt:1365,60 14750671 12:06:37.1064994
GetLastInputInfo 60 gliiRet:True cbSize:8 dwTime:14750671 12:06:37.2465354
GetLastInputInfo 61 gliiRet:True cbSize:8 dwTime:15063750 12:11:50.2038808
which implies that mouse events at 12:06:37.1064994 caused GetLastInputInfo #60 at 12:06:37.2465354, but between 12:06:37.2465354 and 12:11:50.2038808, no mouse or keyboard user input events occurred, but still GetLastInputInfo advanced to a new dwTime.
I'd like to determine the root cause of this problem. Is this a faulty device driver? Are there other trappable user input events that affect GetLastInputInfo that I'm missing?
Thanks.
I bought a Logitech Marble Trackman. I am used to hold one button and roll the ball to scroll under linux. Now I am working under Win8 and installed Logitech SetPoint.
Now I have Universal Scroll and AutoScroll as options and both lock the scroll function. I need a second click to deactivate scrolling.
Is there a way to scroll only with button 4 hold?
I found a solution after a long search.
It's this simple:
throw away LogiTech SetPoint
Install e.g. X-Mouse Button Control from http://www.highrez.co.uk/downloads/XMouseButtonControl.htm
Configure everything you want.
Poor Logitech.
I have two monitors one of them is a touchscreen. do somebody now a simple code in autohotkey. that you received a value, between a mouse click and a touchscreen click
I use for example Photoshop application on my main monitor 1
And I have a virtual keyboard with my (favorite keystroke combos) on my touchscreen monitor 2
I want if I do with my left hand a touchscreen click on my virtual keyboard monitor 2.
That the mouse pointer stays on my main monitor 1
So that I can proceed with PhotoShop without interrupting to move my mouse pointer back to my main monitor 1.
This is the script so far a alternative idea.
::^d ;push ctrl + d to disable the mouse pointer movement
BlockInput MouseMove
return
::^e ;push ctrl + e to enable the mouse pointer movement
BlockInput MouseMoveOff
return
Distinguishing between input devices is not a trivial task with AHK. It can be done, but it's quite complicated.
If you'd be okay with interpreting every click on the touchscreen as a touch click then you could do something like this:
When the mouse moves on the normal screen
store it's position in a variable.
When a left click is executed on the touch screen do the click
move the mouse back to the last know position on the normal monitor.
You'll need:
SysGet
RegisterCallback or SetTimer+MouseGetPos
Hotkeys
I do not have a second monitor to fully test this code but I have tested on my main monitor which is a touchscreen. This code should do the trick :)
; Screen pixel split between monitors
; You should change this values according to the desired region of interest
screen_split_min := 0
screen_split_max := 200
; To get absolute monitor coordinates
CoordMode, Mouse, Screen
MouseGetPos, pre_mx, pre_my
While 1
{
MouseGetPos, tmp_mx, tmp_my
If tmp_mx > %screen_split_max%
{
pre_mx := tmp_mx
pre_my := tmp_my
}
}
~LButton::
MouseGetPos, mx, my
If mx <= %screen_split_max% and mx >= %screen_split_min%
{
MouseMove, pre_mx, pre_my, 0
}
return
HTH ;)
In a Qt dialog I have an embedded native Win32 window. As in any standard Win32, I define my own message queue, where, per default, I forward all events to the parent window, and in case an event of interest arrives, I perform some extra work.
My problem is that when I press the left mouse button, then I get the WM_LBUTTONDOWN as expected, but if I keep it pressed, then I get no more mouse clicks events, that is, I get the WM_MOUSE messages, but the mask (wParam), or calling GetKeyState, do not indicate that the mouse key is kept pressed.
The window is created with following parameters,
dwExStyle = WS_EX_TRANSPARENT;
dwStyle &= ~(WS_BORDER| WS_CAPTION | WS_DLGFRAME | WS_THICKFRAME);
CreateWindowExW(0,"Window","Name",dwStyle,
0,0,512,512,
hwndParent,NULL,hInstance,NULL )
When this native window is not embedded in any dialog, it works correctly.
I could also embed this window in a .NET dialog window and observe the same problem.
Any clue what could be going wrong?
Did you mean WM_MOUSEMOVE? Did you try capturing the mouse first?
WM_LBUTTONDOWN is sent only once per click. You'll have to use a boolean to keep track of whether the button is pressed or released during the WM_MOUSEMOVE events. Make use of the WM_LBUTTONDOWN and WM_LBUTTONUP messages together to keep track of this.
A program has called XGrabKey() to make a hotkey.
The user presses that key combination (while another window is focused).
The program receives control to do something in response to the key combination. Meanwhile, the program has been temporarily focused (because of the effects of XGrabKey (see man XGrabKey, man XGrabKeyboard)).
I want the program to create a synthetic X event (a keypress or mouse click) to the originally focused window. In some cases this means I need to focus that window before sending it the event (Firefox ignores synthetic events when it is not focused), which means I need to know which window it is. How can I find out which window it is?
Wait for the next FocusOut event, verify that the mode is set to NotifyUngrab, get the focus with XGetInputFocus(), and send away your synthetic events.