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
Related
Is it possible to control (Enable/Disable) the Speaker Icon in Delphi Code.
Is there a registry entry for this?
Many Thanks...
While it might be possible to "hide" the icon by changing a undocumented registry value, the user can unhide it again in the tray icon options so this is not really a permanent solution.
If you insist on ignoring your users desire to mute their machine you can unmute the volume programmatically.
On Windows XP/2003 and older you will have to use the old mixer API. This API is not fun to deal with and you have to remember to unmute both the Wave and master volume lines. See this and this for inspiration.
Vista and later has a new COM based API that should be less painful to deal with. Create a instance of IMMDeviceEnumerator and enumerate the render endpoints (or use GetDefaultAudioEndpoint) and call IAudioEndpointVolume::SetMute on the device endpoint. This example should be pretty close, just translate it to Delphi. Volume can also be controlled per application so you might need to deal with that as well if your users are clever.
Larry Ostermans blog is also a great source for help and details about this new API.
Note: As a workaround for your unmuting, the user can simply set the volume really low to get rid of your sound. There is really no way for you to know if the sound is audible at a low volume level and setting it higher just because you can would be very evil and could really hurt somebody with headphones etc.
I'm looking for a script or a program that runs in background and blocks special keys on my keyboard (calculator, mute, etc) I have searched a lot on this on the internet but didn't found anything useful or working for me, I tried sharpkeys but didn't detected those keys on my keyboard, key id is 173 for mute on my keyboard and I can get others IDs if I find anything to block them with IDs.
P.S. I don't know much about programming and most likely don't know what I am doing, I'm looking for basic help from anyone. thank you!
TL;DR To disable all "special keys" you could change the Human Interface Device Access Windows service startup type from Automatic to Manual (or Disabled in case there is some other software installed that causes it to still start when set to Manual). Caution: this may break other input devices if present, such as IR remote controls, or Airplane mode radio management.
For background, those "special keys" are technically called "consumer control buttons (CCB)" (see for example Keyboard Enhancements in Windows 8 and the linked .docx - nevermind that CCBs long predate Windows 8).
The CCBs are handled by the Human Interface Device Access Windows service, as described at Human Interface Device Access:
This service provides generic access to specific functions contained within controls collections on HID (Human Interface Devices). It enables the use of predefined hot buttons on keyboards, remote controls and other multimedia devices.
If the service is stopped or disable, the buttons on USB keyboards will not function (i.e., back, forward, volume up, down, previous track, next track), nor will the volume buttons on USB speakers.
To change the Human Interface Device Access (HidServ) startup mode, navigate to My Computer / Manage / Services and Applications / Services, double-click the Human Interface Device Access in the list, and change the Startup type to Manual or Disabled.
To disable special keyboard keys via registry on Windows 10 go to HKLM:\SYSTEM\CurrentControlSet\Services\hidserv and change "Start" DWORD value to 4. Once you restart the system, special function keys should be disabled.
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
How can I simulate Hardware button (Back, Home, Search) click using Expensify test framework, on Real device connected to USB port on my system. Can you please guide changes required (if any) to acheive this..
Without using robotics, I don't believe this can be done on real hardware as it stands today.
I have talked to some of the US Microsoft DPE team about future support, but there has been no progress on this.
This can, however, easily be done on the emulator using steps such as:
Then I press a hardware button "PhoneHardwareButton"
where the PhoneHardwareButton enum is one of the values:
Back,
Home,
Search,
Camera,
VolumeUp,
VolumeDown,
Power,
Menu
from https://github.com/Expensify/WindowsPhoneTestFramework/blob/master/Server/Core/Tangibles/PhoneHardwareButton.cs
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.