We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2019-07-31 09:31 AM - last edited on 2022-10-04 04:25 PM by Daniel Kassai
2019-07-31 10:19 AM
2019-07-31 10:54 AM
2019-07-31 11:12 AM
bool <MyDialogClass>::KeyPressed (const DG::Key::Code&, DG::Item**) { // If my dialog has the focus, then don't allow ARCHICAD to handle the shortcut short focusID; DGGetFocus (DG_ALL_DIALOGS, &focusID, nullptr); if (focusID == GetId ()) { return true; } return false; }
2019-07-31 12:58 PM
Tibor wrote:Hm, unfortunately, VFB window is not an ArchiCAD dialog and we are re-using this window across plugins. I'm able to handle events for user gain/loss focus in the text field in that window. Therefore my idea was to tell ArchiCAD there to bypass the shortcuts. Is something like this possible?
Your dialog is a modeless dialog, am I right?
In this case you should inherit your dialog class from DG::LowLevelKeyboardHandler, call InstallHandler(*this) from the constructor, call RemoveHandler(*this) from the destructor and override the KeyPressed function like this:bool <MyDialogClass>::KeyPressed (const DG::Key::Code&, DG::Item**) { // If my dialog has the focus, then don't allow ARCHICAD to handle the shortcut short focusID; DGGetFocus (DG_ALL_DIALOGS, &focusID, nullptr); if (focusID == GetId ()) { return true; } return false; }
2019-08-02 11:51 AM
2019-08-02 03:58 PM