arilotta Posted September 21, 2018 Share Posted September 21, 2018 Hi all, it seems that UniHTMLMemo does not fire events OnKeyDown and OnKeyUp. Is there any workaround ? Thanks Andrea Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 21, 2018 Share Posted September 21, 2018 Hi, A workaround (without ShiftState), for example for "keydown": function initialize(sender, eOpts) { var me=sender; me.getDoc().addEventListener("keydown", function(e){ ajaxRequest(me, 'keydown', ['key='+e.keyCode]) }); } Quote Link to comment Share on other sites More sharing options...
arilotta Posted September 21, 2018 Author Share Posted September 21, 2018 Thank you Delphi Dev. It works perfectly ! Quote Link to comment Share on other sites More sharing options...
arilotta Posted September 21, 2018 Author Share Posted September 21, 2018 Hey Delphi Dev, are you ? I see that you changed your nickname, now it's "Sherzod", but I believe it's you... Quote Link to comment Share on other sites More sharing options...
GerhardV Posted September 22, 2018 Share Posted September 22, 2018 Arilotta there is a good reason for that, keep in mind that this will create a lot of network traffic as it will fire an ajax request off to the server with every keystroke...if the user types a fast 10 characters...times that with 10 users... I would like to understand the use case of this. Quote Link to comment Share on other sites More sharing options...
55143681 Posted September 23, 2018 Share Posted September 23, 2018 On 9/21/2018 at 5:09 PM, arilotta said: Hi all, it seems that UniHTMLMemo does not fire events OnKeyDown and OnKeyUp. Is there any workaround ? Thanks Andrea what is your mean I want to do something when i enter ENTER key do you mean that Quote Link to comment Share on other sites More sharing options...
arilotta Posted September 24, 2018 Author Share Posted September 24, 2018 I need to popup a dialog when the user presses F2 that allows them to insert custom pre-configured text in the component. Gerhard IV, your point is true, I changed the JS supplied by Sherzod in the following way, passing therefore only the F2 key via Ajax: function initialize(sender, eOpts) { var me=sender; me.getDoc().addEventListener("keydown", function(e){ if (e.keyCode==113) { ajaxRequest(me, 'keydown', ['key='+e.keyCode]) } }); } Quote Link to comment Share on other sites More sharing options...
GerhardV Posted September 26, 2018 Share Posted September 26, 2018 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.