From: Jos v.d.V. <jo...@us...> - 2007-07-04 11:23:42
|
Update of /cvsroot/win32forth/win32forth-stc/src/console In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9283 Modified Files: ConsoleMenu.f Log Message: Jos: Enabled the control-keys: ^A ^C ^V ^L in the console. Index: ConsoleMenu.f =================================================================== RCS file: /cvsroot/win32forth/win32forth-stc/src/console/ConsoleMenu.f,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ConsoleMenu.f 20 May 2007 15:36:21 -0000 1.7 --- ConsoleMenu.f 4 Jul 2007 11:23:35 -0000 1.8 *************** *** 12,15 **** --- 12,88 ---- INTERNAL \ internal definitions start here + \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + \ paste clipboard into the keyboard + \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + + 0 value paste-ptr + 0 value paste-len + 0 value paste-off + 0 value paste-hdl + + : macro/paste-close ( -- ) \ turn off macros and paste on error + ['] noop is auto_key \ disable playkey + ['] noop is auto_key? \ disable playkey? + \ PlayClose: key-log-file + paste-hdl 0= ?exit + paste-hdl call GlobalUnlock drop \ unlock it, done + 0 to paste-hdl \ clear handle + Call CloseClipboard ?win-error ; \ close clipboard + + forth-io-chain chain-add macro/paste-close \ turn off paste on error + + : paste1key ( -- ) + x_key? 0= + if paste-off paste-len u< 0= + if macro/paste-close + else paste-ptr paste-off + c@ \ get next key + 1 +to paste-off \ skip paste it + dup 0x0D = \ if its CR + if 1 +to paste-off \ skip LF + then pushkey \ push the key + then + then ; + + 0 value play0cnt + 50 value playrate + + : paste1key? ( f1 -- f1 ) + dup 0= + if play0cnt 1 < + if paste1key + playrate 0max to play0cnt + else -1 +to play0cnt + then + then ; + + : paste-load ( -- ) + \ *G Copy text from the clipboard to the console window and compile it. + conhndl call OpenClipboard 0= + if beep + else CF_TEXT call GetClipboardData ?dup + if dup to paste-hdl + call GlobalLock dup to paste-ptr \ lock memory + 0= if call CloseClipboard drop exit then + paste-ptr zcount nip dup to paste-len \ get len + if 0 to paste-off + 0 to play0cnt + 0x0 pushkey \ kick start playkeys + ['] paste1key is auto_key + ['] paste1key? is auto_key? + paste1key + else beep + 0 to paste-ptr + 0 to paste-len + 0 to paste-off + paste-hdl call GlobalUnlock drop \ unlock it, done + call CloseClipboard ?win-error + then \ cleanup for clipboard + else beep + Call CloseClipboard ?win-error + then + then ; + + \ ' _paste-load is paste-load + : copy-console { \ gblhndl gblptr b/l l/s len -- } \ *G Copy text to Windows clipboard *************** *** 170,177 **** ledit-chain chain-add ?f1-help \ help key recognition : ?macro-keys ( chad flag -- char flag ) dup ?exit ! over [ 'S' +k_control +k_shift ] literal = if 0= start/stop-macro EXIT then over [ 'M' +k_control +k_shift ] literal = --- 243,253 ---- ledit-chain chain-add ?f1-help \ help key recognition + )) : ?macro-keys ( chad flag -- char flag ) dup ?exit ! ! ! (( over [ 'S' +k_control +k_shift ] literal = if 0= start/stop-macro EXIT then over [ 'M' +k_control +k_shift ] literal = *************** *** 184,192 **** if 0= open-web EXIT then over [ K_F12 ] literal = ! if 0= 2>r >r LoadProject r> 2r> EXIT then over [ 'L' +k_control ] literal = if 0= load-forth EXIT then ! over [ 'P' +k_control ] literal = ! if 0= print-screen EXIT then over [ 'X' +k_control ] literal = if 0= cut-console --- 260,270 ---- if 0= open-web EXIT then over [ K_F12 ] literal = ! if 0= 2>r >r LoadProject r> 2r> EXIT then )) ! ! over [ 'L' +k_control ] literal = if 0= load-forth EXIT then ! \ over [ 'P' +k_control ] literal = ! \ if 0= print-screen EXIT then over [ 'X' +k_control ] literal = if 0= cut-console *************** *** 201,210 **** if 0= paste-load EXIT then turnkeyed? ?exit ! over [ 'D' +k_control ] literal = ! if 0= ChdirDlg EXIT then ; ledit-chain chain-add ?macro-keys \ add macro key recognition \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ --- 279,289 ---- if 0= paste-load EXIT then turnkeyed? ?exit ! \ over [ 'D' +k_control ] literal = ! \ if 0= ChdirDlg EXIT then ; ledit-chain chain-add ?macro-keys \ add macro key recognition + (( \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ |