diff options
Diffstat (limited to 'pacman-c++/mainwidget.cpp')
| -rw-r--r-- | pacman-c++/mainwidget.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index 1631d3f..420ea8f 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp | |||
| @@ -175,7 +175,6 @@ void MainWidget::tick() | |||
| 175 | } | 175 | } |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | |||
| 179 | void MainWidget::keyPressEvent(QKeyEvent* event) | 178 | void MainWidget::keyPressEvent(QKeyEvent* event) |
| 180 | { | 179 | { |
| 181 | if (!m_running) | 180 | if (!m_running) |
| @@ -195,6 +194,10 @@ void MainWidget::keyPressEvent(QKeyEvent* event) | |||
| 195 | std::string dataStr = packet.SerializeAsString(); | 194 | std::string dataStr = packet.SerializeAsString(); |
| 196 | unsigned int bytesWritten = m_socket->write(dataStr.c_str(), dataStr.length()); | 195 | unsigned int bytesWritten = m_socket->write(dataStr.c_str(), dataStr.length()); |
| 197 | m_socket->flush(); | 196 | m_socket->flush(); |
| 197 | if (bytesWritten != dataStr.length()) { | ||
| 198 | qDebug() << "written: " << bytesWritten; | ||
| 199 | qDebug() << "strl: " << dataStr.length(); | ||
| 200 | } | ||
| 198 | Q_ASSERT(bytesWritten == dataStr.length()); | 201 | Q_ASSERT(bytesWritten == dataStr.length()); |
| 199 | 202 | ||
| 200 | qDebug() << "send key: " << m_currentKey; | 203 | qDebug() << "send key: " << m_currentKey; |
