Results 1 to 9 of 9
  1. #1
    2 Star Lounger
    Join Date
    Aug 2014
    Posts
    123
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Escaping the escape key

    Having trouble trying to use the echo statement to position characters on the screen for games.
    I read in a couple of places that the method is to press CTRL and P keys together then press Escape key. This is not working on my win 8.1 64 bit. It creates a caratized P and wipes out the echo that was typed.
    In Linux it is CTRL+V + escape plus [ key to create and escape. Naturally M$ does not use that either.

    Anyone done this before?

  2. #2
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 985 Times in 915 Posts
    Can you post what you are trying to type?

    cheers, Paul

  3. #3
    2 Star Lounger
    Join Date
    Aug 2014
    Posts
    123
    Thanks
    19
    Thanked 0 Times in 0 Posts
    Trying to create the commands which look like the following:
    echo <ESC>[31m creates red text
    echo <ESC>[4A moves cursor up 4 lines
    echo <ESC>[10;21H moves cursor to row 10 and column 21
    It is the <ESC> which I cannot create.
    I have tried CTRL+P, CTRL+[, CTRL+V and
    ALT+27.
    None work to create the escape character when put before the text mode [ character.
    There is no EDLIN or EDIT on windows 8.1.
    I have tried to do it in command mode in admin command prompt window and from Notepad and can get a symbol which I have read is the escape symbol of either the left pointing arrow or the right pointing solid triangle but when executed in the echo command they simply do nothing but display with the triangle or arrow preceding the characters normally used to color text or background or move cursor with no change in color or movement. Found good references in Dan Gookin's DOS books and the web but all my attempts to get results matching what they say fail.

  4. #4
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 985 Times in 915 Posts
    This page shows how to do it in some editors.
    I use Notepad++ and it's relatively easy to write it in Hex and then convert to ASCII.
    1. Enter 1B.
    2. Select "1B".
    3. Plugins > Convert > HEX to ASCII.
    You can even record a macro to do the work for you.

    cheers, Paul

  5. The Following User Says Thank You to Paul T For This Useful Post:

    spark55 (2015-04-15)

  6. #5
    2 Star Lounger
    Join Date
    Aug 2014
    Posts
    123
    Thanks
    19
    Thanked 0 Times in 0 Posts
    Thanks Paul, I had seen that page but there is no Notepad++ bundled with 8.1. The only process I can find that might work is to find an escape character in another file and copy it to where it is needed.

  7. #6
    WS Lounge VIP access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    1,725
    Thanks
    147
    Thanked 156 Times in 149 Posts
    Notepad ++ can be got from here - http://notepad-plus-plus.org/.It's not bundled with Windows

  8. The Following User Says Thank You to access-mdb For This Useful Post:

    spark55 (2015-04-15)

  9. #7
    2 Star Lounger
    Join Date
    Aug 2014
    Posts
    123
    Thanks
    19
    Thanked 0 Times in 0 Posts
    I prefer not to download Notepad++ but thanks for your effort.

    I am really caught between P.O.'d and confused over this. I tried copying from a text file the echo <EXC> put it into my Notepad text file as:
    echo <ESC>[1;41m hello which should print hello in red bold. This approach DOES NOT WORK on Win 8.1 despite the protestations to the contrary I found elsewhere. FWIW.
    I am still searching for a way to move characters on the screen in a text file program in Notepad and will report here if I can find the method. Why did M$ drop EDIT yet kept batch that logic ESCAPES me completely (pun intended).

  10. #8
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 985 Times in 915 Posts
    Notepad++ is a well known and trusted editor.

    Have you loaded ANSI.SYS? See this post.
    http://stackoverflow.com/questions/1...cape-sequences

    MS probably didn't see the need for an editor that could do anything more than basic text editing.

    cheers, Paul

  11. The Following User Says Thank You to Paul T For This Useful Post:

    spark55 (2015-04-17)

  12. #9
    2 Star Lounger
    Join Date
    Aug 2014
    Posts
    123
    Thanks
    19
    Thanked 0 Times in 0 Posts
    TNX again Paul!
    My quick exam of UR reference leads me away from copying ANSI.SYS as my system is 64bits not 32 and I am trying to do everything with bundled software. Similar to self flagellation.

    I have found a mechanism which seems to point in the right direction.
    Use of vbscript or wscript seems to allow building character code to represent keystrokes. Hopefully this will work to my satisfaction. Used search code with character creation and multi-key FWIW.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •