Code::Blocks

User forums => Using Code::Blocks => Topic started by: jim.clarke on June 04, 2010, 10:56:51 pm

Title: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: jim.clarke on June 04, 2010, 10:56:51 pm
I'm trying out Code Blocks for the first time, so may have missed an existing answer to this question. If so, my apologies -- I did try!

Code Blocks 10.05 rev 6282, downloaded Jun 2, 2010.
Mac OS X 10.6.3
XQuartz 2.5.0

I can create a console application, compile and run it. However, changing the code is difficult, since 'f' is bound to Find, 'r' to Replace, and other letters in other ways. The space bar has its own special effect that seems to be discussed in the FAQ ("Space bar triggers code completion"), though I'm not positive that's precisely what's happening. All this makes it spectacularly impossible to change "Hello world" to "Hello world from ...".

Trying to remove the keyboard shortcuts causes the IDE to crash.

Since these issues make the IDE unusable, I must be missing something simple and would be grateful to have it pointed out to me.

Thanks!
Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: afb on June 04, 2010, 11:02:21 pm
Trying to remove the keyboard shortcuts causes the IDE to crash.

Since these issues make the IDE unusable, I must be missing something simple and would be grateful to have it pointed out to me.

The "keyboard shortcuts" plugin doesn't seem to be working unfortunately, you need to disable it.

Plugins > Manage plugins..., or remove CodeBlocks.app/Contents/Resources/share/codeblocks/libkeybinder.so
Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: afb on June 04, 2010, 11:24:10 pm
The "Cmd-" part of the modifiers aren't being recognized, only "Ctrl-".
Which means that for instance "Cmd-Shift-N" is recorded as "Shift-N".
Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: jim.clarke on June 05, 2010, 02:21:03 am
The "keyboard shortcuts" plugin doesn't seem to be working unfortunately, you need to disable it.

Plugins > Manage plugins..., or remove CodeBlocks.app/Contents/Resources/share/codeblocks/libkeybinder.so
Excellent! Thank you. It's usable now.

There's still the issue that its idea of quitting includes crashing and sending a report to Apple, but I'll let Apple worry about that one.
Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: jim.clarke on June 05, 2010, 02:22:58 am
The "Cmd-" part of the modifiers aren't being recognized, only "Ctrl-".
Which means that for instance "Cmd-Shift-N" is recorded as "Shift-N".
For the record, and only to benefit possible future readers of this thread, the trouble was that no modifier was needed: it was cheerfully taking 'f', with no modifiers at all, to start the Find command. Augh!

As noted by afb, the cure was to disable keyboard shortcuts. That may prove annoying, but not fatal.
Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: afb on June 05, 2010, 10:19:21 am
There's still the issue that its idea of quitting includes crashing and sending a report to Apple, but I'll let Apple worry about that one.

You might want to send it here (i.e. BerliOS (http://developer.berlios.de/bugs/?group_id=5358)) instead, as I think they'll just ignore those.

Supposedly you can patch Crash Reporter (http://en.wikipedia.org/wiki/Crash_Reporter_(Mac_OS_X)) to do that automatically, maybe a good idea...

Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: afb on June 05, 2010, 10:22:47 am
As noted by afb, the cure was to disable keyboard shortcuts. That may prove annoying, but not fatal.

That's not the cure, more like a workaround. It still has shortcuts, just not user editable.
The cure is to teach keybindings to remember the "Cmd-" modifier as well as the others...

Main problem here is that the wxWidgets API is different on different wxWidgets platforms.
So wxACCEL_CMD doesn't even exist on other platforms, meaning it has to use a #define...
Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: afb on June 05, 2010, 10:07:07 pm
The cure is to teach keybindings to remember the "Cmd-" modifier as well as the others...

So wxACCEL_CMD doesn't even exist on other platforms, meaning it has to use a #define...

My bad, the keybinding is "Ctrl-" even on Mac OS X (although it maps to Command key)
And wxACCEL_CMD is used on all platforms, where as wxACCEL_CTRL is "XCtrl-" on Mac.

Now fixed, in r6333.
Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: jim.clarke on June 05, 2010, 11:09:28 pm
As noted by afb, the cure was to disable keyboard shortcuts. That may prove annoying, but not fatal.

That's not the cure, more like a workaround. It still has shortcuts, just not user editable.
The cure is to teach keybindings to remember the "Cmd-" modifier as well as the others...

Main problem here is that the wxWidgets API is different on different wxWidgets platforms.
So wxACCEL_CMD doesn't even exist on other platforms, meaning it has to use a #define...
Sorry, "cure" was a poor word choice. However, it's as close to a cure as I can get: I'm considering using CodeBlocks as an IDE for students in an introductory programming course, and any more complicated fix is going to go wrong for too many of them. At least this non-cure gets us off the ground, so "thanks" was not a poor word choice.
Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: afb on June 07, 2010, 08:24:20 am
That's not the cure, more like a workaround. It still has shortcuts, just not user editable.
The cure is to teach keybindings to remember the "Cmd-" modifier as well as the others...
Sorry, "cure" was a poor word choice. However, it's as close to a cure as I can get: I'm considering using CodeBlocks as an IDE for students in an introductory programming course, and any more complicated fix is going to go wrong for too many of them. At least this non-cure gets us off the ground, so "thanks" was not a poor word choice.

Nothing to be sorry about, just that disabling the plugin is a temporary fix that shouldn't be needed. But a permanent fix has been added to svn, and will be in next release (and in next "Nightly Build")

If you have any more experiences using Code::Blocks for students, please share. Maybe it could also need an "installer" that would only copy a selected number of plugins, like it does on Windows ?
Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: jim.clarke on June 09, 2010, 03:59:11 am
Thanks, and it's very possible I'll have further questions. Right now, my attention keeps being divided by a few other issues; not returning here doesn't mean I'm not interested.

A limited version that would stress students less sounds like a good idea. I can't easily get to the Windows version -- though most students would be on Windows, so I of course have to care about it -- but will see what I can find out.
Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: vet873 on July 20, 2010, 05:15:14 pm
im having the same issues on a mac. the only problem is that i cant find the key bindings plugin inorder to disable it.
Title: Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
Post by: oBFusCATed on July 20, 2010, 10:20:56 pm
Plugins -> Manager -> Keyboard shortcuts or something like this