[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re:
- Subject: Re:
- From: cld@xxxxxxxx (Carl Distefano)
- Date: Sun, 12 Dec 2004 16:05:00 -0500
Reply to note from Harry Binswanger Sat, 11 Dec
2004 22:58:16 -0500
> As I understand it, we can no longer do kbd programming in the
> kbd file of Xy4DOS.
Untrue! Issue HELP KBD PROGRAMMING and read the Help
screen (scroll up to the beginning). The required U2 routine is
called XMACRO, which can be abbreviated to XM.
> I've long wanted to use my ENTER key as my . I can't
> put a macro inside U2 to take care of this, because the
> is what calls U2 in the first place.
Non sequitur. There is no feedback loop or use-mention quandary at
play here -- none at all. Otherwise how could any Helpkey work?
The Helpkey routine, PrsCMline, the one that "calls U2 in the first
place", is "inside U2". And, as you know, it does work.
> Is there any way to do this?
Sure there is. If all you want is a plain-vanilla Helpkey, just map
the usual Helpkey assignment to key 28 or 104 (I assume throughout
that you Stack commands with $S; if not, delete "$S" from all
examples):
28=NO$SJM(,2,.,P,r,s,C,M,l,i,n,e,)
However, I suspect that you'd like to continue to use your Enter key
to input the carriage return in text, and only launch a U2 routine
when the cursor is on the CMline -- and that's why your thoughts
turned to KBD file programming. If so, then this KBD file program
works (DECODE it first):
XPLeNCODE v2.0
b-gin [UNTITLED]
28=NO$SJM(,2,.,P,r,s,K,b,d,A,r,g,),x,m, ,[,I,F,[,V,A,$,T,X,],
<,1,],COJ,M,2,.,P,r,s,C,M,l,i,n,e,Q,2,[,E,X,],[,E,I,],[255+04
8+068],NO[cr|lf][cr|lf]
-nd
XPLeNCODE
But surely you don't want to lose the ability to execute native
commands with your Enter key as well. The following allows you to
execute either a native command or a U2 frame when the cursor is on
the CMline:
XPLeNCODE v2.0
b-gin [UNTITLED]
28=NO$SJM(,2,.,P,r,s,K,b,d,A,r,g,),x,m, ,[,I,F,[,V,A,$,T,X,],
<,1,],COB,X,e,s, ,1,Q,2,X,C,[,I,F,@,N,O,T,(,[,E,R,],),],COB,X
,e,s,Q,2,[,E,X,],[,E,I,],COJ,M,2,.,P,r,s,C,M,l,i,n,e,Q,2,[,E,
X,],[,E,I,],[255+048+068],NO[cr|lf][cr|lf]
-nd
XPLeNCODE
You'll quickly find that there are tradeoffs galore associated with
using Enter as the Helpkey. One disadvantage of the preceding macro
is that any error message associated with the native command is
smothered by the code that branches to the Helpkey. You can avoid
that if you're willing to endure a beep every time you execute a
Help frame:
XPLeNCODE v2.0
b-gin [UNTITLED]
28=NO$SJM(,2,.,P,r,s,K,b,d,A,r,g,),x,m, ,[,I,F,[,V,A,$,T,X,],
<,1,],COX,C,[,I,F,@,N,O,T,(,[,E,R,],),],[,E,X,],[,E,I,],COJ,M
,2,.,P,r,s,C,M,l,i,n,e,Q,2,[,E,X,],[,E,I,],[255+048+068],NO[c
r|lf][cr|lf]
-nd
XPLeNCODE
An alternative workaround is to use U2 routine PrsExeCM instead of
func XC and frame PrsCMline. But then you need to remember to
precede U2 framenames with a period on the CMline. In other words,
the native ABort command would be AB, but the U2 framename AB
would be issued as .AB. Try it:
XPLeNCODE v2.0
b-gin [UNTITLED]
28=NO$SJM(,2,.,P,r,s,K,b,d,A,r,g,),x,m, ,[,I,F,[,V,A,$,T,X,],
<,1,],COJ,M,2,.,P,r,s,E,x,e,C,M,Q,2,[,E,X,],[,E,I,],[255+048+
068],NO[cr|lf][cr|lf]
-nd
XPLeNCODE
Finally, you can avoid KBD file programming by reconstituting any of
the above keyboard macros as a U2 frame, and assigning the framename
to the Enter key in the usual way. For example, we can create a U2
frame that calls frame PrsExeCM as in the preceding example. Let's
name the new frame HelpOrCr:
XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5HelpOrCr}} Use Enter key to execute native command or fra
mename if cursor is on CMline; else put CrLf[cr|lf]{002}{<}IF
{<}VA$TX{>}<1{>}[JM_]2.PrsExeCM[Q2_]{<}EX{>}{<}EI{>}[255+048+
068]{002}[cr|lf][cr|lf]
-nd
XPLeNCODE
If you add this frame to U2 (DeFine it and issue ADD2U2),
then the KBD file assignment becomes, simply:
28=NO$SJM(,2,.,H,e,l,p,O,r,C,r,)
--
Carl Distefano
cld@xxxxxxxx