Menu

Uses of cursor movement keys outside of accept omitted.

GnuCOBOL
David Wall
2021-12-31
2022-01-02
  • David Wall

    David Wall - 2021-12-31

    Would it be possible to extend the keys passed to a cobol program.

    We can actually get access to a Ctrl Left Mouse key or a Alt Right Dbl click which do seem somewhat esoteric - considering we don't get access to a Shifted left key or a Ctrl right key or a Alt key up. These are equally valid keys.

    Similarly would it be possible to get access to the same keys tested for in accept omitted -
    IF the accept field was only 1 character in size. Home/End/Insert/Delete/Backspace would have no meaning in such cases and could be passed as normal instead of having some function in editing a multi character field.

    The mouse function certainly seems to have taken precedence over the keyboard nowadays.
    can't remember when I last did a Alt right double click. whereas a shifted left key seems somewhat normal.

     
    • Simon Sobisch

      Simon Sobisch - 2021-12-31

      If I remember correctly then things like modifier and positioning functions are at least partially consumed by screenio for "special" things.
      If you did not run it yet - please checkout the manual testsuite which works as in "now do ABC and tell me if XYZ did happen"; I think all of the "special" things are showcased this way. The manual testsuite is also quite useful when testing a curses library.

      New specialized things like those may be reserved for purposes like that.

      Other things can be added as new keys - we primary would need someone that comes up with a clean list of keys and their function codes for COBOL and their curses macros to be checked. You possibly are the missing piece ;-)

      In any case: Does the CALL routine for "get me a key" resolve the ones you want?

       

      Last edit: Simon Sobisch 2021-12-31
      • David Wall

        David Wall - 2021-12-31

        Certainly the 'getch' routine that Carl Goldin gave me gives me all the normal, shift, Ctl & Alt centrepad keys as well as the same for the normal characterset.

         
        • Simon Sobisch

          Simon Sobisch - 2021-12-31

          Sure, what about CBL_READ_KBD_CHAR?

           
          • David Wall

            David Wall - 2021-12-31

            Never tried it - wouldn't know how.

             
  • Eugenio Di Lorenzo

    Hi David,
    It is not clear to me if the following may be of interest in your case but if instead of anACCEPT OMITTED you perform anACCEPT of a single byte field (even a "dummy" field) with the WITH AUTO-SKIP option, then you can detect also the LEFT and RIGHT cursor keys testing the content of a CRT STATUS field.

     

    Last edit: Eugenio Di Lorenzo 2022-01-02
    • David Wall

      David Wall - 2022-01-02

      Yes Eugenio, it's just that I thought that since the compiler knows how long the field being accepted is - then IF it was a single char in size then the backspace, left, right, home & end insert & delete keys are irrelevant & could be passed thru.

       

Log in to post a comment.