3 Replies Latest reply on May 7, 2017 4:11 PM by Atlionel

    Different Key Macros per session

    Atlionel Rookie

      We are under Wavelink Telnet on Windows CE

       

      We have two sessions, one is VT220 and the other is 5250

       

      since pressing F5 transmit nothing by default under a VT session, whe've added a Key Macro to generate Esc[15~ (mandatory in my customer's application)

       

      the problem is when we switch to the 5250 session and press F5 : the same key macro is generated instead of the expected 5250 F5

       

      Is there a possibility to specify in a key macro which session is concerned to avoid this problem ?

       

      Thanks

        • 1. Re: Different Key Macros per session
          Atlionel Rookie

          Solved with the following steps :

           

          1) Emulation/Common/Key Macro : CB7C:\001B[15~

           

          which means send Esc[15~ when Shift F13 is pressed

           

          2) Create a Script on F5 pressed (0x74) :

           

          Script( F5sousVT )

          Boolean( SessionOk )

          Number( NumSession )

          Activate( On_Key, 0x74, None )

              NumSession = Get_Session_Number

              SessionOk = Number_Equal( NumSession, 2 )         //  Session 1 is 5250 and Session 2 is VT

              If( SessionOk )

                  Keypress_Key( 0xCB7C )  //notes :  Keypress_Key("VT220","F5") sends nothing : useless

                                                            //             Scan_String("\001B[15~",0) returns the chain but with an Enter added : useless

                                                            //             therefore the solution is to simulate Shift F13

              Else

                  Keypress_Key( "5250", "F5" )

              End_If

              Return

          • 2. Re: Different Key Macros per session
            Matt Dermody SSMMVPGroup

            You came up with a creative scripting based solution that will certainly work, however this is a lot easier to accomplish through Emulation Parameters. There are actually Host Profile specific Emulation Parameters that override any global Emulation Parameters so that you can have Host Specific Key Macros.

             

            Host Profile Specific Key Macros.

             

            Alternatively, if you wanted to still use scripting, you could clean it up a little with Host Profile verification instead of the session check that you're performing. I worry that you're initializing two variables every time that script is triggered and Wavelink scripting is not the best when it comes to garbage collection...

             

            GUI Script Editor:

            Text Script Editor:

             

            Script( F5sousVT )

            Profile(VT Host Profile)

            Activate( On_Key, 0x74, None )

                    Keypress_Key( 0xCB7C )

                Return

             

            Script( F5sous5250 )

            Profile(5250 Host Profile)

            Activate( On_Key, 0x74, None )

                      Keypress_Key( "5250", "F5" )

                Return

            • 3. Re: Different Key Macros per session
              Atlionel Rookie

              you are right Matt,

               

              i've simply forgotten that you could override parameters the way you've described.

               

              great answer,

               

              Thanks,