1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Does variable expansion (ctrl-x) actually work?

Discussion in 'Support' started by dcantor, Sep 8, 2009.

  1. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    I tried using Ctrl-X to expand variables on a line I was typing at the command prompt. It does nothing.

    There is no reference to Ctrl-X in my ini-file, nor is there any reference to "variableexpand".

    What could possibly be interfering with Ctrl-X working?

    TCC 10.00.76 Windows XP [Version 5.1.2600]
    TCC Build 76 Windows XP Build 2600 Service Pack 3
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    dcantor wrote:

    Ctrl-X will only expand the variable at the cursor, not all of the
    variables on the line.

    Assuming you're putting the % at the beginning of the variable name, and
    the cursor is somewhere on the word (or immediately to the right), then
    it should work -- barring a plugin grabbing the key instead, a key alias
    using that key sequence, or a NormalKey / NormalEditKey directive
    overriding it.

    Rex Conn
    JP Software
     
  3. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    (Second attempt at answering this -- the first attempt seems to have disappeared.)

    I found that when the TCC window is detached from Take Command, Ctrl-X works as described, but when it's attached as a tab, Ctrl-X does not work.
    Is there a way to make Ctrl-X work within a Take Command tab?

    In researching the help file, I found the following error and omissions:

    1. There is an index entry for "Ctrll-C" which should be included with "Ctrl-C".

    2. The index entry for Ctrl-X does not have an entry for the Variable Expand page nor for the Command Line Editing Page.
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Here's something you might try. Close Take Command and run RegEdit. Navigate to HKCU\Software\JP Software\Take Command 10\Settings\NormalLayout. Find the "Shortcuts" key within NormalLayout and rename it to something different, say "Shortcuts.BAK". Exit RegEdit and restart Take Command. Has the problem gone away?
     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    dcantor wrote:

    You've either not enabled the Ctrl key for the TCC window (Options /
    Configure Take Command / Tabs), or you have an existing Ctrl-X menu
    shortcut defined in Take Command. (Right click on the menu and select
    "Customize".)

    Rex Conn
    JP Software
     
  6. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    rconn wrote:
    | Ctrl-X will only expand the variable at the cursor, not all of the
    | variables on the line.

    That's not my observation. Given the command line

    for %x in (%_hdrives) echo %z

    the cursor in the middle of "echo" %x, %z and %_hdrives were all expanded by
    the "VariableExpand" keystroke (ctrl-y here, ctrl-x is disabled using
    NormalKey directive). The values for %x and %z were the same as "set x" and
    "set z" showed (i.e., as they were before FOR was executed). _hdrives
    correctly listed the hard drives, but it also incorrectly listed my virtual
    disk. Identical operation in several TCC versions.
    --
    Steve
     
  7. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Thanks, Charles. I tried that -- it made no difference.
     
  8. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    I do have left-ctrl enabled for Take Command, and there is nothing that I can find in keyboard customization menus that has Ctrl-X assigned.

    This is really mystifying. Meanwhile, I've assigned F11 for this function (and that works), but I'd prefer a control character.
     
  9. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    Steve Fábián wrote:

    Your virtual disk is incorrectly identifying itself as a hard drive.

    Rex Conn
    JP Software
     
  10. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,859
    Likes Received:
    83
    dcantor wrote:

    If you have left-ctrl enabled for Take Command, then you can only use
    right-ctrl-X for the TCC variable expansion.

    Rex Conn
    JP Software
     
  11. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    On Wed, 09 Sep 2009 23:01:49 -0500, rconn <> wrote:

    |If you have left-ctrl enabled for Take Command, then you can only use
    |right-ctrl-X for the TCC variable expansion.

    I have left-ctrl checked in the options dialog but Ctrl-X with *either* ctrl key
    will do variable expansion. And as another pointed out, I get variable
    expansion regardless of where the cursor is (for example, in the middle of
    "echo" after typing "echo %_pid").
    --
    - Vince
     
  12. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Yes, I understood that. NEITHER ctrl key with X works.
     
  13. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    Re: Does variable expansion (ctrl-x) actually work?

    TCC 10.00.76 Windows XP [Version 5.1.2600]
    TCC Build 76 Windows XP Build 2600 Service Pack 3


    I believe in the old 4DOS days, ^X was the escape character. I still
    have that configured. Is there any chance you do?

    D:\>option escapechar
    escapechar=↑

    Curiously, either Ctrl key works for me, in spite of having only the
    left Ctrl (and Alt) reserved for TCMD.

    Does the Ctrl-X send a key code? I tested below using Ctrl-Q, since
    Ctrl-X does not insert anything. The 17 (Ctrl-Q) listed below would be
    24 if Ctrl-X just sent its code. Between the square brackets, press
    the Ctrl-X key once.

    D:\>echo %@ascii[â—„]
    17


    I don't get that behavior.

    D:\>set Q*
    Q1=one
    Q2=two
    Q3=three

    D:\>echo %Q1 %Q2 and %Q3 please{Cursor is here}
    I press Ctrl-X and the last line immediately changes to
    D:\>echo one two and three please


    On Wed, Sep 9, 2009 at 8:39 PM, dcantor <> wrote:



    --
    Jim Cook
    2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Sunday.
     
  14. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    Re: Does variable expansion (ctrl-x) actually work?

    Do you have any keystroke aliases that are in the way?

    D:\>alias @*


    On Thu, Sep 10, 2009 at 8:46 AM, Jim Cook <> wrote:



    --
    Jim Cook
    2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Sunday.
     
  15. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Re: Does variable expansion (ctrl-x) actually work?

    Jim Cook wrote:
    | TCC 10.00.76 Windows XP [Version 5.1.2600]
    | TCC Build 76 Windows XP Build 2600 Service Pack 3
    |
    |
    | I believe in the old 4DOS days, ^X was the escape character. I still
    | have that configured.

    I use 4DOS special characters, too. I have directives "NormalKey=ctrl-X" and
    "VariableExpand=Ctrl-Y" in my .INI files.

    At this time, when I long stopped using 4DOS, my main reason for not
    switching to the new defaults is the ton of references to the old ones in my
    batch files and aliases, though only the ParameterChar (&) is explicitly
    present in any of them, since it has no pseudovariable representation. I
    always use %= for EscapeChar and %+ for CommandSep in all files. I still
    wish there were a pseudovariable for the ParameterChar, even if Rex
    considers all of the special character pseudovariables obsolete.
    --
    Steve
     
  16. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Re: Does variable expansion (ctrl-x) actually work?


    No keystroke aliases whatsoever. Ctrl-X is not defined as the escape character.

    I tried ECHO %@ASC[<ctrl-x>] but the depression of Ctrl-X did not register. Interesting, I cannot enter Ctrl-X into anything in Take Command, but it works perfectly in every other application.

    I've also discovered that other console applications, when run in a Take Command tab do not receive the Ctrl-X. Obviously Take Command is eating this character for some reason, but I have no idea how to find out what.
     
  17. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    solved

    <ctrl-x>I got an idea after writing the previous reply.

    I went into Customize -> Keyboard and tried to assign Ctrl-X to Print...
    It told me that Ctrl-X was already assigned and asked me if I wanted to remove the definition. I answered affirmatively, and then actually did assign Ctrl-X to Print... Then I removed that definition, and

    lo and behold

    Ctrl-X now can be seen by any application running in a Take Command tab
    and, in particular, it works for VariableExpand in TCC.

    Rex, it would be nice if there were a way to find out what a keystroke is assigned to. In my case, it must have been assigned to some function (in Customize -> Keyboard) that was not visible. Perhaps it was a function that was visible in some earlier build of the product, but no longer is.

    Thanks to all for all the suggestions. It did eventually lead me to the solution.




    </ctrl-x>
     
  18. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    solved

    dcantor wrote:
    | I went into Customize -> Keyboard and tried to assign Ctrl-X to
    | Print...

    OK, I give up. I did not find "customize" in any TCMD / TCC menu. I also
    tried Windows Explorer (WinXP SP3), Internet Explorer (IE8), Regional and
    Language Options and Control Panel. Regional Options includes "key settings"
    to change keyboard language, but found nothing else.
    --
    Steve
     
  19. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    solved

    On Thu, 10 Sep 2009 13:03:10 -0500, Steve Fábián <> wrote:

    |OK, I give up. I did not find "customize" in any TCMD / TCC menu. I also
    |tried Windows Explorer (WinXP SP3), Internet Explorer (IE8), Regional and
    |Language Options and Control Panel. Regional Options includes "key settings"
    |to change keyboard language, but found nothing else.
    |--

    View ... Toolbars/Menus ... Customize
    --
    - Vince
     
  20. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    solved

    On Thu, Sep 10, 2009 at 11:33 AM, vefatica <> wrote:

    Also, right-click anywhere on the File \ Edit toolbar will bring up
    Customize as an option.

    --
    Jim Cook
    2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Sunday.
     
  21. dim

    dim Dimitry Andric

    Joined:
    May 31, 2008
    Messages:
    203
    Likes Received:
    0
    solved

    On 2009-09-10 20:33, vefatica wrote:

    Right-clicking on the toolbars themselves also gives a "Customize..." entry in its popup menu. :)
     
  22. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    solved

    vefatica wrote:
    | View ... Toolbars/Menus ... Customize

    Thanks Vince, found it. Since I normally run TCC only, I expected all
    customization to be part of TCMD or TCC configuration. However, I realize
    that many MS products split out the visual customization from "options" or
    even "customization", though IIRC keystroke shortcuts are typically under
    Tools ...

    I do agree with the OP's desire to have a list of currently assigned
    keystroke shortcuts available. It would be esp. nice if the keystrokes
    intercepted by the OS (and thus invisible to TCMD / TCC ) were also
    available, though I don't know if such a list were possible. Is there a
    Windows API capable to report whether or not a specific key combination is
    intercepted? I am currently struggling with choosing new shortcut keystrokes
    for desktop objects I use to start programs (e.g., various TCC versions),
    because a new alternate keyboard I plan to use occasionally uses the
    alt-ctrl-key combination for many characters, which I have been using for
    the desktop. I expect them to work when the current window is one of the MS
    office ones, or Outlook Express, Firefox, or TCC, without interfering with
    local window shortcuts.
    --
    Steve
     
  23. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,952
    Likes Received:
    30
    solved

    On Thu, 10 Sep 2009 14:36:56 -0500, Steve Fábián <> wrote:

    |I do agree with the OP's desire to have a list of currently assigned
    |keystroke shortcuts available.

    Have you ever seen that in an app? I don't think I have. I don't think it
    would be worth the (considerable) effort.
    --
    - Vince
     
  24. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    solved

    On Thu, Sep 10, 2009 at 1:21 PM, vefatica <> wrote:

    I believe UEStudio does (Advanced \ Configuration \ Toolbars / Menus \
    Key Mapping \ Show Key Mapping in Editor) and I greatly appreciate it.





    --
    Jim Cook
    2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Sunday.
     
  25. thedave

    Joined:
    Nov 13, 2008
    Messages:
    253
    Likes Received:
    2
    solved

    On Thu, 10 Sep 2009 15:21:28 -0500, vefatica <> was
    claimed to have wrote:


    I can think of a couple that do, usually in the form of a dialog that
    allows you to change keys (and in some cases, displaying non-changeable
    shortcut keys there too)

    Whether this is worth implementing or not, I'm not sure.
     
  26. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,190
    Likes Received:
    11
    solved

    Yeah. I was going to say most editors have the ability to show the
    keystroke mappings. Especially since most editors have the ability to
    remap the keys to make their editor behave like other editors so users
    don't have to relearn shortcuts.

    -Scott

    Jim Cook <> wrote on 09/10/2009 04:35:29 PM:


    think it

     
  27. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    solved

    vefatica wrote:
    | On Thu, 10 Sep 2009 14:36:56 -0500, Steve Fábián <> wrote:
    |
    || I do agree with the OP's desire to have a list of currently assigned
    || keystroke shortcuts available.
    |
    | Have you ever seen that in an app? I don't think I have. I don't
    | think it would be worth the (considerable) effort.

    Firefox and Outlook Express (both in Help); neither has dynamic assignment.
    Of course, neither has as many keys predefined as either TCMD or TCC, which
    are enumerated in tcmd.chm; however, none of the key mapping directives is
    accepted by either the @OPTION function, or by the OPTION command in its
    display mode, so there is no method available to retrieve the current
    settings.
    --
    Steve
     
  28. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Re: solved

    Right-click on the menu bar in the Take Command main window and you get a drop-down with "Customize...".
     

Share This Page