[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference eps::command_procedures

Title:Welcome to the new DCL hackers home on EPS::
Moderator:EPS::VANDENHEUVEL
Created:Thu Jul 14 1994
Last Modified:Mon May 12 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1820
Total number of notes:10378

1818.0. "Function key F13 " by KAOFS::P_CHAPLINSKY () Tue Feb 11 1997 18:50

    I'm stumped and maybe someone can help me?  I simply want to check
    if the function key F13 (LF) CSI 2 5 has been depressed.   
    
     I wrote something like
    
     $ esc[0,8] = 27
     $ key = esc+"25"
     $ inquire special_key "Special key"
     $ if special_key .eqs. key then goto label
     $ exit
     $ label:
     $ write "The function key F13 was depressed"
     $ exit
     
     $ @file.com
     Special key:
     $
    
     Thanks,
    
     PChaplinsky
     
T.RTitleUserPersonal
Name
DateLines
1818.1SPSEG::PLAISTEDSubspace Gaseous AnomalyTue Feb 11 1997 21:0432
Escape sequences have to be done through programs that can interface via $QIO
system services eventually.

Ciao.  Grahame

$!
$!  See DCL Dictionary DEFINE/KEY for more information on the need
$!  for setting the terminal to NOLINE_EDITING
$!
$   LineEditingEnabled = F$GETDVI( "TT:", "TT_EDITING" ) 
$   If LineEditingEnabled Then Set Terminal/NoLine_Editing
$!
$!  If you want the word "SPECIAL_KEY" to echo on the screen, remove
$!  the /NoEcho qualifier
$!
$
$   Define/Key/NoLog F13 SPECIAL_KEY/Terminate/NoEcho
$
$
$   Inquire KeyPressed "Special key"
$
$   If KeyPressed .Eqs. "SPECIAL_KEY" Then -
       Write Sys$Output "The function key F13 was depressed"
$
$!
$!  Restore former setting.
$!
$   If LineEditingEnabled Then Set Terminal/Line_Editing
$
$
$   Exit

1818.2I really appreciate your replyKAOFS::P_CHAPLINSKYWed Feb 12 1997 16:349
    Grahame - Thanks, thanks, thanks.  It works like a charm.
    
    $ @test
    Special key: <depressed the F13 key
    The function key F13 was depressed
    
    I would have spent a lot of time trying to resolve this.  Thanks again.
    
    PChaplinsky
1818.3AUSS::GARSONDECcharity Program OfficeWed Feb 12 1997 19:3813
    re .*
    
    Note that this solution relies on using INQUIRE rather than READ. Using
    INQUIRE has two possible disadvantages viz. it is insecure and cannot
    be used in command procedures that are captive or intended to be
    captive, and text entered is placed in the command recall buffer.
    
    Note also that unconditionally redefining a key is somewhat
    anti-social. However I am not sure that there is a clean way of
    saving/restoring key definitions.
    
    To process escape sequences sanely in DCL really requires a program.
                                     
1818.4SPSEG::PLAISTEDSubspace Gaseous AnomalyFri Feb 14 1997 15:204
Ah, yes.  Good point.  If the recall buffer is an issue, use the /NOECHO.  That
will prevent it from getting stuffed in the recall buffer.

Grahame
1818.5Already done it, details attachedTAV02::HANOCHWho ? Me Worried ?Wed Feb 19 1997 05:3313
>
>Escape sequences have to be done through programs that can interface via $QIO
>system services eventually.              
>

I've already done the job. Look at HANOCH::GETKEY.BCK It's a saveset 
holding 3 files. Run the INSTALL.COM procedure. It will add a new command to
your DCL table, getkey, which its usage is as follows:

$ getkey symbol-name-to-get-value-of-pressed-key prompt-string

Good luck,
Hanoch