Shortcuts assigned to numerals being executed instead of inserting their num. values
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-07-31
09:31 AM
- last edited on
‎2022-10-04
04:25 PM
by
Daniel Kassai
‎2019-07-31
09:31 AM
Hello, I've got a question about shortcuts. Our users are complaining they have usually various commands assigned to the numerals. E.g. 1 is True Line Weight, 3 is Unify, 4 is intersect...
and because of that, they are not able to put those values to our virtual frame buffer window text fields ( when they try, assigned shortcut commands are executed and their values are not written into a text field ).
It's possible to disable using shortcuts temporarily? Or what workaround do you suggest? Thanks for your feedback!
and because of that, they are not able to put those values to our virtual frame buffer window text fields ( when they try, assigned shortcut commands are executed and their values are not written into a text field ).
It's possible to disable using shortcuts temporarily? Or what workaround do you suggest? Thanks for your feedback!
Labels:
- Labels:
-
Add-On (C++)
6 REPLIES 6
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-07-31 10:19 AM
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-07-31 10:54 AM
‎2019-07-31
10:54 AM
Another update: I've got the callbacks for the gain/loss of focus in the VFB text fields. Now the final question is, am I able to enable/disable shortcuts globally?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-07-31 11:12 AM
‎2019-07-31
11:12 AM
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:
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; }
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-07-31 12:58 PM
‎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; }
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-02 11:51 AM
‎2019-08-02
11:51 AM
@Tibor I've problems with DG::LowLevelKeyboardHandler as DG has no member class with this name?? Can you please assist?
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-02 03:58 PM
‎2019-08-02
03:58 PM
In the meanwhile, I tried to use `DGEnableHotKeys` and `DisableHotKeys` but this was not disabling anything at all. I was calling this on the palette..