I just test it under windows, I remove the <accel>Ctrl-X</accel> from main_menu.xrc, and the result C::B is: If the cbEditor is still the focus window, then Ctrl+X still cut some text in the editor.
(Did you make sure to run update.bat and clear out anything in related to those shortcuts in the keybinder plugin?)
I just build Codeblocks.cbp, and no other contributed plugins were build, so no keybinder.
I have run update.bat before, I don't think it is necessary here, because in the build log:
-------------- Build: src in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler)---------------
Target is up to date.
[ 25.0%] Running target post-build steps
[ 50.0%] cmd /c if not exist devel\share\CodeBlocks mkdir devel\share\CodeBlocks
[ 75.0%] zip -jq9 devel\share\CodeBlocks\resources.zip src\resources\*.xrc
[100.0%] zip -jq9 devel\share\CodeBlocks\start_here.zip src\resources\start_here\*.html src\resources\start_here\*.png
cmd /c "cd src\resources & zip -0 -q ..\..\devel\share\CodeBlocks\resources.zip images\*.png images\16x16\*.png"
So, the xrc files was compressed to devel folders. Then I just start C::B by click the "run" or "start debug" toolbar button, this is the C::B in devel folder.
Also, there is no accelerator key shown in the menu item.
The behavior you see is as it should be. You should also be able to use Ctrl-C/X/V/A in other text entry widgets (e.g. in the symbol browser search box). If I recall correctly, you could always do this on windows because I think it was just a linux issue but I could be wrong.
I don't tried Ctrl-C/V/A, I think they are the same as Ctrl-X.
BTW: I'm not fully understand how the key-strike to event handler works.
To be honest, I don't completely either. All I know is that setting accelerators for actions that have system/toolkit default handlers creates problems on Linux, because the accelerators override the system defaults no matter what widget has the focus.
When you have CTRL+X in xrc file, then the cut event goes through:
void MainFrame::OnEditCut(cb_unused wxCommandEvent& event)
{
EditorBase* ed = Manager::Get()->GetEditorManager()->GetActiveEditor();
if (ed)
ed->Cut();
}
But if it was not in xrc, it goes through wxScintilla::OnKeyDown () : (see the bt)
[debug]#0 Editor::Cut (this=0x5216b50) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:4253
[debug]#1 0x0117c66f in Editor::WndProc (this=0x5216b50, iMessage=2177, wParam=0, lParam=0) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:7409
[debug]#2 0x01187a90 in ScintillaBase::WndProc (this=0x5216b50, iMessage=2177, wParam=0, lParam=0) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\ScintillaBase.cxx:1024
[debug]#3 0x010dd194 in ScintillaWX::WndProc (this=0x5216b50, iMessage=2177, wParam=0, lParam=0) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\ScintillaWX.cpp:898
[debug]#4 0x01174b24 in Editor::KeyDownWithModifiers (this=0x5216b50, key=88, modifiers=2, consumed=0x8c4f598) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:5741
[debug]#5 0x01174bd6 in Editor::KeyDown (this=0x5216b50, key=88, shift=false, ctrl=true, alt=false, consumed=0x8c4f598) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:5752
[debug]#6 0x010de06f in ScintillaWX::DoKeyDown (this=0x5216b50, evt=..., consumed=0x8c4f598) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\ScintillaWX.cpp:1237
[debug]#7 0x010d88aa in wxScintilla::OnKeyDown (this=0x8c4f428, evt=...) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\wxscintilla.cpp:5365
[debug]#8 0x627015f1 in wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#9 0x6276a07e in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#10 0x6276a14a in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#11 0x6276a545 in wxEvtHandler::ProcessEvent(wxEvent&) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#12 0x627a3c2c in wxWindow::HandleKeyDown(unsigned int, long) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#13 0x627a5bc3 in wxWindow::MSWWindowProc(unsigned int, unsigned int, long) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#14 0x627a0cee in wxWndProc(HWND__*, unsigned int, unsigned int, long)@16 () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#15 0x7e418734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
[debug]#16 0x0011068e in ?? ()
[debug]#17 0x7e418816 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
[debug]#18 0x627a0ca0 in wxWindow::AssociateHandle(void*) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#19 0x7e4189cd in USER32!GetWindowLongW () from C:\WINDOWS\system32\user32.dll
[debug]#20 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
My guess:I'm not sure under Windows, if a key press is an accelerated key set in the mainframe, then the key press event was translated to some menu item click event.