Jean-Marc Kiener Posted September 5, 2016 Share Posted September 5, 2016 Hi experts, I try to build a form who let the user edit data from a database. I figured it out ( thanks to this forum :-) ) how to configure F1..F8 Keys so i can handle it exclusively in my app (the browser ignores them). The form property monitoredkeys stuff does the job. Great! Now i want do this with Ctrl+S, Ctrl+D, Ctrl+E etc. Is this possible? Link to comment Share on other sites More sharing options...
Sherzod Posted September 5, 2016 Share Posted September 5, 2016 Hi, For now try this: 1. MainForm->ClientEvents->UniEvents: window.afterCreate fn: function window.afterCreate(sender) { Ext.onReady(function() { document.onkeydown = function(e) { e = e || window.event; if (e.ctrlKey) { var c = e.which || e.keyCode; switch (c) { case 68: // D case 69: // E case 83: // S ajaxRequest(sender.uform, "ctrlkey", ["keycode=" + c]); e.preventDefault(); e.stopPropagation(); break; } } }; }) } 2. MainForm->onAjaxEvent: procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'ctrlkey' then begin if Params.Values['keycode'] = '83' then begin ShowMessage('Ctrl+S'); end; end; end; Best regards Link to comment Share on other sites More sharing options...
Jean-Marc Kiener Posted September 9, 2016 Author Share Posted September 9, 2016 Hi Delphi Developer, Thanks for your replay. Sorry for the delay. I will test it out as soon i have time. Very busy days... Link to comment Share on other sites More sharing options...
Jean-Marc Kiener Posted September 13, 2016 Author Share Posted September 13, 2016 Works very well, thankyou! A key combination who does not work in firefox is Ctrl + N. This shortkey will always open a new firefox windows. Th OnAjaxEvent get never called. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now