This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
RE: Changing keyboard bindings
I found three places in srcbar.itcl where "accelerator N" is specified -- twice for the Control menu and once for the "trace" menu which I assume is the toolbar with the step and next buttons. However when I change all three occurrences of N to Q and do make/make install it affects the Control menu but not the toolbar.
I also noticed that srctextwin.itb does some binding with bind_plain_key -- it looks like that is what affects what is actually processed, as opposed to what is actually shown.
-----Original Message-----
From: Keith Seitz [mailto:keiths@redhat.com]
Sent: Friday, February 22, 2013 4:52 PM
To: Bruce Dawson
Cc: insight@sourceware.org
Subject: Re: Changing keyboard bindings
On 02/22/2013 04:32 PM, Bruce Dawson wrote:
> I'm a long-time Windows developer and I'd like to make Insight easier
> to use for other long-time Windows developers. Can anybody point me to
> where I should look in order to try reconfiguring the keyboard
> bindings (step, run, etc.) to match Visual Studio bindings?
These are hiding in src/gdb/gdbtk/library/srcbar.itcl. The various menus there add the -accelarator, but right now, they are hard-coded.
> Such a change would have to be optional because I'm sure that the
> Linux community at large does not value Visual Studio compatibility,
> but for the initial test version I'm okay with having the change be
> unconditional.
Ideally, I would add a bunch of stuff for this to the Source Preferences, allowing the user to select from a standard list of preferences, such as "Traditional"/"Classic" for what we have now and "Windows/Visual Studio" or something. Selecting one of these would automatically fill-in all the accelerator fields, and APPLY/OK (dismissing the dialog) would then use this set to save the bindings into a bunch of new preferences, one for each accelerator (all 36 of them!). This is probably quite a bit of work to do, though.
Probably far more than you'd want to tackle. Probably more than I would want to tackle right now!
In any case, I would add a bunch of calls in srcbar.itcl to "pref get"
to get these preferences, one for each accelerator.
Replace each appearance of "-accelerator XXX" with "-accelerator [pref get gdb/src/accel/DESCRIPTION]", where DESCRIPTION is some simple description of the menu item, e.g., "run", "step", "next", "nexti", "open", "close", and so on.
Then in library/prefs.tcl, edit pref_set_defaults and add all of these with default values. [If you go the long-winded route of adding default sets, you'd set a default keyboard binding set as well.]
The code in that procedure is pretty easy to follow/mimic/cut-n-paste:
pref define gdb/src/accel/open "Ctrl+O"
pref define gdb/src/accel/run "R"
and so on
Keith