Skip to main content
Inspiring
June 5, 2014
Answered

Double click event on a specific element in a FrameMaker document

  • June 5, 2014
  • 2 replies
  • 637 views

Using the Notification/Notify (FA_Note_PostMouseCommand/FA_Note_PostMouseCommand), I can check where in the structure or which element was clicked and if a specific element was clicked, a dialog window opens to perform certain actions. But I would like to have that action occur only on a double click.

Any suggestions?

Thanks,

Trent Schwartz

This topic has been closed for replies.
Correct answer frameexpert

This seems to work with FrameMaker 12:

#target framemaker

setupNotifications ();

function setupNotifications () {

  

    // Set notifications for after mouse command.

    Notification(Constants.FA_Note_PreMouseCommand, true);

}

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

  

    // Handle the mouse events.

    switch (note) {

        case Constants.FA_Note_PreMouseCommand :

        if (iparam === 16777269) {

            alert ("double-click on element");

        }

        break;

    }

}

2 replies

frameexpert
Community Expert
frameexpertCommunity ExpertCorrect answer
Community Expert
June 5, 2014

This seems to work with FrameMaker 12:

#target framemaker

setupNotifications ();

function setupNotifications () {

  

    // Set notifications for after mouse command.

    Notification(Constants.FA_Note_PreMouseCommand, true);

}

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

  

    // Handle the mouse events.

    switch (note) {

        case Constants.FA_Note_PreMouseCommand :

        if (iparam === 16777269) {

            alert ("double-click on element");

        }

        break;

    }

}

www.frameexpert.com
Inspiring
June 6, 2014

Yes, double click on the element or at the element insertion point.

Thank you very much! That's what I was looking for, the iparam value returned 16777269 for double-clicking on the element and 16777267 for double-clicking in the insertion point. I would receive 51 or 53 for the first click, but the second click seemed like it was ignored. Likely culprit being the procedure that was called, and cleaned up after experimenting with control+click 131072 last night (which control+click is the same value anywhere in the structure view window).

Thanks again!

Trent Schwartz

frameexpert
Community Expert
Community Expert
June 5, 2014

Hi Trent,

What are you double-clicking on? An element? Thanks.

Rick

www.frameexpert.com