Numworks Epsilon  1.4.1
Graphing Calculator Operating System
keyboard.cpp
Go to the documentation of this file.
1 #include "command.h"
2 #include <ion.h>
3 
4 namespace Ion {
5 namespace Device {
6 namespace Bench {
7 namespace Command {
8 
9 void Keyboard(const char * input) {
10  if (input != nullptr) {
12  return;
13  }
14  char result[9+Ion::Keyboard::NumberOfKeys+1] = { 'K', 'E', 'Y', 'B', 'O', 'A', 'R', 'D', '=' };
16  for (uint8_t i=0; i<Ion::Keyboard::NumberOfKeys; i++) {
17  result[9+i] = state.keyDown((Ion::Keyboard::Key)i) ? '1' : '0';
18  }
19  result[9+Ion::Keyboard::NumberOfKeys] = 0;
20  reply(result);
21 }
22 
23 }
24 }
25 }
26 }
const char *const sSyntaxError
Definition: command.cpp:11
unsigned char uint8_t
Definition: stdint.h:4
constexpr int NumberOfKeys
Definition: keyboard.h:33
bool keyDown(Key k) const
Definition: keyboard.h:47
State scan()
Definition: keyboard.cpp:50
void reply(const char *s)
Definition: command.cpp:15
void Keyboard(const char *input)
Definition: keyboard.cpp:9
Definition: backlight.h:6