function pretty_print_resize($ev) { printf_tb(3, 19, TB_WHITE, TB_DEFAULT, "Resize event: %d x %d", $ev['w'], $ev['h']); }
function pretty_print_press(TermBox $tb, Event $event) { printf_tb($tb, 3, 19, Constants::TB_WHITE, Constants::TB_DEFAULT, "Key: "); printf_tb($tb, 8, 19, Constants::TB_YELLOW, Constants::TB_DEFAULT, sprintf("decimal: %d", $event->getKey())); printf_tb($tb, 8, 20, Constants::TB_GREEN, Constants::TB_DEFAULT, sprintf("hex: 0x%X", $event->getKey())); printf_tb($tb, 8, 21, Constants::TB_CYAN, Constants::TB_DEFAULT, sprintf("octal: 0%o", $event->getKey())); //printf_tb($tb, 8, 22, Constants::TB_RED , Constants::TB_DEFAULT, sprintf("string: %s", funckeymap(ev->key))); printf_tb($tb, 54, 19, Constants::TB_WHITE, Constants::TB_DEFAULT, "Char: "); printf_tb($tb, 60, 19, Constants::TB_YELLOW, Constants::TB_DEFAULT, sprintf("decimal: %d", $event->getChar())); printf_tb($tb, 60, 20, Constants::TB_GREEN, Constants::TB_DEFAULT, sprintf("hex: 0x%X", $event->getChar())); printf_tb($tb, 60, 21, Constants::TB_CYAN, Constants::TB_DEFAULT, sprintf("octal: 0%o", $event->getChar())); printf_tb($tb, 60, 22, Constants::TB_RED, Constants::TB_DEFAULT, sprintf("string: %s", $event->getChar())); printf_tb($tb, 54, 18, Constants::TB_WHITE, Constants::TB_DEFAULT, "Modifier: " . ($event->getMode() ? "TB_MOD_ALT" : "none")); }