2 Mice, capturing exclusively one mouse on windows (DirectInput, DDK, Linux, anything) - windows

I have connected 2 mice to PC and I wish one mouse to work as regular mouse and capture second mouse exclusively.
First I was trying DirectInput. It showed 2 devices with word mouse in InstanceName.
But only one device had DeviceType.Mouse and it was only really working device.
When I was acquiring it was blocking both mice.
Second I decided to create driver. I downloaded WinDDK. There is Mouse Filter driver sample.
I was able to compile it.
But I am not driver programmer. It is complex for me to understand but it has some code related to PS/2 mouse. All my mice are USB.
It should be installed with .INF file. I prefer it be dynamically loaded.
I am not quite sure that it is right direction.
I do it for my hobbyist robotic project. I wish PC take some information from mouse as sensor.
I think there must be existing similar projects or solutions.
I have linux pc on my table as well. May be better to attach mouse to linux and parse
/dev/input/mouse0
/dev/input/mouse1
/dev/input/mouse2
looks like
sudo cat /dev/input/mouse1 - gives some data but does not block device from clicks and movements.
I hope simple solution already exists
Cheers
Max

For Linux, you need to either declare the first mouse as the CorePointer or configure the second mouse to have SendCoreEvents false. See the xorg.conf(5) man page for more details.

Related

Mouse/keyboard probably hacked

I recently played a game called "Quake Champions" from Steam. Against a player I know for a fact is a cheater, my left mouse button stopped to work whenever he was in a close-radius.
I am sure it is a cheat because my mouse works just fine on other computers.
I heard of DLL injection and cheaters using such methods. I am afraid somehow my mouse and maybe keyboard are being monitored remotely.
What can I do to find out, and also solve the issue ?
I tried re-installing display drivers, full game and deleted all files, mouse driver and app (mouse is Razer Basilisk Essential), I tried anti-malware softwares, etc.
Now even outside of the game the mouse seems to skip clicks at times, especially when I hold and drag (continuous fire in the game...).
I documented myself a bit and heard of hooks. I would ideally like to figure out which process (visible or not in task manager) hooks or interacts with both my keyboard and mouse, it would probably be a great way to figure out if I am in trouble or not.
Formatting the computer in full IS an option, but one I would prefer to avoid as I have costly licenses that I may lose, due to a limited number of activations...
Any help appreciated.
Further info:
Razer Central/Synapse -> Keyboard: Razer Cynosa Chroma ; Mouse: Razer Basilisk Essential
Further anxiety:
Shortly after this event happened, I received an alert from my Facebook saying somebody tried to log in... It was not me. It may be a coincidence, it may not. Fortunately my Facebook password is strong enough. But this is further reasons to be anxious on my end...

Projector’s remote controller events

