Ver Mensaje Individual
  #5
Antiguo 24 de mayo de 2019, 19:24
Kuk
Administrador
Última Actividad 19.09.2026 20:11
Posts Posts: 2.500
Likes enviados Enviados: 1037
Likes recibidos Recibidos: 1207

Josber, no, porque el asunto se basa en eventos, cada evento ejecuta nueva instancia del código, con lo cual el mismo campo no puede tener 2 valores.

Begoguay, lo que necesitas es el evento KeyDown:

Código COBOL:
  1.  ENVIRONMENT     DIVISION.
  2.  DATA            DIVISION.
  3.  WORKING-STORAGE SECTION.
  4.  LINKAGE         SECTION.
  5.  01  POW-ARG-KEYCODE PIC S9(4) COMP-5.
  6.  01  POW-ARG-SHIFT   PIC S9(4) COMP-5.
  7.  PROCEDURE       DIVISION USING POW-ARG-KEYCODE POW-ARG-SHIFT.
  8.      
  9.      IF  POW-ARG-SHIFT = POW-SHIFTSTATE-CTRL AND
  10.          POW-ARG-KEYCODE = POW-KEY-ESCAPE
  11.          INVOKE POW-SELF "DisplayMessage" USING "Ctrl+Esc" 64
  12.      END-IF
  13.      

Cita:
KeyDown Event

Description:
Generated when a key is pressed and passed to the control that has the focus.

The KeyPress and KeyUp events are usually generated after the KeyDown event.

If a key is pressed and kept pressed, multiple KeyDown and KeyPress events are generated before a KeyUp event.

Note that if you press a toggle key (e.g. Caps Lock, Num Lock):

· The order of events may be changed.

· One of these events may not be generated.

To support special keystrokes, such as short-cuts, on the form, see the PreKeyDown.

...

Parameters:
  1. [VT_I4 – Index S9(9) COMP-5]
  2. VT_I2 – KeyCode S9(4) COMP-5
  3. VT_I2 – ShiftState S9(4) COMP-5

Description of parameters (with constants):
1. Index: When the control is part of an array, Index contains the control's index in the array.

2. KeyCode: The key code that was pressed. See Key Code Constants for details of key codes.

3. ShiftState: Bit mask settings indicate the state of each of the shift keys - Shift, Ctrl and ALT. Numbering the bits 1 to 8, from least significant to most significant, the bit mapping is:
1 - Shift key (POW-SHIFTSTATE-SHIFT)
2 - Ctrl key (POW-SHIFTSTATE-CTRL)
3 - Alt key (POW-SHIFTSTATE-ALT)
For example if the parameter has a value of 6 (binary 00000110), this indicates that the Ctl and Alt keys are depressed.



NORMAS DEL FORO - para garantizar el buen funcionamiento del Foro.
¿Te han ayudado? NO TE OLVIDES de darle a
¿Quieres dirigirte a alguien en tu post? Notifícale haciendo clic en su Nick
Kuk is offline   Responder Con Cita