Author Topic: Help-plugin and Keybinder-plugin fighting against F1 hotkey  (Read 10863 times)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Help-plugin and Keybinder-plugin fighting against F1 hotkey
« on: August 18, 2006, 01:37:42 pm »
there is some problem with the hotlkey-assignment when the Help-plugin and the Keybinder-plugin are both activated.

the help-plugin assigns F1 to the default helpfile, while keybinder erases this assignment afterwards (at least on my installation, CB rev 2871, WinXP, wxMSW263p2)
btw. is it somehow possible to specify the sequence order of plugin-loading ?

after Settings->Environment Dialog was opened & closed, the default Help-file is assigned correctly, because the Help-plugin then Reloads the Menu and
assigns F1 to the default help-file.






Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #1 on: August 18, 2006, 02:17:17 pm »
Quote
btw. is it somehow possible to specify the sequence order of plugin-loading ?

No there isn't. No plugin should depend on the initialisation order anyway...
Be patient!
This bug will be fixed soon...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2180
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #2 on: August 18, 2006, 02:56:08 pm »
Quote
the help-plugin assigns F1 to the default helpfile, while keybinder erases this assignment afterwards (at least on my installation, CB rev 2871, WinXP, wxMSW263p2)

I'm running svn 2869 without this problem. My F1 is bringing up the wxWidgets help just fine.

However, could this be because you've told keybinder to handle the F1 key by previously defining it? If so, just undefine it.

Also, please note that the cbPlugin interface changed to 1.9, so the cbKeybinder{version}.ini reverted to the virgin menu structure with no user keys defined.

You can, for this changed version, simply copy version 1.8 to the version 1.9 .ini file.

If this problem persists for you, could you give me a step-by-step example of how to recreate it? I'll have a look at it when I get home next week.

The description of this problem matches one keybinder had in the original code.   It was walking the menu structure before all the menu keys had been defined, then imposing it's saved disk structure on the menu. Thats why I used to call it zcbKeybinder so it was loaded after all other plugins. I thought I'd fixed that when the AppStartupDone event was created, but it could have crept back in.

A workaround: make sure the key is defined as you like it, check that it's so in the editor->key shortcuts, then save the keybindings.

« Last Edit: August 18, 2006, 03:11:39 pm by Pecan »

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #3 on: August 18, 2006, 09:32:05 pm »
However, could this be because you've told keybinder to handle the F1 key by previously defining it? If so, just undefine it.
just undefine didn't work, it overwrote the previously assigned setting from the help-plugin with "NO hotkey"

Also, please note that the cbPlugin interface changed to 1.9, so the cbKeybinder{version}.ini reverted to the virgin menu structure with no user keys defined.
You can, for this changed version, simply copy version 1.8 to the version 1.9 .ini file.
If this problem persists for you, could you give me a step-by-step example of how to recreate it? I'll have a look at it when I get home next week.
i tried several things and finally i got rid of this bug, when i deleted manually all lines in cbKeyBinder04v19.ini
which referenced the helpfiles. now the setting which is set-up by the help-plugin is persistent.

it looks like that the KeyBinder plugin "erases" the hot-key when you just undefine it ;)

thx Tiwag


Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2180
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #4 on: August 19, 2006, 05:18:43 am »
tiwag,

Would you describe the order in which plugins are loaded for you.
Could you also describe your help file settings.
I'd like to try and re-create this situation.

thanks
pecan

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #5 on: August 19, 2006, 07:54:29 am »
tiwag,

Would you describe the order in which plugins are loaded for you.
Could you also describe your help file settings.
I'd like to try and re-create this situation.

thanks
pecan


1. start CB (enable keybinder and help plugins)
2. assign your default help-file (F1) using the help-file-plugin (file A)
3. close CB
4. delete your cbKeyBinder04v19.ini file
5. start/close and restart CB (so that keybinder will generate a new cbKeyBinder04v19.ini file )
6. change the assignment of your default help-file (F1) using the help-file-plugin (File B),
7. close and restart CB
8. i get the settings restored from keybinder plugin, F1 is assigned to File A
9. Open Settings->Environment Dialogue, and close it.
10. now i get the settings restored from helpfile plugin, F1 is assigned to File B

