Luis German Posted May 31, 2023 Share Posted May 31, 2023 Hello: I wrote a code to be executed on UniHTMLMemo1KeyDown event but notice that it is not activated. With other component like UniMemo i have no inconvenient. Thanks for your help. Luis. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 1, 2023 Share Posted June 1, 2023 9 hours ago, Luis German said: I wrote a code to be executed on UniHTMLMemo1KeyDown event but notice that it is not activated. Hello, Well, it's a complex editor. Why do you need? Quote Link to comment Share on other sites More sharing options...
Luis German Posted June 1, 2023 Author Share Posted June 1, 2023 To use Shift+enter in order to activate next control without using mouse Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 4, 2023 Share Posted June 4, 2023 On 6/1/2023 at 6:03 PM, Luis German said: To use Shift+enter in order to activate next control without using mouse Okay, need to analyze. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 4, 2023 Share Posted June 4, 2023 On 6/1/2023 at 6:03 PM, Luis German said: To use Shift+enter in order to activate next control without using mouse I was able to find one solution, but the main disadvantage is that you have to specify which control should receive focus. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 4, 2023 Share Posted June 4, 2023 Solution: 1. UniHTMLMemo1.ClientEvents.ExtEvents -> function initialize(sender, eOpts) { sender.getDoc().addEventListener('keydown', function(e) { if (e.key == 'Enter' && e.shiftKey) { e.preventDefault(); e.stopPropagation(); ajaxRequest(sender, '_tab', {}); } }); } 2. UniHTMLMemo1.OnAjaxEvent -> procedure TMainForm.UniHTMLMemo1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_tab' then UniButton1.WebFocus end; 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.