News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

cbKeyBinder Plugin for HEAD

Started by Pecan, December 12, 2005, 05:55:34 PM

Previous topic - Next topic

Pecan

@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]

Pecan

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

mandrav

#2
Pecan,

QuoteCurrently 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?
Be patient!
This bug will be fixed soon...

mandrav

Quote from: Pecan 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....

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

Pecan

@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

mandrav

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...

Pecan


mandrav

I 've put it in SVN and sent you a PM...
Be patient!
This bug will be fixed soon...

Der Meister

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.

mandrav

Quote from: Der Meister 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:

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

tiwag

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 ?

thomas

Quote from: tiwag on December 13, 2005, 08:41:49 AMbtw- 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."

tiwag

Quote from: thomas on December 13, 2005, 09:05:14 AM
Quote from: tiwag on December 13, 2005, 08:41:49 AMbtw- 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.

thomas

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."

mandrav

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...