| 23 | } |
| 24 | |
| 25 | bool EMSCRIPTEN_KEEPALIVE sendKey(uint16_t key) { |
| 26 | uint8_t flags = mem_peek_byte(CE_graphFlags2); |
| 27 | if (flags & CE_keyReady) { |
| 28 | return false; |
| 29 | } |
| 30 | if (key < 0x100) { |
| 31 | key <<= 8; |
| 32 | } |
| 33 | mem_poke_byte(CE_kbdKey, (uint8_t)(key >> 8)); |
| 34 | mem_poke_byte(CE_keyExtend, (uint8_t)(key & 0xFF)); |
| 35 | mem_poke_byte(CE_graphFlags2, flags | CE_keyReady); |
| 36 | return true; |
| 37 | } |
| 38 | |
| 39 | bool EMSCRIPTEN_KEEPALIVE sendLetterKeyPress(char letter) { |
| 40 | uint16_t key; |
no test coverage detected