[hardware_test] Keyboard test: check only a subset of keys

This commit is contained in:
Émilie Feral
2019-12-03 11:51:47 +01:00
committed by LeaNumworks
parent a515160470
commit b36f9416b4
6 changed files with 74 additions and 20 deletions

View File

@@ -17,10 +17,10 @@ View * KeyboardTestController::view() {
bool KeyboardTestController::handleEvent(Ion::Events::Event event) {
Ion::Keyboard::State state = Ion::Keyboard::scan();
Ion::Keyboard::State onlyKeyDown = Ion::Keyboard::State(Ion::Keyboard::ValidKeys[m_keyboardView.testedKeyIndex()]);
Ion::Keyboard::State onlyKeyDown = Ion::Keyboard::State(KeyboardModel::TestedKeys[m_keyboardView.testedKeyIndex()]);
if (state == onlyKeyDown) {
m_keyboardView.setTestedKeyIndex(m_keyboardView.testedKeyIndex()+1);
if (m_keyboardView.testedKeyIndex() == Ion::Keyboard::NumberOfValidKeys) {
m_keyboardView.setTestedKeyIndex(m_keyboardView.testedKeyIndex() + 1);
if (m_keyboardView.testedKeyIndex() == KeyboardModel::NumberOfTestedKeys) {
// Returning false will go to the next step in the WizardViewController
return false;
}