Recently implemented QT's custom keyboard, although it can be used, but CPU occupancy is always very high, nearly 100%.
The survey can find that QT's keyboard event monitoring is implemented through Qsocketnotifier.
M_notifier = new Qsocketnotifier (M_FD, Qsocketnotifier::read, this);
Connect (M_notifier, SIGNAL (activated (int)), this, SLOT (Remotedataincoming ()));
The problem here is that the driver is always readable, causing the read function to be called all the time. The qsocketnotifier activated (int) signal is triggered based on the state returned by the drive poll function, and its driver is not included in the function.
The workaround is as follows:
Add the poll function to the drive and press the button to set the mask to mask |= Pollin | Pollrdnorm;
unsigned int s3c_key_poll (struct file *filp, struct poll_table_struct *wait)
{
unsigned int mask = 0;
if (Readl (gpldat))
{
Mask |= Pollin | Pollrdnorm; /* Indicates that the data can be obtained
/} return
mask
}
In fact, I am not familiar with the drive, encountered to solve, of course, the driving congestion and non-blocking is not quite understand, here denoted, easy to finish.
Hey, I always feel that I know too little.
~end~