Roberto Nicchi Posted August 7, 2022 Share Posted August 7, 2022 Hello, look at the attached demo app. Seems that the monitored key is ignored if the focused control is a TuniHTMLMemo. The default browser action is executed instead of the code in the onkeydown event of the form. Roberto Project1.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 8, 2022 Share Posted August 8, 2022 12 hours ago, Roberto Nicchi said: Seems that the monitored key is ignored if the focused control is a TuniHTMLMemo. Hello, Workaround: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniHTMLMemo1.JSInterface.JSAddListener('boxready', 'function(me){Ext.defer(function(){me.iframeEl.dom.contentDocument.body.addEventListener("keydown", function(e) {if (e.key=="F5") {e.preventDefault(); '+ Self.WebForm.JSForm.JSName +'.fireEvent("keydown", '+ Self.WebForm.JSForm.JSName +', e.keyCode, 0)}})}, 1000)}'); end; Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted August 8, 2022 Author Share Posted August 8, 2022 2 hours ago, Sherzod said: Hello, Workaround: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniHTMLMemo1.JSInterface.JSAddListener('boxready', 'function(me){Ext.defer(function(){me.iframeEl.dom.contentDocument.body.addEventListener("keydown", function(e) {if (e.key=="F5") {e.preventDefault(); '+ Self.WebForm.JSForm.JSName +'.fireEvent("keydown", '+ Self.WebForm.JSForm.JSName +', e.keyCode, 0)}})}, 1000)}'); end; Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.