mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-27 19:13:55 +08:00
* add-slash-to uppercase * caps-lock-works * leaner and simpler * this is simpler * better... * simpler * rm comments * clearer naming * make more explicit * change to SHIFT_KEY * change name * works - no more double tap * better and works * more readable * simpler but still readable * more self documenting * whoops * add back - needed for if string requirment not meant
43 lines
750 B
C++
43 lines
750 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include <QFrame>
|
|
#include <QPushButton>
|
|
#include <QStackedLayout>
|
|
|
|
class KeyButton : public QPushButton {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
KeyButton(const QString &text, QWidget *parent = 0);
|
|
bool event(QEvent *event) override;
|
|
};
|
|
|
|
class KeyboardLayout : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit KeyboardLayout(QWidget* parent, const std::vector<QVector<QString>>& layout);
|
|
};
|
|
|
|
class Keyboard : public QFrame {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit Keyboard(QWidget *parent = 0);
|
|
|
|
private:
|
|
QStackedLayout* main_layout;
|
|
int shift_state = 0;
|
|
|
|
private slots:
|
|
void handleButton(QAbstractButton* m_button);
|
|
void handleCapsPress();
|
|
|
|
signals:
|
|
void emitKey(const QString &s);
|
|
void emitBackspace();
|
|
void emitEnter();
|
|
};
|