Quantcast
Channel: Adobe Community: Message List - How can I catch a keyboard input and return another character to Framemaker?
Viewing all articles
Browse latest Browse all 12

Re: How can I catch a keyboard input and return another character to Framemaker?

$
0
0

A working script for the catch and replace issue:

Notification(Constants.FA_Note_PreFunction);

 

function Notify(note, object, sparam, iparam) {

switch (note) {

    case Constants.FA_Note_PreFunction:

        if (sparam=="z") {

            var tl=app.ActiveDoc.AddText(app.ActiveDoc.TextSelection.beg,"y");

            var tr= new TextRange(tl, tl);

            app.ActiveDoc.ScrollToText(tr);

            ReturnValue(Constants.FR_CancelOperation);

        }

    break;

    }

}

It is not perfect, but it works just fine (at least when you are not typing too fast, i.e. on a normal user typing rate).

But there is still the issue with the iparam that always returns an invalid object (alert(iparam) says "[object InvalidObject]").

And how do I execute an f-code like "pressing" the tab-key, when the user presses an arrow key?


Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>