• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Double click event on a specific element in a FrameMaker document

Explorer ,
Jun 05, 2014 Jun 05, 2014

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

513

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 05, 2014 Jun 05, 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;

    }

...

Votes

Translate

Translate
Community Expert ,
Jun 05, 2014 Jun 05, 2014

Copy link to clipboard

Copied

Hi Trent,

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

Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 05, 2014 Jun 05, 2014

Copy link to clipboard

Copied

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;

    }

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 06, 2014 Jun 06, 2014

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines