From 2da14920255c9820fc3bc8b19d99469a85cce199 Mon Sep 17 00:00:00 2001 From: mcmlxxix <> Date: Thu, 30 Sep 2010 17:46:20 +0000 Subject: [PATCH] handle control keys (just control-C for now, to prevent funking up the display by aborting output) --- exec/cshell.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/exec/cshell.js b/exec/cshell.js index ab860e09e7..428cfa96f5 100644 --- a/exec/cshell.js +++ b/exec/cshell.js @@ -67,7 +67,6 @@ var left=new LeftWindow(); function init() { loadSettings(); - bottom.init(); right.init(); center.init(); @@ -97,7 +96,8 @@ function shell() case ctrl('T'): /* CTRL-T Time Info */ case ctrl('K'): /* CTRL-K Control Key Menu */ case ctrl('P'): /* Ctrl-P Messages */ - controlkeys.handle(key); + case ctrl('C'): /* Ctrl-P ABORT */ + handleCtrlKey(cmd); continue; case KEY_UP: lightBarUp(left.menu); @@ -154,7 +154,8 @@ function shell() case ctrl('T'): /* CTRL-T Time Info */ case ctrl('K'): /* CTRL-K Control Key Menu */ case ctrl('P'): /* Ctrl-P Messages */ - controlkeys.handle(key); + case ctrl('C'): /* Ctrl-P ABORT */ + handleCtrlKey(cmd); continue; case " ": redraw(); @@ -236,6 +237,14 @@ function cycle() } /* GLOBAL FUNCTIONS */ +function handleCtrlKey(key) +{ + switch(key) { + case ctrl('C'): /* Ctrl-P ABORT */ + console.aborted=false; + break; + } +} function getHotkey(item) { var index=item.indexOf("|")+1; @@ -243,7 +252,6 @@ function getHotkey(item) } function redraw() { - console.aborted=false; console.clear(ANSI_NORMAL); drawTopline(); drawOutline(); @@ -257,9 +265,8 @@ function redraw() menuinfo[left.currentmenu](); } - bbs.sys_status|=SS_MOFF; bbs.sys_status|=SS_PAUSEOFF; - console.ctrlkey_passthru="+KOPTU"; + console.ctrlkey_passthru="+KOPTUC"; full_redraw=false; } function loadWallPaper(file) @@ -555,7 +562,6 @@ function clear_screen() * it. */ - bbs.sys_status&=~SS_MOFF; bbs.sys_status&=~SS_PAUSEOFF; console.clear(ANSI_NORMAL); full_redraw=true; -- GitLab