function dispatch_press($ev) { extract($GLOBALS); if ($ev['mod'] & TB_MOD_ALT) { draw_key($K_LALT, TB_WHITE, TB_RED); draw_key($K_RALT, TB_WHITE, TB_RED); } $k = null; if ($ev['key'] >= TB_KEY_ARROW_RIGHT) { $k = $func_combos[0xffff - $ev['key']]; } else { if ($ev['ch'] < 128) { if ($ev['ch'] == 0 && $ev['key'] < 128) { $k = $combos[$ev['key']]; } else { $k = $combos[$ev['ch']]; } } } if (!$k) { return; } foreach ($k as $key) { draw_key($key, TB_WHITE, TB_RED); } }
function dispatch_press(Event $event, TermBox $tb) { if ($event->getMode() & Constants::TB_MOD_ALT) { draw_key($tb, "K_LALT", Constants::TB_WHITE, Constants::TB_RED); draw_key($tb, "K_RALT", Constants::TB_WHITE, Constants::TB_RED); } }