Author Topic: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing  (Read 9247 times)

Offline jim.clarke

  • Single posting newcomer
  • *
  • Posts: 5
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!

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
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

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
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".

Offline jim.clarke

  • Single posting newcomer
  • *
  • Posts: 5
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.

Offline jim.clarke

  • Single posting newcomer
  • *
  • Posts: 5
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.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
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) instead, as I think they'll just ignore those.

Supposedly you can patch Crash Reporter to do that automatically, maybe a good idea...


Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
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...

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
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.

Offline jim.clarke

  • Single posting newcomer
  • *
  • Posts: 5
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.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
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 ?

Offline jim.clarke

  • Single posting newcomer
  • *
  • Posts: 5
Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
« Reply #10 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.

Offline vet873

  • Single posting newcomer
  • *
  • Posts: 2
Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
« Reply #11 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.

Online oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12081
    • Travis build status
Re: Keyboard shortcuts on Mac in Code Blocks 10.05 interfere with editing
« Reply #12 on: July 20, 2010, 10:20:56 pm »
Plugins -> Manager -> Keyboard shortcuts or something like this
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]