MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / sendKey

Function sendKey

core/extras.c:25–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25bool 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
39bool EMSCRIPTEN_KEEPALIVE sendLetterKeyPress(char letter) {
40 uint16_t key;

Callers 2

sendLetterKeyPressFunction · 0.70
doStuffMethod · 0.50

Calls 2

mem_peek_byteFunction · 0.85
mem_poke_byteFunction · 0.85

Tested by

no test coverage detected