I should make a PowerPoint presentation, but I don’t want do it. Instead, I know c++ and WinApi, and I decided to make an app, with cool effects, that would be presentation. In my classroom there is projector with the remote controller.
How can I handle events from the remote controller in my app? Will it be WM_KEYDOWN or something like this when I press next or previously on controller?
Also, can these events be handled in browser?
If you are familiar with serial communication, this work will not be difficult.
A number of projectors have RS232 or USB ports that can be used for controlling the projector's functions, i.e. switching inputs and powering on and off.
Then you only need to know the model of the projector, you can search the corresponding serial communication protocol on the Internet, or directly ask the manufacturer for the protocol information.
A small blog demo
And you only need to process the buttons of the remote control according to the serial port command.
Cases that might be useful to you:
Projector control - RS232 / USB?
3 EASY STEPS TO UNDERSTAND AND CONTROL YOUR RS232 DEVICES
Control projector via serial port
Obviously hard to say without knowing the model and brand of your projector. Many projectors do present these buttons as a USB keyboard, though (see one user manual specifying "page up" and "page down" keys as an example - I'm not affiliated with the brand in any way; it was just the first explicit specification I could find).
I suggest to try it out with the relevant equipment. The following website might be useful to see the keyboard input (and it incidentally answers your second question about the browser): key event viewer

Is a "monitor" in Gtk3 the same as a "Screen" in X11?

I wrote an application in Gtk3 using gdk_display_get_monitor_at_window and
gdk_monitor_get_geometry. Out of 75 gtk functions that I used, these are the only 2 that are causing problems for people trying to compile on Ubuntu because most people are not running a version of Ubuntu that has gtk3 3.22.
My application also uses X11, so I want to replace these functions with X11 equivalents. After briefly looking at X11, I have some questions:
Is a Gtk "monitor" equal to an X11 "screen"?
If the answer to 1. is yes, then what is a Gtk "screen" equal to in X11?
What is a "display" in each?
A complete table comparing display/screen/monitor etc in Gtk to X11 would be good.
A monitor is a physical device. A screen is a logical device, possibly complete with its own keyboard and pointer (mouse). A screen can span multiple monitors.
Normally there is only one screen (one keyboard, one mouse) on a personal computer, even if there are multiple monitors. Multiple screens are of limited utility for a PC as it is not possible to move windows between screens. A multi-screen setup works best for a multi-user machine where each user gets his own monitor, keyboard and mouse.
There is another variant of multi-screen setup where one can move the mouse pointers between screens (and so there is one mouse and one keyboard), but windows are still confined to their screens. This variant us thoroughly obsolete.
A display is a network server that can manage one or more screens (on a typical PC, just one screen).

Control-drag event through Windows PC keyboard

I am connecting to MAC machine remote from windows laptop to develop an app. I am planning to add constraints in xcode and the documentation says, I need to do contrl-dragging as specified here.
I couldn't find any help online on how to do this. Could someone please help?
Your question is confusing because Control-dragging is done the same way on a Windows PC as it is done on a Mac.
Windows laptops should have a Control key (possibly label Ctrl). Press and hold down that key. While you're holding the Control key down, press and hold down the left mouse button. Move the mouse. You are now Control-dragging. When the mouse cursor reaches the desired destination, release the mouse button and the Control key.
If that doesn't work or help you understand, you're going to have to be clearer about the nature of your confusion or the problem.
Well, you simply cannot do it, at least that way. Apple is aware of that problem that happens when you use Macincloud. The most you can do is this: https://support.macincloud.com/support/solutions/articles/8000007774-alternative-method-to-ctrl-drag-control-drag-

Low level keyboard hook

I just bought a new keyboard, and I'm interested in tracking exactly how many keypresses/strokes I make during the entire life of the keyboard. (I would want to just record keyUp, as I don't care about repeats)
I've been googling around for the best way to do this, but I don't even know what approach to take, so I'm having trouble searching intelligently.
Also, the only language I've really worked with is C#. Haven't done anything with C/C++ or WinAPI
Is it difficult to modify the Win 7 drivers directly?
I do want to be able to record keystrokes from the moment the computer boots, but this may not be easily done.
I would prefer to use an existing driver or hook, as I really don't care to get into learning device drivers right now.
I've looked briefly at Ctrl2Cap, but I don't know how to modify something like that to suit my case.
Other questions I looked at,
Writing a keyboard device driver
Low level keyboard Hook not at UI thread
This one indicates writing a USB Filter driver may work, but I have no clue where to start on that.
Disabling the keyboard in windows c++?
It is not necessary to go the driver route, which is not for the faint of heart. You can use use a low level keyboard hook which will work fine from .NET.
I did a quick bing and found the following on codeplex
http://globalmousekeyhook.codeplex.com/
It should get you going
If you want to do that you need to use Kernel Level Keylogger. It's grabs the keystrokes before the operating system takes effects and this one 99% invisible for detection techniques. Then you can grab the Windows Log On screen typed things like password/username etc.
#ChrisTaylor's key logger not work for WinLog-on Screen I reckon. If you can install the keyboard driver filter before the system keyboard device driver take a action you can handle windows user login screen also. But In order to install this driver level key hook you need to have administrator privileges.
I found Unix and Windows Keyloggers from Github. Free to play with this https://www.adlice.com/kernelmode-rootkits-part-3-kernel-filters/ and have fun!
That, what you want is dangerous!
With the same code everyone can create keylogger*
But if you not a virus creator then I recommend you to search "hotkeying in C/C++" or something like that and hook keyboard with hotkeys!
I have written HotKey Maker in VB6 which can make hotkey from every button of keyboard.
But I really not interested in viruses :)
Good Luck !
*Virus which hooks your keyboard and send all what you wrote in keyboard to Virus owner

Resources