I'm using Qt4.8.6 develop a Application. Is there any way to add two screen keyboard to the application.
I want to add two vritual keyboard in my Application.One of keyboard is QWERTY keyboard,and another is num keyboard ,it can only input numbers.
Is there any way to do it ?
We had a similar requirement once and we ended up writing our own dialog which served as a keyboard. You can also do the same. I am afraid Qt does not provide just a numeric keyboard by itself which will pop up automatically upon placing a cursor in an input field.
Related
I am writing a keylogger for windows. I am planning to get the pressed key with GetAsyncKeyState(KEY) and a hidden console. After a key press has been identified I will get the current focused windows with GetForegroundWindow and indentify which program was on top when the key was pressed. I also want to be able to Differentiate between key presses for passwords and other kind of inputs. Is there a way to do it? How?
I am not writing a malicious software. This is for an assignment in Advanced Programming course.
If the foreground app is using standard Win32 UI controls, then try this:
use GetForegroundWindow() to get the HWND of the foreground window.
then use GetWindowThreadProcessId() and GetGUIThreadInfo() to get the foreground window's currently focused child control.
then use GetClassName() to check if it is a standard EDIT control (this check might fail in some UI frameworks! You might have to use the UI Automation API to detect the control type)
then use GetWindowLong/Ptr() to check if it has the ES_PASSWORD style applied.
However, if the foreground app is not using standard Win32 UI controls, and/or is custom-drawing them, or the like, then all bets are off.
Is it possible to create a keyboard shortcut to switch between the monitor and portion selection of this wacom preferences window, via a c++ console program?
Sorry if this is poorly worded, I've had trouble trying to find the right words to search for ways to do it.
I think it should be possible, although a bit tedious. You should be able to use the Windows API, and try to EnumWindows/EnumDesktopWindows to identify the respective application Window, and its respective controls (which are also Windows).
You should identify the window title, and class ids, for the app window, and the checkbox button controls, then when you enumerate through all the desktop windows, you can identify the ones you are interested in.
Then you can use the SendMessage() API to send messages to the controls (Windows) of interest to manipulate them.
It's a bit tedious, but sounds possible.
An example of use here to get an idea:
http://www.cplusplus.com/forum/windows/25280/
I am trying to make an on screen keyboard for windows in C++ that rather than sends an input such as SendInput() takes intercepts the user inputs allowing the user to use a window and have the key press show on the on-screen keyboard.
I plan on using this as a way of making tutorials in programs such as unity and can be used as an overlay for people know play games. to do this I will need to take in the input without stopping it going to its destination but I don't know how.
Any help would be appreciated.
The down arrow key of my laptop is very loose and it does not seems to last very long.
Is it possible to write any programm(in any language but especially C++) hat simulates the down arrow key.say I made a programm such that when I press A,B,C on the key board it simulates down arrow key.
If not then,
Is there any software available to do this?
Use the On-screen keyboard
If you want to simulate input, use the SendInput API. This injects input at a fairly low level, windows automatically routes it to the appropriate thread based on who has focus. Call it twice, once to send the key down, and again to send the key up.
Perhaps the easiest thing to do is to write a simple app that calls RegisterHotkey for some combination like ctrl-alt-Z, and then calls SendInput for a keypress then keyrelease of the down arrow key.
You might need to wait a short time after receiving WM_HOTKEY to give you time to release the set of hotkeys so that the down arrow gets processed alone without those modifiers from your hotkey interfering with it. (...otherwise the focused app might think you typed in shift+alt+downarrow instead of plain downarrow!)
if you're using linux, xmodmap: http://www.xfree86.org/4.2.0/xmodmap.1.html
I think that you are actually looking for Sharpkeys www.randyrants.com/sharpkeys/
This works with the windows registry and can be used to change mappings of keys.
You can easily write a program that sends WM_KEYDOWN and WM_KEYUP messages to the window which has the current focus. Once you have this program, bind it to a function key in the properties for the .exe file.
I am doing a VoIP client and I want to start/stop on WM_KEYDOWN and WM_KEYUP messages for a certain input, say K. When the main window has focus, this is np, but how do I enable it outside of the window? For example, if the window is not in focus and I'm just looking at the desktop or am in a videogame. How does one perform something like this? I am not sure where to begin.
Also -- I guess you somehow has to poll every input even outside the program, is that expensive?
win32 c++ btw
You need to install keyboard hooks: http://msdn.microsoft.com/en-us/library/ms644990(v=VS.85).aspx
This can be very troubling though for every running application if something steals its keyboard messages.
I don't think you want this - if I'm typing a document into Word and I hit K, I'm going to be very angry when your application pops up instead of a "k" appearing in my document.
Windows allows you to assign shortcut keys to an icon on the desktop, but it limits them to the function keys or to combinations containing both Alt and Ctrl. Right-click on a desktop icon and go to Properties, and look for the field marked "Shortcut key".