my order of plugin loading is as follows:
Code: [Select]
Found 23 plugins
Loading: CodeStatistics BYOGames EnvVars CBProfiler ClassWizard CodeCompletion Autosave Compiler Debugger FilesExtensionHandler DevPakUpdater Source Exporter HelpPlugin cbKeyBinder ToDoList wxSmith wxSmithMime wxSmithWizard AStylePlugin copystrings DragScroll ScriptedWizard CB_Koders CodeSnippets
« Last Edit: August 19, 2006, 07:57:28 am by tiwag »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #6 on: August 19, 2006, 11:49:27 am »
Quote
btw. is it somehow possible to specify the sequence order of plugin-loading ?

No there isn't. No plugin should depend on the initialisation order anyway...
Yes there is!  Rename help_plugin.dll to zhelp_plugin.dll  8)

Hey, don't laugh... back in the good old days when the meadows were green, the beer was strong, the Hobbits cheerish and plentiful, and Macs did not suck so bad as they did after the introduction of PowerPC CPUs, this was the "standard" procedere to manage your two screen rows of extensions :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #7 on: August 21, 2006, 11:28:48 am »
i tried several things and finally i got rid of this bug, when i deleted manually all lines in cbKeyBinder04v19.ini
which referenced the helpfiles. now the setting which is set-up by the help-plugin is persistent.
this doesn't work, the keybinder plugin reports a erroneus ini file later on, when i try to assign another shortcut ...

the only workaround is to set the F1 hotkey with keybinder-plugin to exactly the same file as used in the help-plugin.


Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #8 on: August 21, 2006, 11:31:58 am »
Quote
btw. is it somehow possible to specify the sequence order of plugin-loading ?

No there isn't. No plugin should depend on the initialisation order anyway...
Yes there is!  Rename help_plugin.dll to zhelp_plugin.dll  8)

Hey, don't laugh... back in the good old days when the meadows were green, the beer was strong, the Hobbits cheerish and plentiful, and Macs did not suck so bad as they did after the introduction of PowerPC CPUs, this was the "standard" procedere to manage your two screen rows of extensions :)

you're right, but it doesn't help in this particular situation,
keybinder plugin seems to override the help-plugin settings even when the help-plugin is loaded after the keybinder-plugin.

this is not nice, but at least the workaround with setting the F1 shortcut twice,
once with help-file plugin and once with keybinder-plugin works...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #9 on: August 21, 2006, 09:17:54 pm »
Well, one could still register to EVT_APP_STARTUP, then start a 500ms timer and set the F1 hotkey as soon as the timer fires  :shock:
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2180
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #10 on: August 23, 2006, 04:33:00 pm »
Well, one could still register to EVT_APP_STARTUP, then start a 500ms timer and set the F1 hotkey as soon as the timer fires  :shock:

I'll fix this when I get home this week.

I'm guessing that KeyBinder never saw the  menu key when it walked the menu at startup. I'll verify that and/or find a fix.

« Last Edit: August 23, 2006, 04:36:39 pm by Pecan »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2180
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #11 on: August 25, 2006, 06:49:09 pm »
I believe I understand the problem.

Menu keys are being assigned after keyBinder initialization and keyBinder never sees or records them.

I think keyBinder needs to walk the menu structure and record the key assignments at CB close.

Too bad; lots of overhead.

The only other way: sit on an event thats says that the menu structure has changed. Lots of overhead there too.

« Last Edit: August 25, 2006, 06:53:02 pm by Pecan »

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #12 on: August 25, 2006, 08:32:06 pm »
I believe I understand the problem.

Menu keys are being assigned after keyBinder initialization and keyBinder never sees or records them.

I think keyBinder needs to walk the menu structure and record the key assignments at CB close.

Too bad; lots of overhead.

The only other way: sit on an event thats says that the menu structure has changed. Lots of overhead there too.



why not simply skipping F1 assignment ?
it's hardcoded to the help plugin anyways ...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2180
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #13 on: August 25, 2006, 09:54:49 pm »
why not simply skipping F1 assignment ?
it's hardcoded to the help plugin anyways ...
[/quote]

Because this is indicative of what would happen when other plugins decide to assign dynamic menu keys.

It should be solved or else it's gonna come back to bite us in the re"ass"ignment. :D


Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2180
Re: Help-plugin and Keybinder-plugin fighting against F1 hotkey
« Reply #14 on: September 03, 2006, 01:35:25 pm »
Fixed SVN 2944

* cbKeyBinder v0.4.25d
- record dynamically changed menu items
- Get menu shortcuts via wxAcceratorEntry to appease wxGTK
- Add file name to corrupted file message
- Non Destructive update of menu items
- backup of .ini file to .ini.bak before delete/save