santiago 36 Posted May 31, 2020 Hello, I have defined a KeyBoardBinding by implementing IOTAKeyboardBinding. I register my keyboard binding using IOTAKeyboardServices.AddKeyboardBinding. It is working just fine, except when I activate a DFM file (Form-Editor). If I press the shortcut keys when a DFM file is active. Nothing happens. Anyone knows how to register a keybinding such that it works in the formeditor? Thank you! Share this post Link to post
David Hoyle 68 Posted June 1, 2020 Its a little difficult to answer, not knowing what you are trying to achieve but editor key bindings do have limitations. There is nothing obvious in the OTA that suggests why it doesn't work for DFM (code) however an alternative would be to install an action in the IDE and handle it from there. You could also use the INTAEditServicesNotifier.WindowComand() to see if the keyboard binding is received by the DFM code editor. Just think while rereading your message, are you referring to the form designer? If so, it's not a code editor and so will not react to key bindings so you would need to use actions. Share this post Link to post
santiago 36 Posted June 1, 2020 @David Hoyle Thanks for the info. I ended up using a local Keyboard hook. Something which I never quite understood with the Delphi IDE was the way that Ctrl+Tab is used to switch between open tabs. Ctrl+Tab traverses the tabs in the order in which they appear in the IDE. For me that is not very practical, because most of the time I want to switch back to the last active tab. So I then had a something simple I could work on to try out Delphi 10.4. I did a plugin that displays a form (works very similar to what you get in Visual Studio when you hit Ctrl+Tab) when Ctrl+Tab is pressed. While the Ctrl key is held down, you can press the tab key to iterate the opened tabs. Once you release the Ctrl key the plugin will activate the selected view. I now have the plugin working and have been working with it for a couple of hours. Now I can't imagine working in the Delphi IDE without it. 🙂 Next weekend I will open source it. Might be useful to others as well. Share this post Link to post
Attila Kovacs 629 Posted June 1, 2020 ctrl+alt+f12, not the best hotkey though. Share this post Link to post
santiago 36 Posted June 7, 2020 @Attila Kovacs Ctrl+alt+f12 does nothing for me. Also very incovenient, as I need two hands for it. I have now made my plugin available. https://github.com/santiagoIT/DelphiCtrlTab I work a lot with other IDE's, so Ctrl+Tab behaves now to what I am used to. Makes working with Delphi for me a little less painful now. 🙂 Share this post Link to post
Attila Kovacs 629 Posted June 7, 2020 2 hours ago, santiago said: Ctrl+alt+f12 does nothing for me. Then it must be something other than Delphi. Share this post Link to post