Announcement

Collapse

Maintenance

The forum could be offline for 30-60 minutes in the very near future for maintenance (said 3pm Pacific). I was behind on getting this notice. I do apologize.
See more
See less

Esc key as permanent button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Esc key as permanent button

    Hi,
    finishing of PB/DOS programms is pretty simple (at anytime) by function key
    (for example F12):
    on key(31) GOSUB CAU
    key (31) on
    ~
    ~

    CAU:
    ~
    END
    Is any manner to replacing key F12 by Esc ?

    Thanks.



    ------------------
    Lubos
    A view on PowerBASIC

  • #2
    Keys 15-25 can be defined by the programmer:

    KEY 15, CHR$(0, 1) ' set key 15 to <ESC>

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Comment


    • #3
      Hi Tom,

      I must thank You for rapid answer. Anyway something is wrong.
      F12 works on my computer but Esc does not.

      Here is a source sample:

      print
      print "Try terminate input by Esc+Enter or by F12+Enter
      print "-------------------------------------------------"
      print
      AGAIN:
      key 15, chr$(0,1)
      on key(31) GOSUB CAU
      on key(15) GOSUB CAU
      key (15) on
      key (31) on
      Input "Here is an input. I want go to CAU now"; some$
      Print "String ";some$; " was inserted."
      print
      goto AGAIN
      CAU:
      Print "Program termined."
      end

      Maybe, I do some error.

      Lubos Svoboda

      ------------------
      Lubos
      A view on PowerBASIC

      Comment


      • #4
        Your program works fine here. Possibly, the scan code for <ESC> is
        different on your keyboard. You might want to run the "display scan
        codes for keys pressed" example in the online help, in the Keyboard
        Scan Codes section. That will let you see what the scan codes are
        on your computer.

        ------------------
        Tom Hanlin
        PowerBASIC Staff

        Comment


        • #5
          It was really a keyboard problem. Now it is OK. Thanks. :-)

          L. S.


          ------------------
          Lubos
          A view on PowerBASIC

          Comment

          Working...
          X