Qt call virtual keyboard (soft keyboard)

tags: Summary  qt  c++  windows

Qt as a good UI interactive manufacturing tool, how to lack external IO devices.

In some application scenarios, there is often a soft keyboard (virtual keyboard), gossip less, directly on the program:

1. First trust a few controls that can be entered, plus a button

2. Write code is performed:

#include "keyBoard.h"
#include<windows.h>
keyBoard::keyBoard(QWidget *parent)
	: QMainWindow(parent)
{
	ui.setupUi(this);
	connect(ui.pushButton, &QPushButton::clicked, [&] {

		void* keyBoard = nullptr;
		bool m_b = Wow64DisableWow64FsRedirection(&keyBoard);
		QString boardExe = "C:/Windows/System32/osk.exe";
		QString params = "";
		ShellExecute(nullptr, L"open", (LPCWSTR)boardExe.utf16(), (LPCWSTR)params.utf16(), nullptr, SW_SHOWNORMAL);
		if (m_b)
		{
			Wow64RevertWow64FsRedirection(keyBoard);
		}
		});
  
}

It is enough for this few lines. Then the result is this:

It should be refined enough.

 

 

Intelligent Recommendation

Qt soft keyboard design - window keyboard message

Keyboard event message sending QApplication::sendEvent(QObject* pObj,QEvent* event); Features: Use the QEvent class to implement message delivery, without calling WindowAPI; problem, can only work ins...

Qt soft keyboard [simulation] keyboard trigger event

1. Open QtCreater software, select 'New' from the 'File' menuFile or Project .. 'option, the pop-up dialog box is as follows:            &nb...

Listening to the virtual keyboard or soft keyboard pops up

Introduction The author wrote a NPM package a year, and I used it to make up the article. When I got online, I didn't find a NPM package VirtualKeyboard. Since it is the first write npm package withou...

Qt-virtual keyboard

miscellaneous During the development process, I consulted a lot about the use of virtual keyboards, the easiest of which is to use Qt's own input method, but this method is subject to people. Practice...

Qt implements virtual keyboard

Use to override LineEdit and then monitor mouse click events, and control whether it is a numeric keyboard or an English-digital mixed keyboard according to the selection of LineEdit.     &n...

More Recommendation

QT virtual keyboard use

QT virtual keyboard use QT adds the virtual keyboard after 5.7. We can quickly use the QT official virtual keyboard on some occasions that do not require the style. In the process of use, two main pro...

How to write a soft keyboard with qt

How to useqtWrite a soft keyboard Hundred percent original The key to achieve even let the software disc slot to add a plugin to do the operation inside the text 1main: QtThe establishment of a r...

Qt development - digital soft keyboard

  Recent projects do touch screen interface, you need to use digital soft keyboard, refer to: Qt actual development - Digital soft keyboard: This article. Body can be used, in order to meet the n...

Write a soft keyboard using QT

The soft keyboard is placed in a widget by putting multiple Toolbutton and boosts the button to the custom class SoftKey inherits in the QToolButton class. step: 1. Add event filter for controls that ...

Qt qlineedit display soft keyboard

Click QLineEdit to display soft keyboard When embedded is developed, it cannot be entered through the mouse keyboard. At this time, you need to meet the user needs through the software layer, the soft...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top