Author Topic: cbKeyBinder Plugin for HEAD  (Read 17591 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
cbKeyBinder Plugin for HEAD
« on: December 12, 2005, 05:55:34 pm »
@mandrav et al.

Please find attached cbKeyBndr0401.zip for HEAD

It is a much more efficient (and faster) version than
virgin wxKeyBinder. It attaches only to the first C::B frame
and any SCIwindow frames.

It avoids fooling around with disappearing wxMenuItems and
skips over menu items with file names (since c::b handles those
and keybinder shouldn't be replacing them from storage anyway).

Currently it stores the keys in %HOME% as:
 "cbKeyBinder{pluginversion}{cbMajorMinor}.ini"
because I dont know where the proper place for a plugin to store
its data should be.

One problem. The main c::b frame has no recognizable name.
So cbKeyBinder is stuffing one in as "cbMainWindow" so that
it can recognize it in keyBinder.h::wxKeyBinder::Attach().

At least one window has to be attached to allow keyBinder to
activate when no SCIwindows are open. So I chose the first one.
If you would name the first frame, I'll yank out the frame naming
code.

Note that you do not have to close windows to add keys in
cbKeyBinder.

I'm open to any and all suggestions. I hope this helps out
with the project.

thanks
pecan







[attachment deleted by admin]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: cbKeyBinder Plugin for HEAD
« Reply #1 on: December 12, 2005, 06:08:04 pm »
RE: cbKeyBinder

Another problem: it's loading the keys on a one shot timer.
As soon as I read some more of the HEAD code, I'll take
out the timer and replace it with a proper cbEVT....

thanks
pecan

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: cbKeyBinder Plugin for HEAD
« Reply #2 on: December 12, 2005, 06:08:39 pm »
Pecan,

Quote
Currently it stores the keys in %HOME% as:
 "cbKeyBinder{pluginversion}{cbMajorMinor}.ini"
because I dont know where the proper place for a plugin to store
its data should be.

In Manager::Get()->GetConfigManager(_T("app"))->GetConfigFolder() ConfigManager::GetConfigFolder() ;)

After I perform the mandatory tests, I suggest it is added in SVN (and the core wxKeyBinder be removed). Would you become its maintainer?
« Last Edit: December 12, 2005, 06:52:03 pm by mandrav »
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: cbKeyBinder Plugin for HEAD
« Reply #3 on: December 12, 2005, 06:09:17 pm »
RE: cbKeyBinder

Another problem: it's loading the keys on a one shot timer.
As soon as I read some more of the HEAD code, I'll take
out the timer and replace it with a proper cbEVT....

You might want to listen for EVT_APP_STARTUP_DONE
Be patient!
This bug will be fixed soon...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: cbKeyBinder Plugin for HEAD
« Reply #4 on: December 12, 2005, 06:15:02 pm »
@mandrav

Acknowledged.

I'd be happy to maintain it AND work on its replacement.

Will now go test with EVT_APP_STARTUP_DONE

thanks
pecan

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: cbKeyBinder Plugin for HEAD
« Reply #5 on: December 12, 2005, 06:50:42 pm »
I was wrong on how to get the config folder above. It's a static function so you just call ConfigManager::GetConfigFolder()...

Anyway, I 'll fix this before adding it to SVN (which will be in a little while)...
Be patient!
This bug will be fixed soon...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: cbKeyBinder Plugin for HEAD
« Reply #6 on: December 12, 2005, 06:56:28 pm »
Acknowledged

thanks
pecan

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: cbKeyBinder Plugin for HEAD
« Reply #7 on: December 12, 2005, 07:05:41 pm »
I 've put it in SVN and sent you a PM...
Be patient!
This bug will be fixed soon...

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: cbKeyBinder Plugin for HEAD
« Reply #8 on: December 12, 2005, 07:48:36 pm »
It seems that there is no makefile for the new plugin. At least configure complains about some missing Makefile.in:
Quote
config.status: creating src/plugins/contrib/keybinder/Makefile
config.status: error: cannot find input file: src/plugins/contrib/keybinder/Makefile.in
I think there should be a src/plugins/contrib/keybinder/Makefile.am but 'svn update' did not show one. Am I right?
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: cbKeyBinder Plugin for HEAD
« Reply #9 on: December 12, 2005, 08:49:03 pm »
It seems that there is no makefile for the new plugin. At least configure complains about some missing Makefile.in:

Added.
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: cbKeyBinder Plugin for HEAD
« Reply #10 on: December 13, 2005, 08:41:49 am »
yesterday i started using the cbKeyBinder plugin and at the first look it worked ok.

but after i started modifying my shortcut-assignments and did a few restarts of CB, the keys got messed up .
there suddenly was an offset of -2 in my keybindings

let me explain by a table for the Edit menu:

menu entry            my assignment          messed up state
Undo                     Ctrl-Z                       Ctrl-X
Redo                     Ctrl-Shift-Z                Ctrl-C
Cut                       Ctrl-X                        Ctrl-V
Copy                     Ctrl-C                        F11
Paste                    Ctrl-V                        Ctrl-B
...



btw- does keybinder plugin assist personalities ?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: cbKeyBinder Plugin for HEAD
« Reply #11 on: December 13, 2005, 09:05:14 am »
btw- does keybinder plugin assist personalities ?
If it uses ConfigManager, it has no choice. Personalitites are transparent.
"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: cbKeyBinder Plugin for HEAD
« Reply #12 on: December 13, 2005, 09:19:57 am »
btw- does keybinder plugin assist personalities ?
If it uses ConfigManager, it has no choice. Personalitites are transparent.
what i wanted to ask is - can you use different key-bindings for different personalities ?
i did'nt study the code but keybinder plugin doesn't store the key assignments in the *.conf file - which is unique to each personality -
but uses another file. so i am in doubt about.

another approach would be to make it possible to select between different key mapping files but my first thought was to use the already existing personalty feature for it.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: cbKeyBinder Plugin for HEAD
« Reply #13 on: December 13, 2005, 09:34:33 am »
Hmmm.... I see, it uses wxFileConfig. Well, that is not precisely optimal.
This does of course not support personalities.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: cbKeyBinder Plugin for HEAD
« Reply #14 on: December 13, 2005, 10:47:54 am »
It could use personalities though, by appending the current personality name to the INI filename...
Hint: Manager::Get()->GetPersonalityManager()->GetPersonality()
Be patient!
This bug will be fixed soon...