hlp:桂林国际齿轮泵代码
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#include "moveinput.h"
|
||||
#include "ui_moveinput.h"
|
||||
#include <QWSServer>
|
||||
|
||||
MoveInput::MoveInput(QWidget *parent) :
|
||||
QWidget(parent,(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool)),
|
||||
ui(new Ui::MoveInput)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->Key_left,SIGNAL(pressed()),this,SLOT(onKeyLeftPressed()));
|
||||
connect(ui->Key_right,SIGNAL(pressed()),this,SLOT(onKeyRightPressed()));
|
||||
connect(ui->Key_up,SIGNAL(pressed()),this,SLOT(onKeyUpPressed()));
|
||||
connect(ui->Key_down,SIGNAL(pressed()),this,SLOT(onKeyDownPressed()));
|
||||
}
|
||||
|
||||
MoveInput::~MoveInput()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
void MoveInput::onKeyLeftPressed(){
|
||||
#ifndef Q_OS_WIN32
|
||||
QWSServer::sendKeyEvent(0,Qt::Key_Left,Qt::NoModifier,true,false); //向系统发送键盘事件
|
||||
#endif
|
||||
}
|
||||
|
||||
void MoveInput::onKeyRightPressed(){
|
||||
#ifndef Q_OS_WIN32
|
||||
QWSServer::sendKeyEvent(0,Qt::Key_Right,Qt::NoModifier,true,false); //向系统发送键盘事件
|
||||
#endif
|
||||
}
|
||||
void MoveInput::onKeyUpPressed(){
|
||||
#ifndef Q_OS_WIN32
|
||||
QWSServer::sendKeyEvent(0,Qt::Key_Up,Qt::NoModifier,true,false); //向系统发送键盘事件
|
||||
#endif
|
||||
}
|
||||
void MoveInput::onKeyDownPressed(){
|
||||
#ifndef Q_OS_WIN32
|
||||
QWSServer::sendKeyEvent(0,Qt::Key_Down,Qt::NoModifier,true,false); //向系统发送键盘事件
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user