4 Replies Latest reply on Jun 6, 2017 12:29 PM by TomButler

    Velocity TE - how to map keys for MC92N0 / keys not working.

    Rookie

      We need to remap some keys for the MC92N0 to match application functionality in a TE / VT220 emulator.  I see that there is a ReplaceKey script in the LIbrary as an example, but it doesn't seem to work even when I hard code keyscan values.  Is there a different/easier way?

        • 1. Re: Velocity TE - how to map keys for MC92N0 / keys not working.
          TomButler SupportEmployee

          Which keys are you looking to map?     

          • 2. Re: Velocity TE - how to map keys for MC92N0 / keys not working.
            Rookie

            There's a few

            1) There's no underscore on the keyboard, so Ctrl-T to underscore.  Choosing this one because Blue+T is a dash, Green (ctrl)-T makes sense.

            2) Want to map up/down arrow keys at the top to Ctrl-D and Ctrl-U as application specific keys.  Left and right keys to Tab/Back Tab

            3) Ctrl keys don't seem to be working right, not sure why yet.  Not specifically looking ot map them yet, but mapping might be a solution

            4) similar with enter key being a tab.  I'd be willing to use another solution, but remapping it would be a solution too.

             

            I've done this many times before in the old TE, but that was just a macro like 0x1400:\0x005F...dead simple.

            • 3. Re: Velocity TE - how to map keys for MC92N0 / keys not working.
              TomButler SupportEmployee

              "1) There's no underscore on the keyboard, so Ctrl-T to underscore.  Choosing this one because Blue+T is a dash, Green (ctrl)-T makes sense."

              There are a couple ways to tackle this. One would be a custom keyboard with keys you need. I'd be happy to help you set this up quickly so there's no downtime.

              The VT hex value for the underscore _ is 005F . So this is what you would use in the included replace script, replacing whichever character you wanted to. (Again, I think the keyboard is the better choice if you are using the underscore on a regular basis).

               

              "2) Want to map up/down arrow keys at the top to Ctrl-D and Ctrl-U as application specific keys.  Left and right keys to Tab/Back Tab"

              UP = 4800

              DOWN = 5000

               

              CTRL+D = 0004

              CTRL+U = 0015

               

              However, again, I think a custom keyboard with these key macros built in would be better than having to use scripting.

               

              "3) Ctrl keys don't seem to be working right, not sure why yet.  Not specifically looking ot map them yet, but mapping might be a solution"

              I'd be happy to discuss this with you.

               

              "4) similar with enter key being a tab.  I'd be willing to use another solution, but remapping it would be a solution too."

              Again, let's sort this out.

               

              Contact me [email protected]

               

               

               

               

              • 4. Re: Velocity TE - how to map keys for MC92N0 / keys not working.
                TomButler SupportEmployee

                As for your questions about virtual keyboards they are mainly for devices without physical keyboards or can be used to provide shortcuts in addition to the physical keyboard. With virtual keyboard there is no need to catch and remap keys since you can assign any key value to a virtual key. Here is some more info…

                https://help.ivanti.com/wl/help/en_US/VelCon/1.2/admin/customKeyboards.htm

                 

                 

                For you issue of remapping keys, see below….

                 

                Attached is a script that will take 2 parameters. 1. The hex code of the key you want to catch and 2. The hex code of the key you want to replace it with. Simply import into your project, link to session and fill out the parameters like this for your Ctrl-t to _ …

                 

                 

                If you want to replace more keys then link more versions of the script and fill them out. Here is the source if you want to see how I did it (You can also poke around the script.)

                 

                        //Create a Function to send a new targeted KeyEvent

                        function replaceKey(event)

                        {

                //send the value using a key macro

                Device.sendKeys( "{hex:" + replacementKey + "}");

                 

                          //By setting event.Handled we make sure the original keypress does not go through

                event.eventHandled = true;

                        }

                 

                        //Register the onKey function to be called when a keypress occurs. Without this it will never run.

                WLEvent.onKey(keyToChange, replaceKey, "session");

                 

                 

                 

                If you were to do this statically insead of using parameters like I did then the source would look like this.

                 

                        //Create a Function to send a new targeted KeyEvent

                        function replaceKey(event)

                        {

                //send the value using a key macro

                Device.sendKeys( "{hex:0x5F}");

                 

                          //By setting event.Handled we make sure the original keypress does not go through

                event.eventHandled = true;

                        }

                 

                        //Register the onKey function to be called when a keypress occurs. Without this it will never run.

                WLEvent.onKey(0x14, replaceKey, "session");

                 

                 

                Also You may already know about this but I would recommend the following links for more info on Velocity.

                 

                This has great info on the scripting api

                https://community.ivanti.com/docs/DOC-42643

                 

                This has general Velocity info

                https://help.ivanti.com/wl/help/en_US/VelCon/1.2/admin/velocityConsoleHelp.htm

                 

                The code tester does match although it may not show 0x in front of a 2 digit code, you will need to add that.

                 

                The easiest way to map multiple keys would be in the UI, there is no need to modify the script itself. Instead do the following…

                 

                1. In the script tab select your script and press the button labeled “Link”

                2.Then when prompted use the default “session”, press OK (This will make the key swap valid for the entire session as opposed to a single screen or field.

                 

                3.Now you will have parameters you can fill out. Fill them out like this…

                 

                 

                4. Now repeat steps 1-3 for all other keys you want to remap. You will end up with multiple instances of the script for each key map.