Page 1 of 1
Application: combining double mouse click with function key
Posted: 23 May 2019, 00:31
by Joerg Hamacher
Hi,
is it possible to create a general application rule that triggers SENDKEY(F4) when double clicking on an input field?
Cheers,
Joerg
Re: Application: combining double mouse click with function key
Posted: 28 May 2019, 15:13
by Fairdinkum
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