belo Posted June 29, 2019 Posted June 29, 2019 Hi, In the attachment, an example of how to use the OnKeyDown event with the KeyMap object of the Ext.panel.Panel in TUniFrame. function beforeInit(sender, config) { config.keyMap = { a: { handler: function() { Ext.Msg.alert('key pressed', 'you have pressed a'); } }, F2: { handler: function() { ajaxRequest(sender, '_F2', []); } }, ESC: { handler: function() { ajaxRequest(sender, '_ESC', []); } }, DELETE: { handler: function() { ajaxRequest(sender, '_DELETE', []); } } } } Demo Regards, Eduardo Belo UniGUIFramesKeyEvents.rar 3 1 Quote
mikromundo Posted June 29, 2019 Posted June 29, 2019 Thanks so much !!! Brazil uniGUI Group growing up !!! Quote
mikromundo Posted July 28, 2019 Posted July 28, 2019 Following this example How can I send ANY KEY PRESSED and the SENDER to Get in the FRAME ? Ex: I click SPACE BAR in uniEDIT( named edCODIGO ) and in AJAXEVENT I Get it Quote
belo Posted July 28, 2019 Author Posted July 28, 2019 Hi Flávio! I didn't quite understand your question, but maybe it will help you.. // UniEdit function beforeInit(sender, config) { config.keyMap = { SPACE: { // keyCode = 32 handler: function() { ajaxRequest(sender, '_SPACE', []); } } } } procedure TMainForm.UniEdit1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_SPACE' then begin InsertFrame(TUniFrame(TUniFrame1), 'Frame 1', True); end; end; Best regards, Eduardo Belo Quote
mikromundo Posted July 28, 2019 Posted July 28, 2019 Thanks BELO...but its a little more complex... I want ANY KEY pressed fires the event.... and Get the key with DELPHI Quote
picyka Posted June 8, 2020 Posted June 8, 2020 The example works well, but how to use F3 for example, without triggering the browser shortcut. Quote
Sherzod Posted June 8, 2020 Posted June 8, 2020 3 hours ago, picyka said: but how to use F3 for example, without triggering the browser shortcut. \FMSoft\Framework\uniGUI\Demos\Desktop\MonitoredKeys ? Quote
picyka Posted June 8, 2020 Posted June 8, 2020 4 hours ago, Sherzod said: \FMSoft\Framework\uniGUI\Demos\Desktop\MonitoredKeys ? It really works well there, but if you take the AllFeatures Demo Frame UniFormControlsComboBox Place the code procedure TUniFormControlsComboBox.UniComboBox3KeyDown (Sender: TObject; var Key: Word; Shift: TShiftState); begin case Key of VK_F1 .. VK_F12: ShowMessage ('test'); end; end; pressing F3 will give the message, but it will call the browser's search. Quote
Sherzod Posted June 9, 2020 Posted June 9, 2020 5 hours ago, picyka said: It really works well there, but if you take the AllFeatures Demo pressing F3 will give the message, but it will call the browser's search. Well, yes, you should analyze the demo example! There are other settings. 1. MainForm.KeyPreview = True 2. MainForm.MonitoredKeys.Enabled=True, MainForm.MonitoredKeys.KeyEnableAll=False, MainForm.MonitoredKeys.KeyHandleAll=False 3. MainForm.MonitoredKeys.Keys[0] HandleBrowser=False KeyEnd=123 KeyStart=112 Quote
picyka Posted June 9, 2020 Posted June 9, 2020 5 hours ago, Sherzod said: Well, yes, you should analyze the demo example! There are other settings. 1. MainForm.KeyPreview = True 2. MainForm.MonitoredKeys.Enabled=True, MainForm.MonitoredKeys.KeyEnableAll=False, MainForm.MonitoredKeys.KeyHandleAll=False 3. MainForm.MonitoredKeys.Keys[0] HandleBrowser=False KeyEnd=123 KeyStart=112 I will test soon, thanks! Quote
Frederick Posted January 16, 2023 Posted January 16, 2023 I have two TUniEdits on a frame. Using the above JS code, how do I get the ENTER key to work as a Tab from control to control? Quote
Sherzod Posted January 16, 2023 Posted January 16, 2023 23 minutes ago, Frederick said: I have two TUniEdits on a frame. Using the above JS code, how do I get the ENTER key to work as a Tab from control to control? Hello, 23 minutes ago, Frederick said: Using the above JS code Which one? Quote
Frederick Posted January 16, 2023 Posted January 16, 2023 This one. function beforeInit(sender, config) { config.keyMap = { a: { handler: function() { Ext.Msg.alert('key pressed', 'you have pressed a'); } }, F2: { handler: function() { ajaxRequest(sender, '_F2', []); } }, ESC: { handler: function() { ajaxRequest(sender, '_ESC', []); } }, DELETE: { handler: function() { ajaxRequest(sender, '_DELETE', []); } } } } Quote
Sherzod Posted January 16, 2023 Posted January 16, 2023 config.keyMap = { ENTER: { handler: function() { } } } Quote
Frederick Posted January 16, 2023 Posted January 16, 2023 I added the above code in my test project and I cannot seem to tab or press the ENTER key to move from one TUniEdit to another. Am I missing something here? myframe.7z Quote
Sherzod Posted January 16, 2023 Posted January 16, 2023 8 minutes ago, Frederick said: I added the above code in my test project and I cannot seem to tab or press the ENTER key to move from one TUniEdit to another. Yes, this code does not do what you want. You asked how we can capture Enter, and I answered. And without this code, you can achieve what you want: UniMainModule -> Quote
Frederick Posted January 16, 2023 Posted January 16, 2023 I deleted the JS code in the BeforeInit event of the TUniFrame and set the properties of the above but the ENTER or Tab still does not move focus from one TUniEdit control to the next. Remember, the two TUniEdit controls are on a TUniFrame and not in the TUniForm. Quote
Sherzod Posted January 16, 2023 Posted January 16, 2023 Just now, Frederick said: Remember, the two TUniEdit controls are on a TUniFrame and not in the TUniForm. Yes, I know. 26 minutes ago, Frederick said: myframe.7z 54.65 kB · 0 downloads I will try to check your testcase. Quote
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.