Absent Member.
Absent Member.

[archive] Backspace in grid

[Migrated content. Thread originally posted on 28 October 2010]

Is there a way to make the Backspace key function like the Delete key within a grid control? In other words, when a cell has focus in the grid & the Delete key is typed, the cell contents are deleted and the cell is activated for entry. Can I make the Backspace key do the same thing?
1 Reply
Absent Member.
Absent Member.

RE: [archive] Backspace in grid

you can use W$KEYBUF.

Example: (only some snippets from a programm i added my test)

       77  function-key-pressed
           is special-names crt status           pic 9(4).
           88  exit-button-pushed                value 13.
           88  exit-pushed                       value 900.
           88  event-occured                     value 96.
           88  screen-no-input-field             value 97.
           88  screen-time-out                   value 99.
           88  f1-pressed                        value 1.
           88  f2-pressed                        value 2.
           [COLOR="blue"][b]88  backspace-pressed                 value 54.[/b][/COLOR]


           perform until exit-button-pushed
               move    4 to accept-control
               accept  main-screen
                       on exception     perform on-exception
                       not on exception perform no-exception

           go to exit-programm.


       on-exception section.
           evaluate true
              when exit-pushed
                   set exit-button-pushed to true
              when backspace-pressed
                   evaluate control-id
                      when 101   [COLOR="DarkRed"]| Grid-ID[/COLOR]
[COLOR="Blue"][B]                           CALL "W$KEYBUF" USING "1", "{^M} {KX}"
                      when other
              when other


{^M} = Enter Pressed
{KX} = Delete

See my cblconfi:

KEYSTROKE Exception=44 Edit=End         KE
KEYSTROKE Exception=45 Edit=Down        kd
KEYSTROKE Exception=46 Edit=Up          ku
[COLOR="blue"][B]KEYSTROKE Exception=47 Edit=Delete      KX[/B][/COLOR]
KEYSTROKE Exception=48 Edit=Auto-Insert KI
KEYSTROKE Exception=49 Edit=Home        kh
KEYSTROKE Exception=50 Edit=Left        kl
KEYSTROKE Exception=51 Edit=Right       kr
KEYSTROKE Exception=52                  Kl
KEYSTROKE Exception=53                  Kr
KEYSTROKE Exception=54 Edit=Backspace   ZB
KEYSTROKE Exception=55                  KB
KEYSTROKE Exception=56                  K?
KEYSTROKE Exception=57                  KL
KEYSTROKE Exception=58                  KV
KEYSTROKE Exception=59                  ^V
[COLOR="blue"][B]KEYSTROKE Terminate=90                  ^M[/B][/COLOR]
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.