Add Basic Keyboard Input

This commit is contained in:
Florian Märkl 2019-07-10 09:58:01 +02:00
commit bf17d81d25
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857
4 changed files with 64 additions and 0 deletions

View file

@ -31,6 +31,7 @@ class QGamepad;
class QAudioOutput;
class QIODevice;
class QKeyEvent;
class StreamSession : public QObject
{
@ -45,6 +46,8 @@ class StreamSession : public QObject
QGamepad *gamepad;
#endif
ChiakiControllerState keyboard_state;
VideoDecoder video_decoder;
QAudioOutput *audio_output;
@ -62,6 +65,8 @@ class StreamSession : public QObject
#endif
VideoDecoder *GetVideoDecoder() { return &video_decoder; }
void HandleKeyboardEvent(QKeyEvent *event);
signals:
void CurrentImageUpdated();

View file

@ -38,6 +38,10 @@ class StreamWindow: public QMainWindow
void SetImage(const QImage &image);
protected:
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
private slots:
void FramesAvailable();
};