Application: combining double mouse click with function key

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
Joerg Hamacher
Posts: 16
Joined: 09 Mar 2016, 00:29

Application: combining double mouse click with function key

Post by Joerg Hamacher » 23 May 2019, 00:31

Hi,
is it possible to create a general application rule that triggers SENDKEY(F4) when double clicking on an input field?

Cheers,
Joerg

Fairdinkum
Posts: 35
Joined: 24 Jul 2017, 17:02

Re: Application: combining double mouse click with function key

Post by Fairdinkum » 28 May 2019, 15:13

Hi Joerg,

Copy the following code into onArrive or push button's onClick. It looks like it is working in house.
This sample adds double click events to <input type='text'> and <textarea> in div#terminalContent.

Note: It contains an internal function AXES.Terminal.postAIDKey().

Code: Select all

// terminalContent(アプリケーションウィンドウ)内のエレメントを取得
var elms = document.getElementById("terminalContent").childNodes; 

/*
 * 取得した全エレメントを評価
 */
for( var i=0; i < elms.length; i++ ){
  if ( elms[i].childNodes[0] ){
    var el = elms[i].childNodes[0];
    console.log("el="+el);
    // <input>タグで絞り込み
    if ( el.tagName.toLowerCase() === "input" ){
      // text属性(type=text)で絞り込み
      if ( el.type ){
        if ( el.type.toLowerCase() === "text" ){
          /*
           * Add doubleClick event
           */
          el.setAttribute(
            "onDblClick",
            "AXES.Terminal.postAIDKey('F4');"
          );
        }
      }
    }
  
    // <textarea>タグで絞り込み
    if ( el.tagName.toLowerCase() === "textarea" ){
      /*
       * Add doubleClick event
       */
      el.setAttribute(
        "onDblClick",
        "AXES.Terminal.postAIDKey('F4');"
      );
    }
  }
}
Sorry most comment lines are Japanese.


Hope this helps.

Best Regards,
Hidekazu Tanaka

Post Reply