Numworks Epsilon  1.4.1
Graphing Calculator Operating System
keyboard_test_controller.cpp
Go to the documentation of this file.
2 extern "C" {
3 #include <assert.h>
4 }
5 #include <poincare.h>
6 
7 using namespace Poincare;
8 
9 namespace HardwareTest {
10 
11 KeyboardTestController::KeyboardTestController(Responder * parentResponder) :
12  ViewController(parentResponder),
13  m_keyboardView(),
14  m_screenTestController(nullptr)
15 {
16 }
17 
19  return &m_keyboardView;
20 }
21 
25  if (state == onlyKeyDown) {
26  m_keyboardView.setTestedKeyIndex(m_keyboardView.testedKeyIndex()+1);
27  if (m_keyboardView.testedKeyIndex() == Ion::Keyboard::NumberOfValidKeys) {
29  modal->displayModalViewController(&m_screenTestController, 0.0f, 0.0f);
30  }
31  }
32  return true;
33 }
34 
36  m_keyboardView.setTestedKeyIndex(0);
37 }
38 
39 }
40 
Responder * parentResponder() const
Definition: responder.cpp:12
constexpr int NumberOfValidKeys
Definition: keyboard.h:34
State scan()
Definition: keyboard.cpp:50
void displayModalViewController(ViewController *vc, float verticalAlignment, float horizontalAlignment, KDCoordinate topMargin=0, KDCoordinate leftMargin=0, KDCoordinate bottomMargin=0, KDCoordinate rightMargin=0)
Definition: view.h:23
bool handleEvent(Ion::Events::Event event) override
constexpr Key ValidKeys[]
Definition: keyboard.h:24