MCPcopy Create free account
hub / github.com/PaulStoffregen/PS2Keyboard / read

Method read

PS2Keyboard.cpp:356–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354}
355
356int PS2Keyboard::read() {
357 uint8_t result;
358
359 result = UTF8next;
360 if (result) {
361 UTF8next = 0;
362 } else {
363 result = CharBuffer;
364 if (result) {
365 CharBuffer = 0;
366 } else {
367 result = get_iso8859_code();
368 }
369 if (result >= 128) {
370 UTF8next = (result & 0x3F) | 0x80;
371 result = ((result >> 6) & 0x1F) | 0xC0;
372 }
373 }
374 if (!result) return -1;
375 return result;
376}
377
378int PS2Keyboard::readUnicode() {
379 int result;

Callers

nothing calls this directly

Calls 1

get_iso8859_codeFunction · 0.85

Tested by

no test coverage detected