Dialog 3.0 What key was pressed ? 
Author Message
 Dialog 3.0 What key was pressed ?

Hi,

Is there a way to transfer what key was pressed back to the cobol program after
the entry field is completed ? For example i am setting focus to an Entry
Field. The user enters a number and then depresses one of the twelve function
keys. i would like to send a code back to my cobol program indicating which key
was depressed. Is the ASCII key code value stored somewhere in Dialog that i
can pass back to my cobol program ?  There are about 50 different key
combinations that i want to allow in my program so i don't want to have to do a
large if statement to send back codes to my cobol program.

Thanks,

Bob Hennessey



Mon, 24 Jul 2000 03:00:00 GMT  
 Dialog 3.0 What key was pressed ?


Quote:
>Hi,

>Is there a way to transfer what key was pressed back to the cobol program after
>the entry field is completed ? For example i am setting focus to an Entry
>Field. The user enters a number and then depresses one of the twelve function
>keys. i would like to send a code back to my cobol program indicating which key
>was depressed. Is the ASCII key code value stored somewhere in Dialog that i
>can pass back to my cobol program ?  There are about 50 different key
>combinations that i want to allow in my program so i don't want to have to do a
>large if statement to send back codes to my cobol program.

Two ways.

First you can code the key events in the dialog for the object.  Each
valid key will have an event - use the prompted mode of the editor to
see what keys/events you can capture - you can get them all.

F1
F2 etc, even ENTER which is CR in Dialog.

Then in the event code, do a move of an indicator to a field in the
data block:

MOVE "F1" KEY-PRESSED

Then do a RETC to go back to your program.

The second method:

Chuck the dialog.  Use COBOL SP2 from Flexus http:..www.flexus.com,
and you can directly tell which key was pressed.



Mon, 24 Jul 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to capture key-presses (keyboard-presses)???

2. Pressing Escape in a listbox results in a Tcl error dialog

3. - disabling the exit validation within a dialog when the cancel button has been pressed

4. Press Release: Version 3.0 of IBM VisualAge for Smalltalk

5. Information from ObjectShare's press releases on VisualWorks 3.0

6. IBM VA close window upon key pressed event

7. Tracking key presses, mouse clicks and mouse movements?

8. many keys pressed at the same time

9. Command-key presses

10. Changing the cursor when control key pressed.

11. Key press events on a window

12. Selecting TAB sheet by pressing TAB key

 

 
Powered by phpBB® Forum Software