[ Qt 프로그래밍 ]QT 2D 게임 키보드 입력 예제
Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { QTimer* timer=new QTimer(this); timer->setSingleShot(false); timer->setInterval(50); connect(timer,SIGNAL(timeout()),this,SLOT(keyFunc())); timer->start(); } void Widget::keyFunc() { if(keyLeft==true&&keyUp==true)// left up { } else if(keyRight==true&&keyUp==true)// left up { } else if(keyLeft==true&&keyDown==true)// left up..