User forums > Using Code::Blocks
Keyboard Shortcuts
(1/1)
sorinev:
I've experienced this for quite a while now (at the very least since 2011), but I can't find any information about it, so it makes me think that I'm just doing something wrong.
When I go to Settings -> Editor -> Keyboard Shortcuts (nice icon btw), and add a new shortcut to the Close File entry, it doesn't persist through closing and then reopening CodeBlocks. The default is ctrl+w. It's weird that ctrl+f4 is not the default, and in fact, is not even there (standard shortcut for closing the current file in most windows programs). So, I add ctrl+f4 as an alternate to ctrl+w. It works fine until I close CodeBlocks and then reopen it. At that point, the ctrl+f4 entry has disappeared and I have to reassign it. Since ctrl+f4 is a years-long ingrained habit, I forget about it every single time and find myself pressing it and not having anything happen (requiring me to reassign it).
Am I supposed to hit some kind of save option elsewhere in the IDE or tick some setting somewhere for new keyboard shortcut assignments to stick?
oBFusCATed:
ctrl-f4 is quite unergonomic shortcut. Also almost all linux softwares use ctrl-w, which is easier to press. So this won't change in the future.
About the reassigning it. Does it fail every time or it works for a while and then fails?
Does it work if you make an assignment for another command.
Does it work if you try to make ctrl-f4 an exclusive shortcut key?
sorinev:
--- Quote from: oBFusCATed on July 24, 2013, 12:29:11 pm ---About the reassigning it. Does it fail every time or it works for a while and then fails?
--- End quote ---
It always persists throughout the current session, but when CodeBlocks is closed and reopened, the new shortcut is always gone.
--- Quote from: oBFusCATed on July 24, 2013, 12:29:11 pm ---Does it work if you make an assignment for another command.
--- End quote ---
No, trying another sequence, it still disappears upon restart.
--- Quote from: oBFusCATed on July 24, 2013, 12:29:11 pm ---Does it work if you try to make ctrl-f4 an exclusive shortcut key?
--- End quote ---
Making a sequence the only shortcut works. It appears having two doesn't fly, with the second one always dropping after restart.
Pecan:
Some keys belong to an accelerator table defined from the very inception of CB. They're there in case KeyBinder is never loaded.
But... because the accelerators are loaded before the plugins, I suspect they wipe out user re-definitions. I'll check on it.
--- Code: --- // Accelerator table as of 2012/08/30. The first four can be removed and added
// to the app menu system. The others have no equivalent menu id's.
// We remove the entries duplicated by the menu system so that the user
// may redefine them. The non-menu entries are re-registered.
//wxAcceleratorEntry entries[8];
//entries[0].Set(wxACCEL_CTRL | wxACCEL_SHIFT, (int) 'W', idFileCloseAll);
//entries[1].Set(wxACCEL_CTRL | wxACCEL_SHIFT, WXK_F4, idFileCloseAll);
//entries[2].Set(wxACCEL_CTRL, (int) 'W', idFileClose);
//entries[3].Set(wxACCEL_CTRL, WXK_F4, idFileClose);
//entries[4].Set(wxACCEL_CTRL, WXK_F6, idFileNext);
//entries[5].Set(wxACCEL_CTRL | wxACCEL_SHIFT, WXK_F6, idFilePrev);
//entries[6].Set(wxACCEL_SHIFT, WXK_TAB, idShiftTab);
//entries[7].Set(wxACCEL_CTRL | wxACCEL_ALT, WXK_TAB, idCtrlAltTab);
--- End code ---
Navigation
[0] Message Index
Go to full version